From 51f21e17646246ae420f5183ce5bc35f5868ccbc Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 12 Oct 2023 09:39:45 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- dask_mpi/execute.py | 4 +++- dask_mpi/tests/execute_script.py | 6 ++++-- dask_mpi/tests/test_execute.py | 6 ++++-- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/dask_mpi/execute.py b/dask_mpi/execute.py index 3435d33..6e8b557 100644 --- a/dask_mpi/execute.py +++ b/dask_mpi/execute.py @@ -136,7 +136,9 @@ async def run_scheduler(with_worker=False, with_client=False): comm.Barrier() if with_worker: - asyncio.get_event_loop().create_task(run_worker(with_client=with_client)) + asyncio.get_event_loop().create_task( + run_worker(with_client=with_client) + ) elif with_client: asyncio.get_event_loop().create_task(run_client()) diff --git a/dask_mpi/tests/execute_script.py b/dask_mpi/tests/execute_script.py index b887bd3..a3158d3 100644 --- a/dask_mpi/tests/execute_script.py +++ b/dask_mpi/tests/execute_script.py @@ -17,7 +17,9 @@ def client_func(m=4, c=1, s=0, x=True): assert time() < start + 10 sleep(0.2) - actual_worker_ranks = set(v["name"] for k,v in c.scheduler_info()["workers"].items()) + actual_worker_ranks = set( + v["name"] for k, v in c.scheduler_info()["workers"].items() + ) assert actual_worker_ranks == worker_ranks for i in actual_worker_ranks: @@ -32,7 +34,7 @@ def client_func(m=4, c=1, s=0, x=True): parser.add_argument("-x", type=lambda v: v.lower() != "false", default=None) kwargs = vars(parser.parse_args()) - execute_kwargs = {k:v for k,v in kwargs.items() if v is not None} + execute_kwargs = {k: v for k, v in kwargs.items() if v is not None} if "c" in execute_kwargs: execute_kwargs["client_rank"] = execute_kwargs["c"] if "s" in execute_kwargs: diff --git a/dask_mpi/tests/test_execute.py b/dask_mpi/tests/test_execute.py index 99fd500..ab2ff08 100644 --- a/dask_mpi/tests/test_execute.py +++ b/dask_mpi/tests/test_execute.py @@ -20,7 +20,7 @@ (2, ["-c", "0", "-s", "0", "-x", "False"], 0), (1, ["-c", "0", "-s", "0", "-x", "False"], 0), (1, ["-c", "0", "-s", "0", "-x", "True"], 1), - ] + ], ) def test_execute(mpisize, execute_args, retcode, mpirun): script_file = os.path.join( @@ -28,7 +28,9 @@ def test_execute(mpisize, execute_args, retcode, mpirun): ) execute_args += ["-m", str(mpisize)] - p = subprocess.Popen(mpirun + ["-n", str(mpisize), sys.executable, script_file] + execute_args) + p = subprocess.Popen( + mpirun + ["-n", str(mpisize), sys.executable, script_file] + execute_args + ) p.communicate() assert p.returncode == retcode