@@ -310,6 +310,12 @@ def _update_module_status(self, updated_module_status={}):
310
310
modules_status = json .load (f )
311
311
modules_status = {** modules_status , ** updated_module_status }
312
312
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
+
313
319
modules_status = {
314
320
module : {"start_time" : None , "completion_time" : None , "duration" : None }
315
321
for module in self ._modules
@@ -602,6 +608,12 @@ def _update_module_status(self, updated_module_status={}):
602
608
modules_status = json .load (f )
603
609
modules_status = {** modules_status , ** updated_module_status }
604
610
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
+
605
617
modules_status = {
606
618
module : {"start_time" : None , "completion_time" : None , "duration" : None }
607
619
for module in self ._modules
0 commit comments