iqm.cpc.core.observation.observation_handler.load_observations_by_rules#
- iqm.cpc.core.observation.observation_handler.load_observations_by_rules(load_rules, dut_label, default_storage)#
Load observations resolved by the given rules, keyed by whichever dut fields they resolve to.
Unlike populating an
ObservationHandlerwith every known dut field, this only touches the dut fields that the givenload_rulesthemselves surface from the DB, so it works without any prior knowledge of which dut fields exist for the DUT. As a consequence, a rule that isn’t aCacheableLoadRule(e.g.Fail,LatestFromStash) never contributes any dut field to resolve against, since there’s no cached query result to discover them from. Ifload_rulescontains noCacheableLoadRuleat all, a warning is logged and no observations are returned.- Parameters:
load_rules (Sequence[RuleType]) – Loading rules to resolve, tried in order per dut field.
dut_label (str) – DUT to resolve the rule for.
default_storage (StorageInterface) – Default storage to use for loading observations in case the rules do not pin a storage backend.
- Returns:
Mapping from resolved dut field paths to their observations.
- Return type: