flexmeasures.auth.loaders
Functions
- flexmeasures.auth.loaders.flex_config_sensor_reference_paths(flex_config: dict | list | None) list[tuple[tuple[str, ...], Sensor, bool]]
Return each sensor reference in a flex-context or flex-model, with its field path and whether it is an output.
The field path holds the field names leading to the reference (list positions are left out, and underscores are written as hyphens), such as
("consumption-price", "sensor").
- flexmeasures.auth.loaders.flex_config_sensor_references(flex_config: dict | list | None) tuple[list[Sensor], list[Sensor]]
Return all sensors a flex-context or flex-model refers to, and those among them that the scheduler records results on.
A sensor referenced anywhere under one of the FLEX_CONFIG_OUTPUT_FIELDS counts as an output.
- flexmeasures.auth.loaders.flex_context_loader(flex_context: dict | list | None) dict[str, list[Sensor]]
Extract sensor references from a flex-context for permission checking.
- flexmeasures.auth.loaders.flex_context_output_loader(flex_context: dict | list | None) dict[str, list[Sensor]]
Extract the sensors a flex-context has the scheduler record results on, for permission checking.
- flexmeasures.auth.loaders.flex_model_loader(flex_model: dict | list | None) dict[str, list[Sensor]]
Extract sensor references from a flex-model for permission checking.