Skip to content

Commit e818f30

Browse files
authored
Merge pull request #3691 from alejoe91/fix-3690
Fix `chunk_size_limit` in `get_random_recording_slices`
2 parents 0abf639 + 4908d39 commit e818f30

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/spikeinterface/core/recording_tools.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -586,7 +586,9 @@ def get_random_recording_slices(
586586
for segment_index in range(num_segments):
587587
num_frames = recording.get_num_frames(segment_index)
588588
high = num_frames - chunk_size - margin_frames
589-
random_starts = rng.integers(low=low, high=high, size=size)
589+
# here we set endpoint to True, because the this represents the start of the
590+
# chunk, and should be inclusive
591+
random_starts = rng.integers(low=low, high=high, size=size, endpoint=True)
590592
random_starts = np.sort(random_starts)
591593
recording_slices += [
592594
(segment_index, start_frame, (start_frame + chunk_size)) for start_frame in random_starts

0 commit comments

Comments
 (0)