From e7071704b01a6db7580255993a9c58cfb18d39fe Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 11 Sep 2024 18:14:35 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/spikeinterface/sorters/launcher.py | 26 +++++++++---------- .../sorters/tests/test_launcher.py | 24 +++++++---------- 2 files changed, 22 insertions(+), 28 deletions(-) diff --git a/src/spikeinterface/sorters/launcher.py b/src/spikeinterface/sorters/launcher.py index 723d1cb393..5b9302ef9e 100644 --- a/src/spikeinterface/sorters/launcher.py +++ b/src/spikeinterface/sorters/launcher.py @@ -28,7 +28,7 @@ slurm={"tmp_script_folder": None}, ) -_default_slurm_kwargs = {'cpus-per-task': 1, 'mem': '1G'} +_default_slurm_kwargs = {"cpus-per-task": 1, "mem": "1G"} _implemented_engine = list(_default_engine_kwargs.keys()) @@ -228,18 +228,18 @@ def run_sorter_jobs(job_list, engine="loop", engine_kwargs=None, slurm_kwargs=No def run_sorter_by_property( - sorter_name, - recording, - grouping_property, - folder, - mode_if_folder_exists=None, - engine="loop", - engine_kwargs={}, - verbose=False, - docker_image=None, - singularity_image=None, - working_folder: None = None, - **sorter_params, + sorter_name, + recording, + grouping_property, + folder, + mode_if_folder_exists=None, + engine="loop", + engine_kwargs={}, + verbose=False, + docker_image=None, + singularity_image=None, + working_folder: None = None, + **sorter_params, ): """ Generic function to run a sorter on a recording after splitting by a "grouping_property" (e.g. "group"). diff --git a/src/spikeinterface/sorters/tests/test_launcher.py b/src/spikeinterface/sorters/tests/test_launcher.py index 66f8b559f4..b03843563b 100644 --- a/src/spikeinterface/sorters/tests/test_launcher.py +++ b/src/spikeinterface/sorters/tests/test_launcher.py @@ -139,21 +139,15 @@ def test_run_sorter_jobs_slurm_kwargs(mocker, tmp_path, job_list): tmp_script_folder = tmp_path / "slurm_scripts" - engine_kwargs = dict( - tmp_script_folder=tmp_script_folder) - slurm_kwargs={ - "cpus-per-task": 32, - "mem": "32G", - "gres": "gpu:1", - "any_random_kwarg": 12322, - } - - run_sorter_jobs( - job_list, - engine="slurm", - engine_kwargs=engine_kwargs, - slurm_kwargs=slurm_kwargs - ) + engine_kwargs = dict(tmp_script_folder=tmp_script_folder) + slurm_kwargs = { + "cpus-per-task": 32, + "mem": "32G", + "gres": "gpu:1", + "any_random_kwarg": 12322, + } + + run_sorter_jobs(job_list, engine="slurm", engine_kwargs=engine_kwargs, slurm_kwargs=slurm_kwargs) script_0_path = f"{tmp_script_folder}/si_script_0.py" script_1_path = f"{tmp_script_folder}/si_script_1.py"