@@ -139,16 +139,18 @@ def _run_pykilosort(self, ap_file):
139139 """
140140 self .version = self ._fetch_pykilosort_version (self .PYKILOSORT_REPO )
141141 label = ap_file .parts [- 2 ] # this is usually the probe name
142- if ap_file .parent .joinpath (f"spike_sorting_{ self .SPIKE_SORTER_NAME } .log" ).exists ():
143- _logger .info (f"Already ran: spike_sorting_{ self .SPIKE_SORTER_NAME } .log"
144- f" found for { ap_file } , skipping." )
145- return ap_file .parent
146- sorter_dir = self .session_path .joinpath ("spike_sorters" , self .SPIKE_SORTER_NAME , label )
147- print (sorter_dir .joinpath (f"spike_sorting_{ self .SPIKE_SORTER_NAME } .log" ))
148- if sorter_dir .joinpath (f"spike_sorting_{ self .SPIKE_SORTER_NAME } .log" ).exists ():
149- _logger .info (f"Already ran: spike_sorting_{ self .SPIKE_SORTER_NAME } .log"
150- f" found in { sorter_dir } , skipping." )
151- return sorter_dir
142+ FORCE_RERUN = True
143+ if not FORCE_RERUN :
144+ if ap_file .parent .joinpath (f"spike_sorting_{ self .SPIKE_SORTER_NAME } .log" ).exists ():
145+ _logger .info (f"Already ran: spike_sorting_{ self .SPIKE_SORTER_NAME } .log"
146+ f" found for { ap_file } , skipping." )
147+ return ap_file .parent
148+ sorter_dir = self .session_path .joinpath ("spike_sorters" , self .SPIKE_SORTER_NAME , label )
149+ print (sorter_dir .joinpath (f"spike_sorting_{ self .SPIKE_SORTER_NAME } .log" ))
150+ if sorter_dir .joinpath (f"spike_sorting_{ self .SPIKE_SORTER_NAME } .log" ).exists ():
151+ _logger .info (f"Already ran: spike_sorting_{ self .SPIKE_SORTER_NAME } .log"
152+ f" found in { sorter_dir } , skipping." )
153+ return sorter_dir
152154 # get the scratch drive from the shell script
153155 with open (self .SHELL_SCRIPT ) as fid :
154156 lines = fid .readlines ()
0 commit comments