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 Apr 7, 2023
1 parent 6cf3d4e commit adfeced
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 adfeced

Please # to comment.