@@ -93,7 +93,7 @@ class SpikeSorting(tasks.Task):
9393 "Documents/PYTHON/iblscripts/deploy/serverpc/kilosort2/run_pykilosort.sh"
9494 )
9595 SPIKE_SORTER_NAME = 'pykilosort'
96- PYKILOSORT_REPO = '~/ Documents/PYTHON/SPIKE_SORTING/pykilosort'
96+ PYKILOSORT_REPO = Path . home (). joinpath ( ' Documents/PYTHON/SPIKE_SORTING/pykilosort')
9797
9898 @staticmethod
9999 def _sample2v (ap_file ):
@@ -113,7 +113,7 @@ def _fetch_pykilosort_version(repo_path):
113113 version = line .split ('=' )[- 1 ].strip ().replace ('"' , '' ).replace ("'" , '' )
114114 except Exception :
115115 pass
116- return version
116+ return f"pykilosort_ { version } "
117117
118118 @staticmethod
119119 def _fetch_ks2_commit_hash (repo_path ):
@@ -137,7 +137,7 @@ def _run_pykilosort(self, ap_file):
137137 session_path/spike_sorters/{ self .SPIKE_SORTER_NAME } /probeXX folder
138138 :return: path of the folder containing ks2 spike sorting output
139139 """
140-
140+ self . version = self . _fetch_pykilosort_version ( self . PYKILOSORT_REPO )
141141 label = ap_file .parts [- 2 ] # this is usually the probe name
142142 if ap_file .parent .joinpath (f"spike_sorting_{ self .SPIKE_SORTER_NAME } .log" ).exists ():
143143 _logger .info (f"Already ran: spike_sorting_{ self .SPIKE_SORTER_NAME } .log"
@@ -194,7 +194,6 @@ def _run_pykilosort(self, ap_file):
194194
195195 shutil .copytree (temp_dir .joinpath ('output' ), sorter_dir , dirs_exist_ok = True )
196196 shutil .rmtree (temp_dir , ignore_errors = True )
197- self .version = self ._fetch_ks2_commit_hash (self .PYKILOSORT_REPO )
198197 return sorter_dir
199198
200199 def _run (self , overwrite = False ):
@@ -225,7 +224,7 @@ def _run(self, overwrite=False):
225224 logfile = ks2_dir .joinpath (f"spike_sorting_{ self .SPIKE_SORTER_NAME } .log" )
226225 if logfile .exists ():
227226 shutil .copyfile (logfile , probe_out_path .joinpath (
228- f"ibl_log .info_{ self .SPIKE_SORTER_NAME } .log" ))
227+ f"_ibl_log .info_{ self .SPIKE_SORTER_NAME } .log" ))
229228 out , _ = spikes .sync_spike_sorting (ap_file = ap_file , out_path = probe_out_path )
230229 out_files .extend (out )
231230 # convert ks2_output into tar file and also register
0 commit comments