Skip to content

Commit eefa862

Browse files
authored
Use default executor when Runner(..., executor=None) (#389)
1 parent ad6e3fb commit eefa862

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

adaptive/runner.py

+3-5
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ def __init__(
182182
npoints_goal: int | None = None,
183183
end_time_goal: datetime | None = None,
184184
duration_goal: timedelta | int | float | None = None,
185-
executor: (ExecutorTypes | None) = None,
185+
executor: ExecutorTypes | None = None,
186186
ntasks: int = None,
187187
log: bool = False,
188188
shutdown_executor: bool = False,
@@ -934,11 +934,9 @@ def replay_log(
934934
# -- Internal executor-related, things
935935

936936

937-
def _ensure_executor(
938-
executor: ExecutorTypes | None,
939-
) -> concurrent.Executor:
937+
def _ensure_executor(executor: ExecutorTypes | None) -> concurrent.Executor:
940938
if executor is None:
941-
executor = concurrent.ProcessPoolExecutor()
939+
executor = _default_executor()
942940

943941
if isinstance(executor, concurrent.Executor):
944942
return executor

0 commit comments

Comments
 (0)