From 7fb871c8a8b2124388f2c12a73da58fb157e2168 Mon Sep 17 00:00:00 2001 From: Alex Rockhill Date: Thu, 4 Jan 2024 16:47:19 -0800 Subject: [PATCH] fix tests --- mne/channels/interpolation.py | 6 +++--- mne/channels/tests/test_interpolation.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/mne/channels/interpolation.py b/mne/channels/interpolation.py index f58fb18faac..7cde0bb13a4 100644 --- a/mne/channels/interpolation.py +++ b/mne/channels/interpolation.py @@ -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( diff --git a/mne/channels/tests/test_interpolation.py b/mne/channels/tests/test_interpolation.py index 94e8b2f82af..6acfc60d886 100644 --- a/mne/channels/tests/test_interpolation.py +++ b/mne/channels/tests/test_interpolation.py @@ -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")