Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

changes from_kwargs to from_config #954

Merged
merged 1 commit into from
Oct 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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