RuleCache#

Module: iqm.cpc.core.observation.observation_loading_rules

class iqm.cpc.core.observation.observation_loading_rules.RuleCache(load_function_mapping)#

Bases: object

Stores cached observation values for the CacheableLoadingRule subclasses.

Parameters:

load_function_mapping (dict[str, LoadFunction]) – Maps the load rule names to the functions used to load the cached observations. Note that each rule should have its own function/database query as they are (generally) not applicable for other rules.

data#

maps rule name to the loaded data for that rule

Type:

dict[str, Any]

load_function_mapping#

maps the rule names to the associated load functions.

Methods

load_cache

Loops through the mapped load functions and applies them to load the cache.

load_cache(rule_name_to_attributes)#

Loops through the mapped load functions and applies them to load the cache.

If the rule has attributes, those are passed to the load function.

Parameters:

rule_name_to_attributes (dict[str, list[Any]]) – the rule names mapped to the attributes of that rule.

Return type:

None

Inheritance

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