diff --git a/executorlib/__init__.py b/executorlib/__init__.py index 802d7a5e..71051d25 100644 --- a/executorlib/__init__.py +++ b/executorlib/__init__.py @@ -212,18 +212,21 @@ def __new__( elif not disable_dependencies: _check_pysqa_config_directory(pysqa_config_directory=pysqa_config_directory) return _ExecutorWithDependencies( - max_workers=max_workers, - backend=backend, - cache_directory=cache_directory, + executor=_create_executor( + max_workers=max_workers, + backend=backend, + cache_directory=cache_directory, + max_cores=max_cores, + resource_dict=resource_dict, + flux_executor=flux_executor, + flux_executor_pmi_mode=flux_executor_pmi_mode, + flux_executor_nesting=flux_executor_nesting, + flux_log_files=flux_log_files, + hostname_localhost=hostname_localhost, + block_allocation=block_allocation, + init_function=init_function, + ), max_cores=max_cores, - resource_dict=resource_dict, - flux_executor=flux_executor, - flux_executor_pmi_mode=flux_executor_pmi_mode, - flux_executor_nesting=flux_executor_nesting, - flux_log_files=flux_log_files, - hostname_localhost=hostname_localhost, - block_allocation=block_allocation, - init_function=init_function, refresh_rate=refresh_rate, plot_dependency_graph=plot_dependency_graph, plot_dependency_graph_filename=plot_dependency_graph_filename, diff --git a/executorlib/interactive/executor.py b/executorlib/interactive/executor.py index 1b05edb6..994249da 100644 --- a/executorlib/interactive/executor.py +++ b/executorlib/interactive/executor.py @@ -2,7 +2,6 @@ from typing import Any, Callable, Dict, Optional from executorlib.base.executor import ExecutorBase -from executorlib.interactive.create import create_executor from executorlib.interactive.shared import execute_tasks_with_dependencies from executorlib.standalone.plot import ( draw, @@ -34,14 +33,13 @@ class ExecutorWithDependencies(ExecutorBase): def __init__( self, - *args: Any, + executor: ExecutorBase, + max_cores: Optional[int] = None, refresh_rate: float = 0.01, plot_dependency_graph: bool = False, plot_dependency_graph_filename: Optional[str] = None, - **kwargs: Any, ) -> None: - super().__init__(max_cores=kwargs.get("max_cores", None)) - executor = create_executor(*args, **kwargs) + super().__init__(max_cores=max_cores) self._set_process( RaisingThread( target=execute_tasks_with_dependencies,