Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Dec 20, 2024
1 parent 1641409 commit 14c9381
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
3 changes: 1 addition & 2 deletions executorlib/interactive/executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@
from executorlib.standalone.thread import RaisingThread

try: # The PyFluxExecutor requires flux-base to be installed.
from executorlib.interactive.flux import FluxPythonSpawner
from executorlib.interactive.flux import validate_max_workers
from executorlib.interactive.flux import FluxPythonSpawner, validate_max_workers
except ImportError:
pass

Expand Down
7 changes: 6 additions & 1 deletion executorlib/interactive/flux.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,12 @@ def validate_max_workers(max_workers, cores, threads_per_core):
cores_total = flux.resource.list.resource_list(handle).get().up.ncores
cores_requested = max_workers * cores * threads_per_core
if cores_total < cores_requested:
raise ValueError("The number of requested cores is larger than the available cores " + str(cores_total) + " < " + str(cores_requested))
raise ValueError(
"The number of requested cores is larger than the available cores "
+ str(cores_total)
+ " < "
+ str(cores_requested)
)


class FluxPythonSpawner(BaseSpawner):
Expand Down

0 comments on commit 14c9381

Please sign in to comment.