Skip to content

laboneq_applications.testing

Testing utilities for the LabOne Q Applications library.

CompiledExperimentVerifier(compiled_experiment, max_events=5000)

Class to verify the compiled experiment.

Parameters:

Name Type Description Default
compiled_experiment CompiledExperiment

The L1Q compiled experiment to verify.

required
max_events int

The maximum number of events to analyze. Default is 5000.

5000

pulse_extractor = _PulseExtractorPSV(compiled_experiment, max_events=max_events) instance-attribute

assert_number_of_pulses(signal, pulse_number)

Assert the number of pulses played for a particular signal.

Parameters:

Name Type Description Default
signal str

The signal for which the number of pulses is required.

required
pulse_number int

The expected number of pulses.

required

assert_pulse(signal, index, start=None, end=None, length=None, parameterized_with=None, tolerance=_TIMING_TOLERANCE)

Assert the properties of a particular pulse played.

Parameters:

Name Type Description Default
signal str

The signal name for which the pulse is required.

required
index int

The 0-based index of pulse. Counting only within the signal.

required
start float | None

The expected start time of the pulse. If None, the start time is not checked.

None
end float | None

The expected end time of the pulse. If None, the end time is not checked.

None
length float | None

The expected length of the pulse. If None, the length is not checked.

None
parameterized_with list[str] | None

The parameter names that parameterize the pulse. If None, the parameterized_with is not checked.

None
tolerance float

The tolerance for the comparison. If not provided, the default tolerance of 1e-12 is used.

_TIMING_TOLERANCE

assert_pulse_pair(signals, indices, start=None, end=None, distance=None, tolerance=_TIMING_TOLERANCE)

Assert the properties of a pair of pulses played.

Parameters:

Name Type Description Default
signals tuple[str, str] | str

The tuple of signals for which the pulse pair is required. If a single signal is provided, the same signal is used for both pulses.

required
indices tuple[int, int]

The tuple of 0-based indices of pulses.

required
start float | None

The expected start time of the pulse pair. If None, the start time is not checked.

None
end float | None

The expected end time of the pulse pair. If None, the end time is not checked.

None
distance float | None

The difference of the start time of the second pulse and the end time of the first pulse. If None, the difference is not checked.

None
tolerance float

The tolerance for the comparison. If not provided, the default tolerance of 1e-12 is used.

_TIMING_TOLERANCE