SequenceManager

class caqtus.experiment_control.sequence_execution.SequenceManager(
sequence: PureSequencePath,
session_maker: StorageManager,
shot_retry_config: ShotRetryConfig | None,
global_parameters: ParameterNamespace | None,
device_configurations: Mapping[DeviceName, DeviceConfiguration] | None,
device_manager_extension: DeviceManagerExtensionProtocol,
shot_runner_factory: ShotRunnerFactory,
shot_compiler_factory: ShotCompilerFactory,
)

Bases: object

run_sequence() AsyncGenerator[ShotScheduler, None]

Run background tasks to compile and run shots for a given sequence.

Returns:

A asynchronous context manager that yields a shot scheduler object.

When the context manager is entered, it will set the sequence to PREPARING while acquiring the necessary resources and the transition to RUNNING.

The context manager will yield a shot scheduler object that can be used to push shots to the sequence execution queue. When a shot is done, its associated data will be stored in the associated sequence.

One shot scheduling is over, the context manager will be exited. At this point is will finish the sequence and transition the sequence state to FINISHED when the sequence terminated normally, CRASHED if an error occurred or INTERRUPTED if the sequence was interrupted by the user.