ait.core.limits module¶
AIT Limits
The ait.core.limits module provides limit definitions for telemetry fields.
The expected limits.yaml should follow this schema:
!Limit source: – telemetry source for the limit. should follow format ‘Packet.field_name’ desc: – description of the limit units: – the units used for possible conversion depending on the units set in the
telemetry dictionary
- lower: – lower limits
error: – trigger error if telemetry value exceeds this lower bound (exclusive) warn: – trigger warning if telemetry value exceeds this lower bound (exclusive)
- upper: – upper limits
error: – trigger error if telemetry value exceeds this upper bound (exclusive) warn: – trigger warning if telemetry value exceeds this upper bound (exclusive)
- value: – enumerated values to trigger error/warning
error: – trigger error if telemetry value == or in list of strings warn: – trigger warning if telemetry value == or in list of strings
when: – when condition for specifying the necessary state when this limit applies persist: – number of seconds the value must persist before limits trigger
For example:
!Limit source: 1553_HS_Packet.Voltage_A desc: Voltage A units: Kelvin lower:
error: 5.0 warn: 10.0
- upper:
error: 45.0 warn: 40.0
when: 1553_HS_Packet.BankA == ‘ON’ persist: 5
!Limit source: Ethernet_HS_Packet.product_type desc: tbd value:
error: FOOBAR warn:
- FOO
- BAR
-
class
ait.core.limits.LimitDefinition(*args, **kwargs)¶ Bases:
ait.core.json.SlotSerializer,object-
__init__(*args, **kwargs)¶ Creates a new LimitDefinition.
-
convert(value, new_unit, old_unit)¶
-
error(value, units=None)¶
-
warn(value, units=None)¶
-
desc¶
-
lower¶
-
persist¶
-
source¶
-
units¶
-
upper¶
-
value¶
-
when¶
-
-
class
ait.core.limits.LimitsDict(*args, **kwargs)¶ Bases:
dict-
__init__(*args, **kwargs)¶ Creates a new Limits Dictionary from the given limits dictionary filename or YAML string.
-
add(defn)¶ Adds the given Limit Definition to this Limits Dictionary.
-
load(content)¶ Loads Limit Definitions from the given YAML content into this Telemetry Dictionary. Content may be either a filename containing YAML content or a YAML string.
Load has no effect if this Limits Dictionary was already instantiated with a filename or YAML content.
-
toJSON()¶
-
-
class
ait.core.limits.Thresholds(**kwargs)¶ Bases:
ait.core.json.SlotSerializer,object-
__init__(**kwargs)¶ Initialize self. See help(type(self)) for accurate signature.
-
toJSON()¶
-
-
ait.core.limits.YAMLCtor_LimitDefinition(loader, node)¶
-
ait.core.limits.getDefaultDict(reload=False)¶
-
ait.core.limits.getDefaultDictFilename()¶
-
ait.core.limits.getDefaultSchema()¶