Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
alexrockhill committed Jan 5, 2024
1 parent 747c448 commit 7fb871c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions mne/channels/interpolation.py
Original file line number Diff line number Diff line change
Expand Up @@ -345,13 +345,13 @@ def _interpolate_bads_seeg(inst, exclude=None, tol=2e-3, verbose=None):
"interpolation, fix the positions or exclude this channel"
)
bads_shaft = np.array([idx for idx in picks_bad if idx in shaft])
goods_shaft = shaft[~np.in1d(shaft, bads_shaft)]
goods_shaft = shaft[~np.isin(shaft, bads_shaft)]
logger.debug(
f"Interpolating {np.array(inst.ch_names)[bads_shaft]} using "
f"data from {np.array(inst.ch_names)[goods_shaft]}"
)
bads_shaft_idx = np.where(np.in1d(shaft, bads_shaft))[0]
goods_shaft_idx = np.where(~np.in1d(shaft, bads_shaft))[0]
bads_shaft_idx = np.where(np.isin(shaft, bads_shaft))[0]
goods_shaft_idx = np.where(~np.isin(shaft, bads_shaft))[0]
for bad in bads_shaft:
picks_bad.remove(bad) # interpolating, remove
ts = np.array(
Expand Down
2 changes: 1 addition & 1 deletion mne/channels/tests/test_interpolation.py
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ def test_interpolation_ieeg():
raw_seeg = RawArray(data=epochs_seeg._data[0], info=epochs_seeg.info)
raw_before = raw_seeg._data[bads_idx]
with pytest.raises(RuntimeError, match="Only 2 contact positions"):
raw_seeg.interpolate_bads(method=dict(seeg="linear"))._data[bads_idx]
raw_seeg.interpolate_bads(method=dict(seeg="spline"))._data[bads_idx]
montage = raw_seeg.get_montage()
pos = montage.get_positions()
ch_pos = pos.pop("ch_pos")
Expand Down

0 comments on commit 7fb871c

Please sign in to comment.