@@ -354,7 +354,7 @@ def create(
354354 "Sorting and Recording have a small difference in sampling frequency. "
355355 "This could be due to rounding of floats. Using the sampling frequency from the Recording."
356356 )
357- # we make a copy here to change the smapling frequency
357+ # we make a copy here to change the sampling frequency
358358 sorting = NumpySorting .from_sorting (sorting , with_metadata = True , copy_spike_vector = True )
359359 sorting ._sampling_frequency = recording .sampling_frequency
360360 else :
@@ -491,7 +491,7 @@ def create_binary_folder(cls, folder, sorting, recording, sparsity, return_in_uV
491491 warnings .warn ("The Recording is not serializable! The recording link will be lost for future load" )
492492 else :
493493 assert rec_attributes is not None , "recording or rec_attributes must be provided"
494- warnings .warn ("Recording not provided, instntiating SortingAnalyzer in recordingless mode." )
494+ warnings .warn ("Recording not provided, instantiating SortingAnalyzer in recordingless mode." )
495495
496496 if sorting .check_serializability ("json" ):
497497 sorting .dump (folder / "sorting_provenance.json" , relative_to = folder )
@@ -543,21 +543,16 @@ def load_from_binary_folder(cls, folder, recording=None, backend_options=None):
543543 NumpyFolderSorting (folder / "sorting" ), with_metadata = True , copy_spike_vector = True
544544 )
545545
546- # load recording if possible
546+ # Try to load the recording if not provided
547547 if recording is None :
548- # try to load the recording if not provided
549- for type in ("json" , "pickle" ):
550- filename = folder / f"recording.{ type } "
548+ for file_ext in ("json" , "pickle" ):
549+ filename = folder / f"recording.{ file_ext } "
551550 if filename .exists ():
552551 try :
553552 recording = load (filename , base_folder = folder )
554553 break
555554 except :
556- recording = None
557- else :
558- # TODO maybe maybe not??? : do we need to check attributes match internal rec_attributes
559- # Note this will make the loading too slow
560- pass
555+ pass
561556
562557 # recording attributes
563558 rec_attributes_file = folder / "recording_info" / "recording_attributes.json"
0 commit comments