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 Aug 19, 2024
1 parent faa0ca0 commit dd54854
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions aiida_hyperqueue/scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,13 @@ def validate_resources(cls, **kwargs):
resources.num_cpus = kwargs.pop("num_cpus")
except KeyError:
try:
resources.num_cpus = kwargs.pop("num_machines") * kwargs.pop("num_mpiprocs_per_machine")
resources.num_cpus = kwargs.pop("num_machines") * kwargs.pop(
"num_mpiprocs_per_machine"
)
except KeyError:
raise KeyError(f"Must specify `num_cpus`, or (`num_machines` and `num_mpiprocs_per_machine`) {kwargs}")
raise KeyError(
f"Must specify `num_cpus`, or (`num_machines` and `num_mpiprocs_per_machine`) {kwargs}"
)
else:
if not isinstance(resources.num_cpus, int):
raise ValueError("`num_cpus` must be an integer")
Expand Down

0 comments on commit dd54854

Please sign in to comment.