imports clean up, syntax fix, small improvement in run_sorter
import shutil
import os
-import sys
from pathlib import Path
import json
-from copy import deepcopy
import platform
@@ -55,24 +53,23 @@ def run_sorter(sorter_name, recording, output_folder=None,
""" + _common_param_doc
if docker_image is None and singularity_image is None:
- sorting = run_sorter_local(sorter_name, recording, output_folder=output_folder,
+ return run_sorter_local(sorter_name, recording, output_folder=output_folder,
remove_existing_folder=remove_existing_folder,
delete_output_folder=delete_output_folder,
verbose=verbose, raise_error=raise_error, with_output=with_output,
**sorter_params)
- elif docker_image is not None:
- sorting = run_sorter_container(sorter_name, recording, 'docker', docker_image,
+ if docker_image is not None:
+ return run_sorter_container(sorter_name, recording, 'docker', docker_image,
output_folder=output_folder,
remove_existing_folder=remove_existing_folder,
delete_output_folder=delete_output_folder, verbose=verbose,
raise_error=raise_error, with_output=with_output, **sorter_params)
- elif singularity_image is not None:
- sorting = run_sorter_container(sorter_name, recording, 'singularity', singularity_image,
+ if singularity_image is not None:
+ return run_sorter_container(sorter_name, recording, 'singularity', singularity_image,
output_folder=output_folder,
remove_existing_folder=remove_existing_folder,
delete_output_folder=delete_output_folder, verbose=verbose,
raise_error=raise_error, with_output=with_output, **sorter_params)
- return sorting
def run_sorter_local(sorter_name, recording, output_folder=None,
@@ -142,7 +139,6 @@ def find_recording_folder(d):
return folder_to_mount
-
class ContainerClient:
"""
Small abstraction class to run commands in:
@@ -279,7 +275,6 @@ run_sorter_local('{sorter_name}', recording, output_folder=output_folder,
res_output = container_client.run_command(cmd)
need_si_install = 'ModuleNotFoundError' in res_output
-
if need_si_install:
if 'dev' in si_version:
if verbose:
