DeviceCompiler

class caqtus.shot_compilation.DeviceCompiler(
device_name: DeviceName,
sequence_context: SequenceContext,
)

Bases: Protocol

Defines the interface for a device compiler.

Each device compiler is responsible to evaluate the parameters to apply to a device.

Its role is to translate high-level and user-friendly parameters into concrete low-level device parameters that can be used to program the device.

The compiler is initialized at the beginning of a sequence. Its method compile_initialization_parameters() is then called once to obtain the parameters to pass to the device constructor.

The for each shot, the method compile_shot_parameters() is called to pass to the device controller for this shot.

If it is necessary to generate a trigger for the device under consideration, the device compiler should inherit from caqtus.device.sequencer.compilation.TriggerableDeviceCompiler.

abstractmethod compile_initialization_parameters() Mapping[str, Any]

Compile the parameters to pass to the device constructor.

abstractmethod compile_shot_parameters(
shot_context: ShotContext,
) Mapping[str, Any]

Compile the parameters to pass to the device controller for a shot.

Parameters:

shot_context – The context of the shot being compiled. It contains information about the shot that can be useful to evaluate device parameters.