Skip to content

Commit 565bb32

Browse files
authored
Fix Initialization for ExecutorWithDependencies (#549)
1 parent 40c35e3 commit 565bb32

File tree

2 files changed

+17
-16
lines changed

2 files changed

+17
-16
lines changed

executorlib/__init__.py

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -212,18 +212,21 @@ def __new__(
212212
elif not disable_dependencies:
213213
_check_pysqa_config_directory(pysqa_config_directory=pysqa_config_directory)
214214
return _ExecutorWithDependencies(
215-
max_workers=max_workers,
216-
backend=backend,
217-
cache_directory=cache_directory,
215+
executor=_create_executor(
216+
max_workers=max_workers,
217+
backend=backend,
218+
cache_directory=cache_directory,
219+
max_cores=max_cores,
220+
resource_dict=resource_dict,
221+
flux_executor=flux_executor,
222+
flux_executor_pmi_mode=flux_executor_pmi_mode,
223+
flux_executor_nesting=flux_executor_nesting,
224+
flux_log_files=flux_log_files,
225+
hostname_localhost=hostname_localhost,
226+
block_allocation=block_allocation,
227+
init_function=init_function,
228+
),
218229
max_cores=max_cores,
219-
resource_dict=resource_dict,
220-
flux_executor=flux_executor,
221-
flux_executor_pmi_mode=flux_executor_pmi_mode,
222-
flux_executor_nesting=flux_executor_nesting,
223-
flux_log_files=flux_log_files,
224-
hostname_localhost=hostname_localhost,
225-
block_allocation=block_allocation,
226-
init_function=init_function,
227230
refresh_rate=refresh_rate,
228231
plot_dependency_graph=plot_dependency_graph,
229232
plot_dependency_graph_filename=plot_dependency_graph_filename,

executorlib/interactive/executor.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
from typing import Any, Callable, Dict, Optional
33

44
from executorlib.base.executor import ExecutorBase
5-
from executorlib.interactive.create import create_executor
65
from executorlib.interactive.shared import execute_tasks_with_dependencies
76
from executorlib.standalone.plot import (
87
draw,
@@ -34,14 +33,13 @@ class ExecutorWithDependencies(ExecutorBase):
3433

3534
def __init__(
3635
self,
37-
*args: Any,
36+
executor: ExecutorBase,
37+
max_cores: Optional[int] = None,
3838
refresh_rate: float = 0.01,
3939
plot_dependency_graph: bool = False,
4040
plot_dependency_graph_filename: Optional[str] = None,
41-
**kwargs: Any,
4241
) -> None:
43-
super().__init__(max_cores=kwargs.get("max_cores", None))
44-
executor = create_executor(*args, **kwargs)
42+
super().__init__(max_cores=max_cores)
4543
self._set_process(
4644
RaisingThread(
4745
target=execute_tasks_with_dependencies,

0 commit comments

Comments
 (0)