hvl_ccb.experiment_manager

Inheritance diagram of hvl_ccb.experiment_manager

Main module containing the top level ExperimentManager class. Inherit from this class to implement your own experiment functionality in another project and it will help you start, stop and manage your devices.

exception ExperimentError[source]

Bases: CCBError

Error to indicate that the current status of the experiment manager is on ERROR and thus no operations can be made until reset.

class ExperimentManager(*args, **kwargs)[source]

Bases: DeviceSequenceMixin

Experiment Manager can start and stop communication protocols and devices. It provides methods to queue commands to devices and collect results.

add_device(name: str, device: Device) None[source]

Add a new device to the manager. If the experiment is running, automatically start the device. If a device with this name already exists, raise an error.

Parameters:
  • name – is the name of the device.

  • device – is the instantiated Device object.

Raises:

ExperimentError

finish() None[source]

Stop experimental setup, stop all devices.

is_error() bool[source]

Returns true, if the status of the experiment manager is error.

Returns:

True if on error, false otherwise

is_finished() bool[source]

Returns true, if the status of the experiment manager is finished.

Returns:

True if finished, false otherwise

is_running() bool[source]

Returns true, if the status of the experiment manager is running.

Returns:

True if running, false otherwise

run() None[source]

Start experimental setup, start all devices.

start() None[source]

Alias for ExperimentManager.run()

property status: ExperimentStatus

Get experiment status.

Returns:

experiment status enum code.

stop() None[source]

Alias for ExperimentManager.finish()

class ExperimentStatus(value)[source]

Bases: Enum

Enumeration for the experiment status

ERROR = 5
FINISHED = 4
FINISHING = 3
INITIALIZED = 0
INITIALIZING = -1
RUNNING = 2
STARTING = 1