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.AsyncResult(future, v)[source]

Result of an async computation

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
submit(function, *args, **kwargs)[source]

Submit work to the executor for asynchronous execution

Parameters
function: a callable object

A function to be executed by the executor. The function must be serializable.

*args, **kwargs:

Arguments for the function. The arguments must be serializable.

wait(futures)[source]

Wait for all futures to complete execution.

Parameters
futures: `concurrent.futures.Futures` or equivalent interface

The objects returned by submit() of the executor.

exception orion.executor.base.ExecutorClosed[source]

Raised when submitting to a closed executor

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.

successful()

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

ready()[source]

Return whether the call has completed.

successful()[source]

Return whether the call completed without raising an exception. Will raise ValueError if the result is not ready.

Raises
ValueError

if the result is not yet ready

wait(timeout=None)[source]

Wait until the result is available or until timeout seconds pass.