diff --git a/element_array_ephys/readers/kilosort_triggering.py b/element_array_ephys/readers/kilosort_triggering.py index c4c86849..ccb21312 100644 --- a/element_array_ephys/readers/kilosort_triggering.py +++ b/element_array_ephys/readers/kilosort_triggering.py @@ -392,11 +392,11 @@ def run_modules(self): if module_status['completion_time'] is not None: continue - module_output_json = self._get_module_output_json_filename(module) - command = (sys.executable - + " -W ignore -m ecephys_spike_sorting.modules." + module - + " --input_json " + module_input_json - + " --output_json " + module_output_json) + module_output_json = self._get_module_output_json_filename(module) + command = [sys.executable, + '-W', 'ignore', '-m', 'ecephys_spike_sorting.modules.' + module, + '--input_json', module_input_json, + '--output_json', module_output_json] start_time = datetime.utcnow() self._update_module_status( @@ -404,7 +404,7 @@ def run_modules(self): 'completion_time': None, 'duration': None}}) with open(module_logfile, "a") as f: - subprocess.check_call(command.split(' '), stdout=f) + subprocess.check_call(command, stdout=f) completion_time = datetime.utcnow() self._update_module_status( {module: {'start_time': start_time,