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:
Exception
Exception 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:
hvl_ccb.dev.base.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: hvl_ccb.dev.base.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 exception.
- Parameters
name – is the name of the device.
device – is the instantiated Device object.
- Raises
- devices_failed_start: Dict[str, hvl_ccb.dev.base.Device]¶
Dictionary of named device instances from the sequence for which the most recent start() attempt failed.
Empty if stop() was called last; cf. devices_failed_stop.
- devices_failed_stop: Dict[str, hvl_ccb.dev.base.Device]¶
Dictionary of named device instances from the sequence for which the most recent stop() attempt failed.
Empty if start() was called last; cf. devices_failed_start.
- 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
- property status: hvl_ccb.experiment_manager.ExperimentStatus¶
Get experiment status.
- Returns
experiment status enum code.