flexmeasures.data.schemas.reporting.aggregation
Classes
- class flexmeasures.data.schemas.reporting.aggregation.AggregatorConfigSchema(*, 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)
Schema for the AggregatorReporter configuration
Besides the aggregation method and the weights, this schema describes which sensors to aggregate. Sensors can be selected by asset, so that everything below a site asset is aggregated, and by an explicit list of sensor IDs. Both selections can be narrowed down by a regular expression on the sensor name, and by a list of units.
Example: .. code-block:: json
- {
“method” : “sum”, “weights” : {
“pv” : 1.0, “consumption” : -1.0
}
}
Example, aggregating the power of every PV sensor below asset 3: .. code-block:: json
- {
“method” : “sum”, “asset” : 3, “sensor_name_pattern” : “(?i)pv”, “sensor_units” : [“MW”]
}
- class flexmeasures.data.schemas.reporting.aggregation.AggregatorParametersSchema(*, 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)
Schema for the AggregatorReporter parameters
The input field is optional here, unlike in the base schema, because the sensors to aggregate can also be selected in the reporter’s configuration.
Example: .. code-block:: json
- {
- “input”: [
- {
“name” : “pv”, “sensor”: 1, “source” : 1,
}, {
“name” : “consumption”, “sensor”: 1, “source” : 2,
}
], “output”: [
- {
“sensor”: 3,
}
], “start” : “2023-01-01T00:00:00+00:00”, “end” : “2023-01-03T00:00:00+00:00”,
}