Skip to content

Commit 43fdf2b

Browse files
committed
Use built-in segment slices
1 parent bdd000d commit 43fdf2b

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/spikeinterface/core/sorting_tools.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -391,10 +391,9 @@ def apply_merges_to_sorting(
391391
all_unit_ids = list(all_unit_ids)
392392

393393
num_seg = sorting.get_num_segments()
394-
seg_lims = np.searchsorted(spikes["segment_index"], np.arange(0, num_seg + 2))
395-
segment_slices = [(seg_lims[i], seg_lims[i + 1]) for i in range(num_seg)]
394+
segment_slices = sorting._get_spike_vector_segment_slices()
396395

397-
# using this function vaoid to use the mask approach and simplify a lot the algo
396+
# using this function avoids to use the mask approach and simplify a lot the algo
398397
spike_vector_list = [spikes[s0:s1] for s0, s1 in segment_slices]
399398
spike_indices = spike_vector_to_indices(spike_vector_list, sorting.unit_ids, absolute_index=True)
400399

0 commit comments

Comments
 (0)