From c992ca67fa33c806273781822a531e1fb50ee5e1 Mon Sep 17 00:00:00 2001 From: Jonah Pearl Date: Wed, 28 Aug 2024 19:00:48 -0400 Subject: [PATCH] catch more entry points --- src/spikeinterface/core/sortinganalyzer.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/spikeinterface/core/sortinganalyzer.py b/src/spikeinterface/core/sortinganalyzer.py index b0eac17aa7..fbf0307498 100644 --- a/src/spikeinterface/core/sortinganalyzer.py +++ b/src/spikeinterface/core/sortinganalyzer.py @@ -830,6 +830,8 @@ def save_as(self, format="memory", folder=None) -> "SortingAnalyzer": format : "memory" | "binary_folder" | "zarr", default: "memory" The new backend format to use """ + if format == "zarr": + folder = clean_zarr_folder_name(folder) return self._save_or_select_or_merge(format=format, folder=folder) def select_units(self, unit_ids, format="memory", folder=None) -> "SortingAnalyzer": @@ -855,6 +857,8 @@ def select_units(self, unit_ids, format="memory", folder=None) -> "SortingAnalyz The newly create sorting_analyzer with the selected units """ # TODO check that unit_ids are in same order otherwise many extension do handle it properly!!!! + if format == "zarr": + folder = clean_zarr_folder_name(folder) return self._save_or_select_or_merge(format=format, folder=folder, unit_ids=unit_ids) def remove_units(self, remove_unit_ids, format="memory", folder=None) -> "SortingAnalyzer": @@ -881,6 +885,8 @@ def remove_units(self, remove_unit_ids, format="memory", folder=None) -> "Sortin """ # TODO check that unit_ids are in same order otherwise many extension do handle it properly!!!! unit_ids = self.unit_ids[~np.isin(self.unit_ids, remove_unit_ids)] + if format == "zarr": + folder = clean_zarr_folder_name(folder) return self._save_or_select_or_merge(format=format, folder=folder, unit_ids=unit_ids) def merge_units( @@ -939,6 +945,9 @@ def merge_units( The newly create `SortingAnalyzer` with the selected units """ + if format == "zarr": + folder = clean_zarr_folder_name(folder) + assert merging_mode in ["soft", "hard"], "Merging mode should be either soft or hard" if len(merge_unit_groups) == 0: