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 authored Nov 30, 2022
1 parent ad6e3fb commit eefa862
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 eefa862

Please sign in to comment.