Skip to content

Commit

Permalink
Patch for scipy
Browse files Browse the repository at this point in the history
  • Loading branch information
yger committed Oct 4, 2023
1 parent 7d9c075 commit e97005a
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/spikeinterface/preprocessing/remove_artifacts.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import numpy as np
import scipy

from spikeinterface.core.core_tools import define_function_from_class

Expand Down Expand Up @@ -108,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 @@ -237,7 +234,6 @@ def __init__(
time_pad,
sparsity,
):
import scipy.interpolate

BasePreprocessorSegment.__init__(self, parent_recording_segment)

Expand All @@ -255,6 +251,8 @@ def __init__(
self.sparsity = sparsity

def get_traces(self, start_frame, end_frame, channel_indices):


if self.mode in ["average", "median"]:
traces = self.parent_recording_segment.get_traces(start_frame, end_frame, slice(None))
else:
Expand Down Expand Up @@ -286,6 +284,7 @@ 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 e97005a

Please sign in to comment.