diff --git a/src/spikeinterface/core/base.py b/src/spikeinterface/core/base.py index 4922707b35..5800166f39 100644 --- a/src/spikeinterface/core/base.py +++ b/src/spikeinterface/core/base.py @@ -881,7 +881,7 @@ def save_to_folder( Parameters ---------- - name : str , optional + name : str or Path, optional The name of the subfolder within the global temporary folder. If `folder` is provided, this argument must be None. folder : str or Path, optional diff --git a/src/spikeinterface/core/baserecording.py b/src/spikeinterface/core/baserecording.py index 773e62ffa1..e70c95bb65 100644 --- a/src/spikeinterface/core/baserecording.py +++ b/src/spikeinterface/core/baserecording.py @@ -45,7 +45,9 @@ def __init__(self, sampling_frequency: float, channel_ids: list, dtype): self.annotate(is_filtered=False) def __repr__(self): - extractor_name = self.__class__.__name__ + + class_name = self.__class__.__name__ + name_to_display = class_name num_segments = self.get_num_segments() txt = self._repr_header() @@ -55,7 +57,7 @@ def __repr__(self): split_index = txt.rfind("-", 0, 100) # Find the last "-" before character 100 if split_index != -1: first_line = txt[:split_index] - recording_string_space = len(extractor_name) + 2 # Length of extractor_name plus ": " + recording_string_space = len(name_to_display) + 2 # Length of name_to_display plus ": " white_space_to_align_with_first_line = " " * recording_string_space second_line = white_space_to_align_with_first_line + txt[split_index + 1 :].lstrip() txt = first_line + "\n" + second_line @@ -95,7 +97,8 @@ def list_to_string(lst, max_size=6): return txt def _repr_header(self): - extractor_name = self.__class__.__name__ + class_name = self.__class__.__name__ + name_to_display = class_name num_segments = self.get_num_segments() num_channels = self.get_num_channels() sf_khz = self.get_sampling_frequency() / 1000.0 @@ -106,7 +109,7 @@ def _repr_header(self): total_memory_size = self.get_total_memory_size() txt = ( - f"{extractor_name}: " + f"{name_to_display}: " f"{num_channels} channels - " f"{sf_khz:0.1f}kHz - " f"{num_segments} segments - " diff --git a/src/spikeinterface/core/binaryfolder.py b/src/spikeinterface/core/binaryfolder.py index 546ac85f93..fca08d9c26 100644 --- a/src/spikeinterface/core/binaryfolder.py +++ b/src/spikeinterface/core/binaryfolder.py @@ -25,7 +25,6 @@ class BinaryFolderRecording(BinaryRecordingExtractor): The recording """ - extractor_name = "BinaryFolder" mode = "folder" name = "binaryfolder" diff --git a/src/spikeinterface/core/binaryrecordingextractor.py b/src/spikeinterface/core/binaryrecordingextractor.py index 8fb9a78f2a..64c1b9b2e6 100644 --- a/src/spikeinterface/core/binaryrecordingextractor.py +++ b/src/spikeinterface/core/binaryrecordingextractor.py @@ -52,7 +52,6 @@ class BinaryRecordingExtractor(BaseRecording): The recording Extractor """ - extractor_name = "BinaryRecording" mode = "file" name = "binary" diff --git a/src/spikeinterface/core/npyfoldersnippets.py b/src/spikeinterface/core/npyfoldersnippets.py index 514a56fdf5..eec510aff8 100644 --- a/src/spikeinterface/core/npyfoldersnippets.py +++ b/src/spikeinterface/core/npyfoldersnippets.py @@ -26,7 +26,6 @@ class NpyFolderSnippets(NpySnippetsExtractor): The snippets """ - extractor_name = "NpyFolderSnippets" mode = "folder" name = "npyfolder" diff --git a/src/spikeinterface/core/npysnippetsextractor.py b/src/spikeinterface/core/npysnippetsextractor.py index fe66252c28..a5fb12a397 100644 --- a/src/spikeinterface/core/npysnippetsextractor.py +++ b/src/spikeinterface/core/npysnippetsextractor.py @@ -15,7 +15,6 @@ class NpySnippetsExtractor(BaseSnippets): All spike are store in two columns maner index+labels """ - extractor_name = "NpySnippets" mode = "file" name = "npy" diff --git a/src/spikeinterface/core/npzsortingextractor.py b/src/spikeinterface/core/npzsortingextractor.py index 5a40e3ba55..f60dadd8ec 100644 --- a/src/spikeinterface/core/npzsortingextractor.py +++ b/src/spikeinterface/core/npzsortingextractor.py @@ -16,7 +16,6 @@ class NpzSortingExtractor(BaseSorting): All spike are store in two columns maner index+labels """ - extractor_name = "NpzSortingExtractor" mode = "file" name = "npz" diff --git a/src/spikeinterface/core/numpyextractors.py b/src/spikeinterface/core/numpyextractors.py index 0ba1c05417..1ee472ffa4 100644 --- a/src/spikeinterface/core/numpyextractors.py +++ b/src/spikeinterface/core/numpyextractors.py @@ -37,7 +37,6 @@ class NumpyRecording(BaseRecording): An optional list of channel_ids. If None, linear channels are assumed """ - extractor_name = "Numpy" mode = "memory" name = "numpy" @@ -143,7 +142,6 @@ class SharedMemoryRecording(BaseRecording): If True, the main instance will unlink the sharedmem buffer when deleted """ - extractor_name = "SharedMemory" mode = "memory" name = "SharedMemory" diff --git a/src/spikeinterface/core/old_api_utils.py b/src/spikeinterface/core/old_api_utils.py index 65de8aedf6..ea2f20d631 100644 --- a/src/spikeinterface/core/old_api_utils.py +++ b/src/spikeinterface/core/old_api_utils.py @@ -59,8 +59,6 @@ class NewToOldSorting: * unique segment """ - extractor_name = "NewToOldSorting" - def __init__(self, sorting): assert sorting.get_num_segments() == 1 self._sorting = sorting diff --git a/src/spikeinterface/core/sortingfolder.py b/src/spikeinterface/core/sortingfolder.py index ef6f524b6c..d0751d33fa 100644 --- a/src/spikeinterface/core/sortingfolder.py +++ b/src/spikeinterface/core/sortingfolder.py @@ -22,7 +22,6 @@ class NumpyFolderSorting(BaseSorting): """ - extractor_name = "NumpyFolderSorting" mode = "folder" name = "NumpyFolder" @@ -91,7 +90,6 @@ class NpzFolderSorting(NpzSortingExtractor): The sorting """ - extractor_name = "NpzFolder" mode = "folder" name = "npzfolder" diff --git a/src/spikeinterface/core/zarrextractors.py b/src/spikeinterface/core/zarrextractors.py index ee8021fa72..4851c0eb5c 100644 --- a/src/spikeinterface/core/zarrextractors.py +++ b/src/spikeinterface/core/zarrextractors.py @@ -31,7 +31,6 @@ class ZarrRecordingExtractor(BaseRecording): The recording Extractor """ - extractor_name = "ZarrRecording" installed = True mode = "folder" installation_mesg = "" @@ -168,7 +167,6 @@ class ZarrSortingExtractor(BaseSorting): The sorting Extractor """ - extractor_name = "ZarrSorting" installed = True mode = "folder" installation_mesg = "" diff --git a/src/spikeinterface/extractors/alfsortingextractor.py b/src/spikeinterface/extractors/alfsortingextractor.py index f4287541da..fa6490135c 100644 --- a/src/spikeinterface/extractors/alfsortingextractor.py +++ b/src/spikeinterface/extractors/alfsortingextractor.py @@ -24,7 +24,6 @@ class ALFSortingExtractor(BaseSorting): The loaded data. """ - extractor_name = "ALFSorting" installation_mesg = "To use the ALF extractors, install ONE-api: \n\n pip install ONE-api\n\n" name = "alf" diff --git a/src/spikeinterface/extractors/cbin_ibl.py b/src/spikeinterface/extractors/cbin_ibl.py index 1687acb073..a09cea9863 100644 --- a/src/spikeinterface/extractors/cbin_ibl.py +++ b/src/spikeinterface/extractors/cbin_ibl.py @@ -39,7 +39,6 @@ class CompressedBinaryIblExtractor(BaseRecording): The loaded data. """ - extractor_name = "CompressedBinaryIbl" mode = "folder" installation_mesg = "To use the CompressedBinaryIblExtractor, install mtscomp: \n\n pip install mtscomp\n\n" name = "cbin_ibl" diff --git a/src/spikeinterface/extractors/cellexplorersortingextractor.py b/src/spikeinterface/extractors/cellexplorersortingextractor.py index 9b77965c43..736927a1ee 100644 --- a/src/spikeinterface/extractors/cellexplorersortingextractor.py +++ b/src/spikeinterface/extractors/cellexplorersortingextractor.py @@ -29,7 +29,6 @@ class CellExplorerSortingExtractor(BaseSorting): Path to the `sessionInfo.mat` file. If None, it will be inferred from the file_path. """ - extractor_name = "CellExplorerSortingExtractor" mode = "file" installation_mesg = "To use the CellExplorerSortingExtractor install pymatreader" diff --git a/src/spikeinterface/extractors/combinatoextractors.py b/src/spikeinterface/extractors/combinatoextractors.py index e0d01e10e5..8828ea8b64 100644 --- a/src/spikeinterface/extractors/combinatoextractors.py +++ b/src/spikeinterface/extractors/combinatoextractors.py @@ -37,7 +37,6 @@ class CombinatoSortingExtractor(BaseSorting): The loaded data. """ - extractor_name = "CombinatoSortingExtractor" installed = HAVE_H5PY installation_mesg = "To use the CombinatoSortingExtractor install h5py: \n\n pip install h5py\n\n" name = "combinato" diff --git a/src/spikeinterface/extractors/hdsortextractors.py b/src/spikeinterface/extractors/hdsortextractors.py index 1be49f70be..19038344ee 100644 --- a/src/spikeinterface/extractors/hdsortextractors.py +++ b/src/spikeinterface/extractors/hdsortextractors.py @@ -25,7 +25,6 @@ class HDSortSortingExtractor(MatlabHelper, BaseSorting): The loaded data. """ - extractor_name = "HDSortSortingExtractor" mode = "file" name = "hdsort" diff --git a/src/spikeinterface/extractors/herdingspikesextractors.py b/src/spikeinterface/extractors/herdingspikesextractors.py index 87f7dd74c4..4fe915a96b 100644 --- a/src/spikeinterface/extractors/herdingspikesextractors.py +++ b/src/spikeinterface/extractors/herdingspikesextractors.py @@ -31,7 +31,6 @@ class HerdingspikesSortingExtractor(BaseSorting): The loaded data. """ - extractor_name = "HS2Sorting" installed = HAVE_HS2SX # check at class level if installed or not mode = "file" installation_mesg = ( diff --git a/src/spikeinterface/extractors/iblextractors.py b/src/spikeinterface/extractors/iblextractors.py index 27bb95854f..b9f4c2c9c4 100644 --- a/src/spikeinterface/extractors/iblextractors.py +++ b/src/spikeinterface/extractors/iblextractors.py @@ -65,7 +65,6 @@ class IblRecordingExtractor(BaseRecording): The recording extractor which allows access to the traces. """ - extractor_name = "IblRecording" mode = "folder" installation_mesg = "To use the IblRecordingSegment, install ibllib: \n\n pip install ONE-api\npip install ibllib\n" name = "ibl_recording" @@ -305,7 +304,6 @@ class IblSortingExtractor(BaseSorting): The loaded data. """ - extractor_name = "IBLSorting" name = "ibl" installation_mesg = "IBL extractors require ibllib as a dependency." " To install, run: \n\n pip install ibllib\n\n" diff --git a/src/spikeinterface/extractors/klustaextractors.py b/src/spikeinterface/extractors/klustaextractors.py index dc01b3b9eb..82534771a1 100644 --- a/src/spikeinterface/extractors/klustaextractors.py +++ b/src/spikeinterface/extractors/klustaextractors.py @@ -43,7 +43,6 @@ class KlustaSortingExtractor(BaseSorting): The loaded data. """ - extractor_name = "KlustaSortingExtractor" installed = HAVE_H5PY # check at class level if installed or not installation_mesg = ( "To use the KlustaSortingExtractor install h5py: \n\n pip install h5py\n\n" # error message when not installed diff --git a/src/spikeinterface/extractors/matlabhelpers.py b/src/spikeinterface/extractors/matlabhelpers.py index e9948575a2..ac701c89e6 100644 --- a/src/spikeinterface/extractors/matlabhelpers.py +++ b/src/spikeinterface/extractors/matlabhelpers.py @@ -5,7 +5,6 @@ class MatlabHelper: - extractor_name = "MATSortingExtractor" mode = "file" installation_mesg = ( "To use the MATSortingExtractor install h5py and scipy: " "\n\n pip install h5py scipy\n\n" diff --git a/src/spikeinterface/extractors/mclustextractors.py b/src/spikeinterface/extractors/mclustextractors.py index ed0454f682..5cfa583054 100644 --- a/src/spikeinterface/extractors/mclustextractors.py +++ b/src/spikeinterface/extractors/mclustextractors.py @@ -29,7 +29,6 @@ class MClustSortingExtractor(BaseSorting): Loaded data. """ - extractor_name = "MClustSortingExtractor" name = "mclust" def __init__(self, folder_path, sampling_frequency, sampling_frequency_raw=None): diff --git a/src/spikeinterface/extractors/mcsh5extractors.py b/src/spikeinterface/extractors/mcsh5extractors.py index c55f9d47db..f419b7e64d 100644 --- a/src/spikeinterface/extractors/mcsh5extractors.py +++ b/src/spikeinterface/extractors/mcsh5extractors.py @@ -24,7 +24,6 @@ class MCSH5RecordingExtractor(BaseRecording): The loaded data. """ - extractor_name = "MCSH5Recording" mode = "file" installation_mesg = ( "To use the MCSH5RecordingExtractor install h5py: \n\n pip install h5py\n\n" # error message when not installed diff --git a/src/spikeinterface/extractors/mdaextractors.py b/src/spikeinterface/extractors/mdaextractors.py index 0ecad27994..acc7be58dd 100644 --- a/src/spikeinterface/extractors/mdaextractors.py +++ b/src/spikeinterface/extractors/mdaextractors.py @@ -36,7 +36,6 @@ class MdaRecordingExtractor(BaseRecording): The loaded data. """ - extractor_name = "MdaRecording" mode = "folder" name = "mda" @@ -193,7 +192,6 @@ class MdaSortingExtractor(BaseSorting): The loaded data. """ - extractor_name = "MdaSorting" mode = "file" name = "mda" diff --git a/src/spikeinterface/extractors/neoextractors/neuroscope.py b/src/spikeinterface/extractors/neoextractors/neuroscope.py index 2f6502b1c8..104f47af24 100644 --- a/src/spikeinterface/extractors/neoextractors/neuroscope.py +++ b/src/spikeinterface/extractors/neoextractors/neuroscope.py @@ -103,7 +103,6 @@ class NeuroScopeSortingExtractor(BaseSorting): Path to the .xml file referenced by this sorting. """ - extractor_name = "NeuroscopeSortingExtractor" name = "neuroscope" def __init__( diff --git a/src/spikeinterface/extractors/nwbextractors.py b/src/spikeinterface/extractors/nwbextractors.py index ccb2ff4370..9786766af1 100644 --- a/src/spikeinterface/extractors/nwbextractors.py +++ b/src/spikeinterface/extractors/nwbextractors.py @@ -472,7 +472,6 @@ class NwbRecordingExtractor(BaseRecording): >>> rec = NwbRecordingExtractor(s3_url, stream_mode="fsspec", stream_cache_path="cache") """ - extractor_name = "NwbRecording" mode = "file" name = "nwb" installation_mesg = "To use the Nwb extractors, install pynwb: \n\n pip install pynwb\n\n" @@ -1001,7 +1000,6 @@ class NwbSortingExtractor(BaseSorting): The sorting extractor for the NWB file. """ - extractor_name = "NwbSorting" mode = "file" installation_mesg = "To use the Nwb extractors, install pynwb: \n\n pip install pynwb\n\n" name = "nwb" diff --git a/src/spikeinterface/extractors/phykilosortextractors.py b/src/spikeinterface/extractors/phykilosortextractors.py index e65ff0adfb..3287f7422f 100644 --- a/src/spikeinterface/extractors/phykilosortextractors.py +++ b/src/spikeinterface/extractors/phykilosortextractors.py @@ -26,7 +26,6 @@ class BasePhyKilosortSortingExtractor(BaseSorting): If True, all cluster properties are loaded from the tsv/csv files. """ - extractor_name = "BasePhyKilosortSorting" installed = False # check at class level if installed or not mode = "folder" installation_mesg = ( @@ -229,7 +228,6 @@ class PhySortingExtractor(BasePhyKilosortSortingExtractor): The loaded Sorting object. """ - extractor_name = "PhySorting" name = "phy" def __init__( @@ -271,7 +269,6 @@ class KiloSortSortingExtractor(BasePhyKilosortSortingExtractor): The loaded Sorting object. """ - extractor_name = "KiloSortSorting" name = "kilosort" def __init__(self, folder_path: Path | str, keep_good_only: bool = False, remove_empty_units: bool = True): diff --git a/src/spikeinterface/extractors/shybridextractors.py b/src/spikeinterface/extractors/shybridextractors.py index 86a5276d62..b53b3b2056 100644 --- a/src/spikeinterface/extractors/shybridextractors.py +++ b/src/spikeinterface/extractors/shybridextractors.py @@ -30,7 +30,6 @@ class SHYBRIDRecordingExtractor(BinaryRecordingExtractor): Loaded data. """ - extractor_name = "SHYBRIDRecording" mode = "folder" installation_mesg = ( "To use the SHYBRID extractors, install SHYBRID and pyyaml: " "\n\n pip install shybrid pyyaml\n\n" @@ -159,7 +158,6 @@ class SHYBRIDSortingExtractor(BaseSorting): Loaded data. """ - extractor_name = "SHYBRIDSorting" installation_mesg = "To use the SHYBRID extractors, install SHYBRID: \n\n pip install shybrid\n\n" name = "shybrid" diff --git a/src/spikeinterface/extractors/spykingcircusextractors.py b/src/spikeinterface/extractors/spykingcircusextractors.py index af966cb823..7c3fb154fe 100644 --- a/src/spikeinterface/extractors/spykingcircusextractors.py +++ b/src/spikeinterface/extractors/spykingcircusextractors.py @@ -29,7 +29,6 @@ class SpykingCircusSortingExtractor(BaseSorting): Loaded data. """ - extractor_name = "SpykingCircusSortingExtractor" installed = HAVE_H5PY # check at class level if installed or not mode = "folder" installation_mesg = "To use the SpykingCircusSortingExtractor install h5py: \n\n pip install h5py\n\n" diff --git a/src/spikeinterface/extractors/tridesclousextractors.py b/src/spikeinterface/extractors/tridesclousextractors.py index 531af3d9da..8589f03fd4 100644 --- a/src/spikeinterface/extractors/tridesclousextractors.py +++ b/src/spikeinterface/extractors/tridesclousextractors.py @@ -22,7 +22,6 @@ class TridesclousSortingExtractor(BaseSorting): Loaded data. """ - extractor_name = "TridesclousSortingExtractor" mode = "folder" installation_mesg = "To use the TridesclousSortingExtractor install tridesclous: \n\n pip install tridesclous\n\n" # error message when not installed name = "tridesclous" diff --git a/src/spikeinterface/extractors/waveclussnippetstextractors.py b/src/spikeinterface/extractors/waveclussnippetstextractors.py index 56f66aec8a..7c26eee7bd 100644 --- a/src/spikeinterface/extractors/waveclussnippetstextractors.py +++ b/src/spikeinterface/extractors/waveclussnippetstextractors.py @@ -10,7 +10,6 @@ class WaveClusSnippetsExtractor(MatlabHelper, BaseSnippets): - extractor_name = "WaveClusSnippetsExtractor" name = "waveclus" def __init__(self, file_path): diff --git a/src/spikeinterface/extractors/waveclustextractors.py b/src/spikeinterface/extractors/waveclustextractors.py index 02c668a902..844b1cc7cf 100644 --- a/src/spikeinterface/extractors/waveclustextractors.py +++ b/src/spikeinterface/extractors/waveclustextractors.py @@ -25,7 +25,6 @@ class WaveClusSortingExtractor(MatlabHelper, BaseSorting): Loaded data. """ - extractor_name = "WaveClusSortingExtractor" name = "waveclus" def __init__(self, file_path, keep_good_only=True): diff --git a/src/spikeinterface/extractors/yassextractors.py b/src/spikeinterface/extractors/yassextractors.py index 729df81c65..61a49ccf01 100644 --- a/src/spikeinterface/extractors/yassextractors.py +++ b/src/spikeinterface/extractors/yassextractors.py @@ -29,7 +29,6 @@ class YassSortingExtractor(BaseSorting): Loaded data. """ - extractor_name = "YassExtractor" mode = "folder" installed = HAVE_YAML # check at class level if installed or not installation_mesg = (