Skip to content

Commit 9b15b42

Browse files
authored
Merge branch 'main' into fix-nk-cal-factor
2 parents 57df33e + 610ebe5 commit 9b15b42

File tree

4 files changed

+8
-3
lines changed

4 files changed

+8
-3
lines changed

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
repos:
22
# Ruff mne
33
- repo: https://github.com/astral-sh/ruff-pre-commit
4-
rev: v0.14.1
4+
rev: v0.14.2
55
hooks:
66
- id: ruff-check
77
name: ruff lint mne
@@ -82,7 +82,7 @@ repos:
8282

8383
# zizmor
8484
- repo: https://github.com/woodruffw/zizmor-pre-commit
85-
rev: v1.15.2
85+
rev: v1.16.0
8686
hooks:
8787
- id: zizmor
8888

doc/changes/dev/13466.bugfix.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix bug with :func:`mne.add_reference_channels` not working correctly when passing more than one channel name, by `Michael Straube`_.

mne/_fiff/reference.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ def add_reference_channels(inst, ref_channels, copy=True):
316316
"unit_mul": FIFF.FIFF_UNITM_NONE,
317317
"unit": FIFF.FIFF_UNIT_V,
318318
"coord_frame": FIFF.FIFFV_COORD_HEAD,
319-
"loc": ref_dig_array,
319+
"loc": ref_dig_array.copy(),
320320
}
321321
inst.info["chs"].append(chan_info)
322322
inst.info._update_redundant()

mne/_fiff/tests/test_reference.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -744,6 +744,10 @@ def test_add_reference():
744744
ref_data, _ = raw[[ref_idx, ref_idy]]
745745
assert_array_equal(ref_data, 0)
746746

747+
loc1 = raw.info["chs"][ref_idx]["loc"]
748+
loc2 = raw.info["chs"][ref_idy]["loc"]
749+
assert loc1 is not loc2
750+
747751
# add reference channel to epochs
748752
raw = read_raw_fif(fif_fname, preload=True)
749753
events = read_events(eve_fname)

0 commit comments

Comments
 (0)