@@ -223,13 +223,13 @@ class SortingAnalyzer:
223223
224224 def __init__ (
225225 self ,
226- sorting = None ,
227- recording = None ,
228- rec_attributes = None ,
229- format = None ,
230- sparsity = None ,
231- return_scaled = True ,
232- backend_options = None ,
226+ sorting : BaseSorting ,
227+ recording : BaseRecording | None = None ,
228+ rec_attributes : dict | None = None ,
229+ format : str | None = None ,
230+ sparsity : ChannelSparsity | None = None ,
231+ return_scaled : bool = True ,
232+ backend_options : dict | None = None ,
233233 ):
234234 # very fast init because checks are done in load and create
235235 self .sorting = sorting
@@ -239,6 +239,7 @@ def __init__(
239239 self .format = format
240240 self .sparsity = sparsity
241241 self .return_scaled = return_scaled
242+ self .folder : str | Path | None = None
242243
243244 # this is used to store temporary recording
244245 self ._temporary_recording = None
@@ -748,6 +749,7 @@ def set_unit_property(
748749 values : list | np .ndarray | tuple ,
749750 ids : list | np .ndarray | tuple | None = None ,
750751 missing_value : Any = None ,
752+ save : bool = True ,
751753 ) -> None :
752754 """
753755 Set property vector for unit ids.
@@ -767,11 +769,13 @@ def set_unit_property(
767769 if None all the ids are set or changed
768770 missing_value : Any, default: None
769771 In case the property is set on a subset of values ("ids" not None),
770- This argument specifies how to fill missing values
772+ This argument specifies how to fill missing values.
771773 The `missing_value` is required for types int and unsigned int.
774+ save : bool, default: True
775+ If True, the property is saved to the backend if possible.
772776 """
773777 self .sorting .set_property (key , values , ids = ids , missing_value = missing_value )
774- if not self .is_read_only ():
778+ if not self .is_read_only () and save :
775779 if self .format == "binary_folder" :
776780 np .save (self .folder / "sorting" / "properties" / f"{ key } .npy" , self .sorting .get_property (key ))
777781 elif self .format == "zarr" :
0 commit comments