@@ -310,6 +310,12 @@ def _update_module_status(self, updated_module_status={}):
310310 modules_status = json .load (f )
311311 modules_status = {** modules_status , ** updated_module_status }
312312 else :
313+ # handle cases where hash is changed(different paramset) and trying to rerun processing
314+ # delete all files in kilosort output folder, all will be regenerated when kilosort is rerun
315+ # recreate /json_configs directory after all kilosort output files are deleted
316+ shutil .rmtree (self ._ks_output_dir )
317+ self ._json_directory .mkdir (parents = True , exist_ok = True )
318+
313319 modules_status = {
314320 module : {"start_time" : None , "completion_time" : None , "duration" : None }
315321 for module in self ._modules
@@ -602,6 +608,12 @@ def _update_module_status(self, updated_module_status={}):
602608 modules_status = json .load (f )
603609 modules_status = {** modules_status , ** updated_module_status }
604610 else :
611+ # handle cases where hash is changed(different paramset) and trying to rerun processing
612+ # delete all files in kilosort output folder, all will be regenerated when kilosort is rerun
613+ # recreate /json_configs directory after all kilosort output files are deleted
614+ shutil .rmtree (self ._ks_output_dir )
615+ self ._json_directory .mkdir (parents = True , exist_ok = True )
616+
605617 modules_status = {
606618 module : {"start_time" : None , "completion_time" : None , "duration" : None }
607619 for module in self ._modules
0 commit comments