ExaRuntime#

Module: exa.core.provider.provider

class ExaRuntime(*, executor, storage, experiment_configuration=None)#

Bases: Serializable

Process-wide singleton providing quantum execution and storage interfaces.

Methods

clear

Forcefully clear the entire runtime stack, including active scopes.

deserialize

Reconstruct an instance from a dictionary payload.

executor

Standardized interface for job execution from the active runtime.

experiment_configuration

Access the experiment configuration instance for this runtime.

get

Return the current active runtime instance.

get_or_create_software_version_set

Get the database ID of the package version information of the current Python runtime.

is_set

Return True if a runtime is available.

scoped

Context manager to temporarily override the runtime.

serialize

Serialize the object instance into a dictionary payload.

set

Set the root-level runtime (index 0).

storage

Standardized interface for data persistence from the active runtime.

Parameters:
  • executor (ExecutorInterface)

  • storage (StorageInterface)

  • experiment_configuration (ExperimentConfiguration | None)

serialize()#

Serialize the object instance into a dictionary payload.

Return type:

dict[str, Any]

classmethod deserialize(data)#

Reconstruct an instance from a dictionary payload.

Parameters:

data (dict[str, Any])

Return type:

ExaRuntime

static get()#

Return the current active runtime instance.

Return type:

ExaRuntime

static executor()#

Standardized interface for job execution from the active runtime.

Return type:

ExecutorInterface

static storage()#

Standardized interface for data persistence from the active runtime.

Return type:

StorageInterface

static experiment_configuration()#

Access the experiment configuration instance for this runtime.

Return type:

ExperimentConfiguration

static get_or_create_software_version_set()#

Get the database ID of the package version information of the current Python runtime.

Return type:

int

static set(ctx)#

Set the root-level runtime (index 0).

If a root-level runtime is already set, its executor and storage are closed (see ExecutorInterface.close() and StorageInterface.close()) before being replaced, so they can release any resources they own (e.g. in-process background threads, pooled HTTP connections) before the new runtime takes over.

Parameters:

ctx (ExaRuntime)

Return type:

None

static scoped(ctx)#

Context manager to temporarily override the runtime.

Parameters:

ctx (ExaRuntime)

Return type:

Iterator[ExaRuntime]

static clear()#

Forcefully clear the entire runtime stack, including active scopes.

Closes (see ExecutorInterface.close() and StorageInterface.close()) every executor and storage in the stack before discarding it, so any resources they own (e.g. in-process background threads, pooled HTTP connections) are released instead of leaked.

Return type:

None

static is_set()#

Return True if a runtime is available.

Return type:

bool

Inheritance

Inheritance diagram of exa.core.provider.provider.ExaRuntime