Base¶
Base Executor¶
Base executor class for the parallelisation of experiments.
- class orion.executor.base.AsyncException(future, exception, traceback)[source]¶
Exception raised by a remote worker during computation
- Attributes
value
Raise the exception
- property value¶
Raise the exception
- class orion.executor.base.BaseExecutor(n_workers, **kwargs)[source]¶
Base executor class
- Parameters
- n_workers: int
The number of workers the Executor should have. Depending on the backend it may spawn this many worker or connect to running instance that dispatch work to
n_workers
workers.
Methods
async_get
(futures[, timeout])Retrieve futures that completed, removes them from the list of pending futures and return their results
submit
(function, *args, **kwargs)Submit work to the executor for asynchronous execution
wait
(futures)Wait for all futures to complete execution.
- async_get(futures, timeout=None)[source]¶
Retrieve futures that completed, removes them from the list of pending futures and return their results
- Parameters
- futures: `concurrent.futures.Futures` or equivalent interface
The objects returned by
submit()
of the executor.- timeout: int
time to wait before checking the other future
- Returns
- returns a list of results
- class orion.executor.base.Future[source]¶
Generic Future interface that is used to harmonized different future interface
Methods
get
([timeout])Return the result when it arrives.
ready
()Return whether the call has completed.
Return whether the call completed without raising an exception.
wait
([timeout])Wait until the result is available or until timeout seconds pass.
- get(timeout=None)[source]¶
Return the result when it arrives. If the remote call raised an exception then that exception will be reraised by get().
- Parameters
- timeout: int
time in second to wait, if none will wait forever
- Raises
- multiprocessing.TimeoutError
when the timeout expires
- Exception
if the remote called raised an exception