Skip to content

Commit

Permalink
changes from_kwargs to from_config (#954)
Browse files Browse the repository at this point in the history
  • Loading branch information
normanrz authored Oct 18, 2023
1 parent a1ff676 commit 5529367
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion cluster_tools/cluster_tools/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def get_executor(environment: str, **kwargs: Any) -> "Executor":
if "client" in kwargs:
return DaskExecutor(kwargs["client"])
else:
return DaskExecutor.from_kwargs(**kwargs)
return DaskExecutor.from_config(**kwargs)
elif environment == "multiprocessing":
global did_start_test_multiprocessing
if not did_start_test_multiprocessing:
Expand Down
7 changes: 4 additions & 3 deletions cluster_tools/cluster_tools/executors/dask.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
TYPE_CHECKING,
Any,
Callable,
Dict,
Iterable,
Iterator,
List,
Expand Down Expand Up @@ -37,13 +38,13 @@ def __init__(
self.client = client

@classmethod
def from_kwargs(
def from_config(
cls,
**kwargs: Any,
job_resources: Dict[str, Any],
) -> "DaskExecutor":
from distributed import Client

return cls(Client(**kwargs))
return cls(Client(**job_resources))

@classmethod
def as_completed(cls, futures: List["Future[_T]"]) -> Iterator["Future[_T]"]:
Expand Down

0 comments on commit 5529367

Please sign in to comment.