Decision

class ska_csp_lmc_common.observation.consistency_policy.Decision(final_state: ska_control_model.ObsState | None = None, severity: Severity = Severity.LOW, fault_msg: str | None = '', hard_fault: bool = False, action: PolicyAction | None = None)

Bases: object

Represents the result of a policy evaluation.

The action field is the preferred explicit control signal. The legacy fields (hard_fault, severity, and final_state) are still present to preserve compatibility with existing supervisor logic and call sites.

Parameters:
  • final_state – Final observation state to apply when the decision is conclusive.

  • severity – Severity associated with the evaluated condition.

  • fault_msg – Optional diagnostic message describing the reason for the decision.

  • hard_fault – Legacy flag indicating whether the model should enter a latched fault condition.

  • action – Explicit supervisor action requested by the policy.

Policy Protocol

class ska_csp_lmc_common.observation.consistency_policy.ScanConsistencyPolicy(*args, **kwargs)

Bases: Protocol

Protocol for evaluating the consistency of subsystem observation states.

Implementations define the logic to determine if the collective state of subsystems warrants a state transition or a fault declaration.

evaluate(aggregated: ska_control_model.ObsState, obs_modes: List[ska_control_model.ObsMode], subsystems: Dict[str, ska_control_model.ObsState], previous_state: ska_control_model.ObsState | None = None, command_context: CommandContext | None = None, reconcile_timeout: bool | None = False) Decision

Evaluate current subsystem states to reach a decision.

Parameters:
  • aggregated – The current overall observation state.

  • obs_modes – List of active observation modes.

  • subsystems – Mapping of subsystem names to their ObsState.

  • previous_state – The previously published aggregated ObsState.

  • command_context – The command context with relevant command data.

Returns:

A Decision object containing the evaluation outcome.

_abc_impl = <_abc._abc_data object>
_is_protocol = True
_is_runtime_protocol = True