From c859e07d43ea4f561c4314e493debe7ff68e9115 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sat, 9 Nov 2024 15:28:08 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- executorlib/interactive/shared.py | 13 ++++++++++--- executorlib/standalone/inputcheck.py | 4 +++- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/executorlib/interactive/shared.py b/executorlib/interactive/shared.py index dc8014bf..727aa58f 100644 --- a/executorlib/interactive/shared.py +++ b/executorlib/interactive/shared.py @@ -396,7 +396,10 @@ def _get_backend_path( def _wait_for_free_slots( - active_task_dict: dict, cores_requested: int, max_cores: Optional[int] = None, max_workers: Optional[int] = None, + active_task_dict: dict, + cores_requested: int, + max_cores: Optional[int] = None, + max_workers: Optional[int] = None, ) -> dict: """ Wait for available computing resources to become available. @@ -414,10 +417,14 @@ def _wait_for_free_slots( """ if max_cores is not None: while sum(active_task_dict.values()) + cores_requested > max_cores: - active_task_dict = {k: v for k, v in active_task_dict.items() if not k.done()} + active_task_dict = { + k: v for k, v in active_task_dict.items() if not k.done() + } elif max_workers is not None and max_cores is None: while len(active_task_dict.values()) + 1 > max_workers: - active_task_dict = {k: v for k, v in active_task_dict.items() if not k.done()} + active_task_dict = { + k: v for k, v in active_task_dict.items() if not k.done() + } return active_task_dict diff --git a/executorlib/standalone/inputcheck.py b/executorlib/standalone/inputcheck.py index 64429882..d776cf6b 100644 --- a/executorlib/standalone/inputcheck.py +++ b/executorlib/standalone/inputcheck.py @@ -170,7 +170,9 @@ def check_pysqa_config_directory(pysqa_config_directory: Optional[str]) -> None: def validate_number_of_cores( - max_cores: Optional[int] = None, max_workers: Optional[int] = None, set_local_cores: bool = False, + max_cores: Optional[int] = None, + max_workers: Optional[int] = None, + set_local_cores: bool = False, ) -> int: """ Validate the number of cores and return the appropriate value.