Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,12 @@ class CavityCharacterization:
widget_name="cavity_scale_factor",
format_spec=".6f",
)
# Whether the measured loaded Q fell inside the window for this cavity's
# class, which differs between standard, harmonic-linearizer and HE
# cavities. Recorded rather than recomputed because the limits live on the
# Cavity object and the record has no access to one. None means the check
# was never made — records written before this field existed.
loaded_q_in_tolerance: bool | None = None
timestamp: datetime = field(default_factory=datetime.now)
notes: str = ""

Expand All @@ -367,7 +373,15 @@ def is_complete(self) -> bool:

@property
def passed(self) -> bool:
return self.is_complete
"""Complete, and not known to be out of tolerance.

A characterization that measured an out-of-range loaded Q is complete but
has not passed — recording it as passed would make flagging the value
pointless. Written as "is not False" so records predating
loaded_q_in_tolerance (None) keep their previous result rather than
retroactively failing.
"""
return self.is_complete and self.loaded_q_in_tolerance is not False

def to_dict(self) -> dict:
"""Serialize to dictionary."""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
PhaseStepResult,
PhaseExecutionError,
)
from .cavity_char import CavityCharLimits, CavityCharPhase
from .frequency_tuning import FrequencyTuningLimits, FrequencyTuningPhase
from .piezo_pre_rf import PiezoPreRFPhase
from .ssa_char import SSACharPhase
Expand All @@ -21,6 +22,8 @@
"PhaseStepResult",
"PhaseExecutionError",
"FrequencyTuningLimits",
"CavityCharLimits",
"CavityCharPhase",
"FrequencyTuningPhase",
"PiezoPreRFPhase",
"SSACharPhase",
Expand Down
Loading