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

The sensors to aggregate come either from a device group of the flex-config, or from the input parameters. A group already says which devices sit behind one piece of equipment, which sensor records each of them, which sign means consumption or production, and where the group’s aggregate belongs, so a report over a group needs no topology of its own.

Example, aggregating the group on asset 2: .. code-block:: json

{

“group” : {“asset” : 2}

}

Example, aggregating only the PV installations of the group on asset 1: .. code-block:: json

{

“group” : {“asset” : 1}, “members” : {“asset-type” : “solar”}

}

Example, aggregating sensors named in the parameters, which needs no group: .. code-block:: json

{

“method” : “sum”, “weights” : {

“pv” : 1.0, “consumption” : -1.0

}

}

fields: dict[str, Field]

Dictionary mapping field_names -> Field objects

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

Both input and output are optional here, unlike in the base schema: a report over a device group takes its sensors, and the sensor it records on, from the flex-config.

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”,

}

fields: dict[str, Field]

Dictionary mapping field_names -> Field objects

class flexmeasures.data.schemas.reporting.aggregation.MemberFilterSchema(*, 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)

Narrows a group down to some of its members.

A group is a piece of shared equipment, so it holds everything behind that equipment. A filter picks a category out of it, such as every PV installation on a street.

fields: dict[str, Field]

Dictionary mapping field_names -> Field objects