flexmeasures.data.schemas.scheduling.config
What makes up a scheduler’s configuration, as recorded on its data source.
Module Attributes
Functions
- flexmeasures.data.schemas.scheduling.config.find_momentary_flex_config_fields(message: dict) list[str]
Find the flex config fields which describe one moment, rather than the site and its devices.
A schedule automation recomputes its schedule on every run, so a value tied to a fixed moment is stale on the next one. Sensor references and plain quantities are fine: they say where to look, or what always holds, rather than what was true once.
- flexmeasures.data.schemas.scheduling.config.strip_momentary_flex_fields(value)
Return the flex config without the parts which describe one moment.
A scheduler’s data source is identified by its configuration, so anything that changes from run to run has to stay out of it. A state of charge measured at the start of one schedule, or a target at one datetime, would otherwise make every run a new data source.
Classes
- class flexmeasures.data.schemas.scheduling.config.SchedulerConfigSchema(*, only: Sequence[str] | AbstractSet[str] | None = None, exclude: Sequence[str] | AbstractSet[str] = (), many: bool | None = None, load_only: Sequence[str] | AbstractSet[str] = (), dump_only: Sequence[str] | AbstractSet[str] = (), partial: bool | Sequence[str] | AbstractSet[str] | None = None, unknown: Literal['exclude', 'include', 'raise'] | None = None)
The configuration of a scheduler: which asset it schedules, and the flex config it uses.
Together with the scheduler’s class and version, this is what tells one scheduler data source from another, so that a schedule can be traced back to the configuration it was computed under. Timing fields are deliberately absent: start, end, resolution and belief time differ from run to run, and are the scheduler’s parameters rather than its configuration.
The flex config is kept in its serialized form, as the trigger message and the asset tree spell it, because that is the form every scheduler shares. Deserialized flex configs hold sensors, quantities and time series, which each scheduler resolves in its own way.