Skip to content

Commit

Permalink
Use default executor when Runner(..., executor=None) (#389)
Browse files Browse the repository at this point in the history
  • Loading branch information
basnijholt committed Dec 2, 2022
1 parent 0a80755 commit 6c69e88
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions adaptive/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ def __init__(
npoints_goal: int | None = None,
end_time_goal: datetime | None = None,
duration_goal: timedelta | int | float | None = None,
executor: (ExecutorTypes | None) = None,
executor: ExecutorTypes | None = None,
ntasks: int = None,
log: bool = False,
shutdown_executor: bool = False,
Expand Down Expand Up @@ -934,11 +934,9 @@ def replay_log(
# -- Internal executor-related, things


def _ensure_executor(
executor: ExecutorTypes | None,
) -> concurrent.Executor:
def _ensure_executor(executor: ExecutorTypes | None) -> concurrent.Executor:
if executor is None:
executor = concurrent.ProcessPoolExecutor()
executor = _default_executor()

if isinstance(executor, concurrent.Executor):
return executor
Expand Down

0 comments on commit 6c69e88

Please sign in to comment.