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 Nov 9, 2024
1 parent 0f2e0e0 commit e5331cb
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions executorlib/base/executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,14 @@ def submit(self, fn: callable, *args, resource_dict: dict = {}, **kwargs) -> Fut
Future: A Future representing the given call.
"""
cores = resource_dict.get("cores", None)
if cores is not None and self._max_cores is not None and cores > self._max_cores:
raise ValueError("The specified number of cores is larger than the available number of cores.")
if (
cores is not None
and self._max_cores is not None
and cores > self._max_cores
):
raise ValueError(
"The specified number of cores is larger than the available number of cores."
)
check_resource_dict(function=fn)
f = Future()
self._future_queue.put(
Expand Down

0 comments on commit e5331cb

Please sign in to comment.