@@ -294,15 +294,16 @@ class IblSortingExtractor(BaseSorting):
294294 >>> one = ONE(base_url="https://openalyx.internationalbrainlab.org", password="international", silent=True)
295295 >>> pids, _ = one.eid2pid("session_eid")
296296 >>> pid = pids[0]
297+ one: One | dict, required
298+ Instance of ONE.api or dict to use for data loading.
299+ For multi-processing applications, this can also be a dictionary of ONE.api arguments
300+ For example: one=dict(base_url='https://alyx.internationalbrainlab.org', mode='remote')
297301 good_clusters_only: bool, default: False
298302 If True, only load the good clusters
299303 load_unit_properties: bool, default: True
300304 If True, load the unit properties from the IBL database
301- one: One | dict, default: None
302- Instance of ONE.api or dict to use for data loading.
303- For multi-processing applications, this can also be a dictionary of ONE.api arguments
304- For example: one={} or one=dict(base_url='https://alyx.internationalbrainlab.org', mode='remote')
305-
305+ kwargs: dict, optional
306+ Additional keyword arguments to pass to the IBL SpikeSortingLoader constructor, such as `revision`.
306307 Returns
307308 -------
308309 extractor : IBLSortingExtractor
@@ -311,13 +312,14 @@ class IblSortingExtractor(BaseSorting):
311312
312313 installation_mesg = "IBL extractors require ibllib as a dependency." " To install, run: \n \n pip install ibllib\n \n "
313314
314- def __init__ (self , pid : str , good_clusters_only : bool = False , load_unit_properties : bool = True , one = None ):
315+ def __init__ (
316+ self , pid : str , good_clusters_only : bool = False , load_unit_properties : bool = True , one = None , ** kwargs
317+ ):
315318 try :
316319 from one .api import ONE
317320 from brainbox .io .one import SpikeSortingLoader
318321
319- if one is None :
320- one = {}
322+ assert one is not None , "one is a required parameter."
321323 if isinstance (one , dict ):
322324 one = ONE (** one )
323325 else :
@@ -327,12 +329,11 @@ def __init__(self, pid: str, good_clusters_only: bool = False, load_unit_propert
327329 self .ssl = SpikeSortingLoader (one = one , pid = pid )
328330 sr = self .ssl .raw_electrophysiology (band = "ap" , stream = True )
329331 self ._folder_path = self .ssl .session_path
330- spikes , clusters , channels = self .ssl .load_spike_sorting (dataset_types = ["spikes.samples" ])
332+ spikes , clusters , channels = self .ssl .load_spike_sorting (dataset_types = ["spikes.samples" ], ** kwargs )
331333 clusters = self .ssl .merge_clusters (spikes , clusters , channels )
332334
333335 if good_clusters_only :
334336 good_cluster_slice = clusters ["cluster_id" ][clusters ["label" ] == 1 ]
335- unit_ids = clusters ["cluster_id" ][good_cluster_slice ]
336337 else :
337338 good_cluster_slice = slice (None )
338339 unit_ids = clusters ["cluster_id" ][good_cluster_slice ]
0 commit comments