Skip to content

Commit

Permalink
Merge pull request #2072 from yger/patch_scipy
Browse files Browse the repository at this point in the history
Patch with scipy for remove_artefacts when mode is linear/cubic
  • Loading branch information
yger authored Oct 5, 2023
2 parents 8559546 + b0da0c0 commit 20f20e4
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/spikeinterface/preprocessing/remove_artifacts.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,6 @@ def __init__(
time_jitter=0,
waveforms_kwargs={"allow_unfiltered": True, "mode": "memory"},
):
import scipy.interpolate

available_modes = ("zeros", "linear", "cubic", "average", "median")
num_seg = recording.get_num_segments()

Expand Down Expand Up @@ -236,8 +234,6 @@ def __init__(
time_pad,
sparsity,
):
import scipy.interpolate

BasePreprocessorSegment.__init__(self, parent_recording_segment)

self.triggers = np.asarray(triggers, dtype="int64")
Expand Down Expand Up @@ -285,6 +281,8 @@ def get_traces(self, start_frame, end_frame, channel_indices):
elif trig + pad[1] >= end_frame - start_frame:
traces[trig - pad[0] :, :] = 0
elif self.mode in ["linear", "cubic"]:
import scipy.interpolate

for trig in triggers:
if pad is None:
pre_data_end_idx = trig - 1
Expand Down

0 comments on commit 20f20e4

Please sign in to comment.