@@ -65,18 +65,18 @@ def create_sorting_analyzer(
6565 recording : Recording
6666 The recording object
6767 folder : str or Path or None, default: None
68- The folder where waveforms are cached
68+ The folder where analyzer is cached
6969 format : "memory | "binary_folder" | "zarr", default: "memory"
70- The mode to store waveforms . If "folder", waveforms are stored on disk in the specified folder.
70+ The mode to store analyzer . If "folder", the analyzer is stored on disk in the specified folder.
7171 The "folder" argument must be specified in case of mode "folder".
72- If "memory" is used, the waveforms are stored in RAM. Use this option carefully!
72+ If "memory" is used, the analyzer is stored in RAM. Use this option carefully!
7373 sparse : bool, default: True
7474 If True, then a sparsity mask is computed using the `estimate_sparsity()` function using
7575 a few spikes to get an estimate of dense templates to create a ChannelSparsity object.
7676 Then, the sparsity will be propagated to all ResultExtention that handle sparsity (like wavforms, pca, ...)
7777 You can control `estimate_sparsity()` : all extra arguments are propagated to it (included job_kwargs)
7878 sparsity : ChannelSparsity or None, default: None
79- The sparsity used to compute waveforms . If this is given, `sparse` is ignored.
79+ The sparsity used to compute exensions . If this is given, `sparse` is ignored.
8080 return_scaled : bool, default: True
8181 All extensions that play with traces will use this global return_scaled : "waveforms", "noise_levels", "templates".
8282 This prevent return_scaled being differents from different extensions and having wrong snr for instance.
@@ -98,7 +98,7 @@ def create_sorting_analyzer(
9898 --------
9999 >>> import spikeinterface as si
100100
101- >>> # Extract dense waveforms and save to disk with binary_folder format.
101+ >>> # Create dense analyzer and save to disk with binary_folder format.
102102 >>> sorting_analyzer = si.create_sorting_analyzer(sorting, recording, format="binary_folder", folder="/path/to_my/result")
103103
104104 >>> # Can be reload
@@ -172,22 +172,40 @@ def load_sorting_analyzer(folder, load_extensions=True, format="auto", backend_o
172172 Parameters
173173 ----------
174174 folder : str or Path
175- The folder / zarr folder where the waveform extractor is stored
175+ The folder / zarr folder where the analyzer is stored. If the folder is a remote path stored in the cloud,
176+ the backend_options can be used to specify credentials. If the remote path is not accessible,
177+ and backend_options is not provided, the function will try to load the object in anonymous mode (anon=True),
178+ which enables to load data from open buckets.
176179 load_extensions : bool, default: True
177180 Load all extensions or not.
178181 format : "auto" | "binary_folder" | "zarr"
179182 The format of the folder.
180- storage_options : dict | None, default: None
181- The storage options to specify credentials to remote zarr bucket.
182- For open buckets, it doesn't need to be specified.
183+ backend_options : dict | None, default: None
184+ The backend options for the backend.
185+ The dictionary can contain the following keys:
186+ - storage_options: dict | None (fsspec storage options)
187+ - saving_options: dict | None (additional saving options for creating and saving datasets)
183188
184189 Returns
185190 -------
186191 sorting_analyzer : SortingAnalyzer
187192 The loaded SortingAnalyzer
188193
189194 """
190- return SortingAnalyzer .load (folder , load_extensions = load_extensions , format = format , backend_options = backend_options )
195+ if is_path_remote (folder ) and backend_options is None :
196+ try :
197+ return SortingAnalyzer .load (
198+ folder , load_extensions = load_extensions , format = format , backend_options = backend_options
199+ )
200+ except Exception as e :
201+ backend_options = dict (storage_options = dict (anon = True ))
202+ return SortingAnalyzer .load (
203+ folder , load_extensions = load_extensions , format = format , backend_options = backend_options
204+ )
205+ else :
206+ return SortingAnalyzer .load (
207+ folder , load_extensions = load_extensions , format = format , backend_options = backend_options
208+ )
191209
192210
193211class SortingAnalyzer :
@@ -2286,7 +2304,7 @@ def delete(self):
22862304
22872305 def reset (self ):
22882306 """
2289- Reset the waveform extension.
2307+ Reset the extension.
22902308 Delete the sub folder and create a new empty one.
22912309 """
22922310 self ._reset_extension_folder ()
0 commit comments