Skip to content

Commit 084f500

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent c98af28 commit 084f500

4 files changed

Lines changed: 10 additions & 5 deletions

File tree

executorlib/executor/flux.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -359,10 +359,12 @@ def __init__(
359359
from executorlib.task_scheduler.file.task_scheduler import (
360360
create_file_executor,
361361
)
362+
362363
if terminate_tasks_on_shutdown:
363364
from executorlib.task_scheduler.file.queue_spawner import (
364365
terminate_with_pysqa,
365366
)
367+
366368
terminate_function = terminate_with_pysqa
367369
else:
368370
terminate_function = None

executorlib/executor/slurm.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,10 +165,12 @@ def __init__(
165165
from executorlib.task_scheduler.file.task_scheduler import (
166166
create_file_executor,
167167
)
168+
168169
if terminate_tasks_on_shutdown:
169170
from executorlib.task_scheduler.file.queue_spawner import (
170171
terminate_with_pysqa,
171172
)
173+
172174
terminate_function = terminate_with_pysqa
173175
else:
174176
terminate_function = None

executorlib/standalone/inputcheck.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,4 +223,4 @@ def check_terminate_tasks_on_shutdown(terminate_tasks_on_shutdown: bool) -> None
223223
"terminate_tasks_on_shutdown is not supported for the executorlib.SingleNodeExecutor, "
224224
"executorlib.SlurmJobExecutor and executorlib.FluxJobExecutor."
225225
"Please use terminate_tasks_on_shutdown=True instead of terminate_tasks_on_shutdown=False."
226-
)
226+
)

executorlib/task_scheduler/file/shared.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,7 @@
1010
from executorlib.standalone.command import get_command_path
1111
from executorlib.standalone.serialize import serialize_funct_h5
1212
from executorlib.task_scheduler.file.hdf import dump, get_output
13-
from executorlib.task_scheduler.file.subprocess_spawner import (
14-
terminate_subprocess
15-
)
13+
from executorlib.task_scheduler.file.subprocess_spawner import terminate_subprocess
1614

1715

1816
class FutureItem:
@@ -89,7 +87,10 @@ def execute_tasks_h5(
8987
with contextlib.suppress(queue.Empty):
9088
task_dict = future_queue.get_nowait()
9189
if task_dict is not None and "shutdown" in task_dict and task_dict["shutdown"]:
92-
if terminate_function is not None and terminate_function == terminate_subprocess:
90+
if (
91+
terminate_function is not None
92+
and terminate_function == terminate_subprocess
93+
):
9394
for task in process_dict.values():
9495
terminate_function(task=task)
9596
elif terminate_function is not None:

0 commit comments

Comments
 (0)