Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Jan 4, 2024
1 parent 3264e36 commit 0376bd7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 10 deletions.
4 changes: 2 additions & 2 deletions mne/channels/channels.py
Original file line number Diff line number Diff line change
Expand Up @@ -870,11 +870,11 @@ def interpolate_bads(
.. versionadded:: 0.9.0
"""
from .interpolation import (
_interpolate_bads_nan,
_interpolate_bads_ecog,
_interpolate_bads_eeg,
_interpolate_bads_meeg,
_interpolate_bads_nan,
_interpolate_bads_nirs,
_interpolate_bads_ecog,
_interpolate_bads_seeg,
)

Expand Down
7 changes: 3 additions & 4 deletions mne/channels/interpolation.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@

import numpy as np
from numpy.polynomial.legendre import legval
from scipy.interpolate import RectBivariateSpline
from scipy.linalg import pinv
from scipy.spatial.distance import pdist, squareform
from scipy.interpolate import RectBivariateSpline

from .._fiff.meas_info import _simplify_info
from .._fiff.pick import pick_channels, pick_info, pick_types
from ..surface import _normalize_vectors
from ..utils import _check_option, _validate_type, logger, verbose, warn
from ..utils import _validate_type, logger, verbose, warn


def _calc_h(cosang, stiffness=4, n_legendre_terms=50):
Expand Down Expand Up @@ -358,6 +358,5 @@ def _interpolate_bads_seeg(inst, exclude=None, tol=2e-3, verbose=None):
)
y = np.arange(inst._data.shape[-1])
inst._data[bads_shaft] = RectBivariateSpline(
x=ts[goods_shaft_idx], y=y,
z=inst._data[goods_shaft]
x=ts[goods_shaft_idx], y=y, z=inst._data[goods_shaft]
)(x=ts[bads_shaft_idx], y=y) # 3
6 changes: 2 additions & 4 deletions mne/channels/tests/test_interpolation.py
Original file line number Diff line number Diff line change
Expand Up @@ -358,12 +358,10 @@ 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="linear"))._data[bads_idx]
montage = raw_seeg.get_montage()
pos = montage.get_positions()
ch_pos = pos.pop('ch_pos')
ch_pos = pos.pop("ch_pos")
n0 = ch_pos[epochs_seeg.ch_names[0]]
n1 = ch_pos[epochs_seeg.ch_names[1]]
for i, ch in enumerate(epochs_seeg.ch_names[2:]):
Expand Down

0 comments on commit 0376bd7

Please sign in to comment.