ShotContext

class caqtus.shot_compilation.ShotContext(
sequence_context: SequenceContext,
variables: Mapping[DottedVariableName, Any],
device_compilers: Mapping[DeviceName, DeviceCompiler],
)

Bases: object

Contains information about a shot being compiled.

get_lane(name: str) TimeLane

Returns the lane with the given name for the shot.

Raises:

KeyError – If no lane with the given name is present for the shot.

mark_lane_used(name: str) None

Signal that a lane was consumed during the shot.

Raises:

KeyError – If no lane with the given name is present for the shot.

get_lanes_with_type(
lane_type: type[LaneType],
) Mapping[str, LaneType]

Returns the lanes used during the shot with the given type.

get_step_names() tuple[str, ...]

Returns the names of the steps in the shot.

get_step_durations() Sequence[Time]

Returns the durations of each step in seconds.

get_step_start_times() Sequence[Time]

Returns the times at which each step starts.

Returns:

A sequence representing the start times of each step in seconds.

For steps with durations [d_0, d_1, …, d_(n-1)], the returned values are [0, d_0, d_0 + d_1, …, d_0 + … + d_(n-1)].

The returned sequence has one more element than the number of steps. The last element is the total duration of the shot.

get_shot_duration() Time

Returns the total duration of the shot in seconds.

get_parameters() Parameters

Returns the parameters that define the shot.

get_device_config(
device_name: DeviceName,
) DeviceConfiguration

Returns the configuration for the given device.

Raises:

KeyError – If no configuration is found for the given device.

get_device_compiler(
device_name: DeviceName,
) DeviceCompiler

Returns the device compiler for the given device name.

Raises:

KeyError – If the requested device is not in use for the current shot.

get_shot_parameters(
device_name: DeviceName,
) Mapping[str, Any]

Returns the parameters computed for the given device.