From 14d2002d1838121d6ab3c6f23410153322a946b3 Mon Sep 17 00:00:00 2001 From: Pierre Yger Date: Mon, 1 Jul 2024 16:27:02 +0200 Subject: [PATCH] Issue with kept indices --- src/spikeinterface/core/analyzer_extension_core.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/spikeinterface/core/analyzer_extension_core.py b/src/spikeinterface/core/analyzer_extension_core.py index 68255efbf8..234e46aa7c 100644 --- a/src/spikeinterface/core/analyzer_extension_core.py +++ b/src/spikeinterface/core/analyzer_extension_core.py @@ -84,7 +84,7 @@ def _merge_extension_data( valid = kept_indices[self.sorting_analyzer.get_extension("random_spikes")._get_data()] nb_skipped = np.cumsum(~kept_indices) new_data["random_spikes_indices"] = np.flatnonzero(valid) - new_data["random_spikes_indices"] -= nb_skipped[valid] + new_data["random_spikes_indices"] -= nb_skipped[new_data["random_spikes_indices"]] else: new_data["random_spikes_indices"] = self.data["random_spikes_indices"] return new_data