From dda78037d9570a529392af35055d343fc6c56022 Mon Sep 17 00:00:00 2001 From: Pierre Yger Date: Wed, 13 Sep 2023 13:26:01 +0200 Subject: [PATCH] Adding unit_ids --- .../sortingcomponents/clustering/random_projections.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/spikeinterface/sortingcomponents/clustering/random_projections.py b/src/spikeinterface/sortingcomponents/clustering/random_projections.py index 5592b23c8d..be8ecd6702 100644 --- a/src/spikeinterface/sortingcomponents/clustering/random_projections.py +++ b/src/spikeinterface/sortingcomponents/clustering/random_projections.py @@ -177,7 +177,8 @@ def main_function(cls, recording, peaks, params): mode = "folder" sorting_folder = tmp_folder / "sorting" - sorting = NumpySorting.from_times_labels(spikes["sample_index"], spikes["unit_index"], fs) + unit_ids = np.arange(len(np.unique(spikes["unit_index"]))) + sorting = NumpySorting(spikes, fs, unit_ids=unit_ids) sorting = sorting.save(folder=sorting_folder) we = extract_waveforms( recording,