Skip to content

Commit c4a035d

Browse files
committed
noise: forgot that get_chunk_with_margin() -> tuple. also assert length is correct.
1 parent 8c1bb86 commit c4a035d

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

src/spikeinterface/generation/noise_tools.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,12 @@ def get_traces(
220220
):
221221
from scipy.signal import convolve
222222

223-
traces = get_chunk_with_margin(
223+
if start_frame is None:
224+
start_frame = 0
225+
if end_frame is None:
226+
end_frame = self.get_num_samples()
227+
228+
traces, *_ = get_chunk_with_margin(
224229
self.parent_recording_segment,
225230
start_frame=start_frame,
226231
end_frame=end_frame,
@@ -231,6 +236,7 @@ def get_traces(
231236
# need to use "direct", or else output differs numerically when start_frame, end_frame change
232237
# that's because the FFT method would FFT the traces, and there would be slight numerical differences
233238
traces = convolve(traces.T, self.kernel[None], mode="valid", method="direct").T
239+
assert traces.shape[0] == end_frame - start_frame
234240
return traces
235241

236242

0 commit comments

Comments
 (0)