CacheableLoadRule#

Module: iqm.cpc.core.observation.observation_loading_rules

class iqm.cpc.core.observation.observation_loading_rules.CacheableLoadRule(storage=None)#

Bases: RuleType

Interface for an observation loading rule for which the observation data can be preloaded to a cache.

Note that generally load rules do not need to implement this interface — it is enough that they subclass RuleType.

Attributes

full_name

Returns the full name including the attributes.

Methods

resolve_from_cache

Applies the rule for preloaded cache.

Parameters:

storage (StorageInterface | None)

property full_name: str#

Returns the full name including the attributes.

abstractmethod resolve_from_cache(observation_name, cache_data, default_storage)#

Applies the rule for preloaded cache.

Parameters:
  • observation_name (str) – The dut_field of the observation to be loaded.

  • cache_data (Any) – The cache data to be used for loading the observation.

  • default_storage (StorageInterface | None) – The default storage backend to use if the rule does not have its own storage backend.

Returns:

The loaded observation, or None if the rule could not load the observation.

Return type:

ObservationDefinition | None

Inheritance

Inheritance diagram of iqm.cpc.core.observation.observation_loading_rules.CacheableLoadRule