flexmeasures.data.models.reporting

Modules

flexmeasures.data.models.reporting.aggregator

flexmeasures.data.models.reporting.pandas_reporter

flexmeasures.data.models.reporting.profit

Classes

class flexmeasures.data.models.reporting.Reporter(config: dict | None = None, save_config=True, save_parameters=False, **kwargs)

Superclass for all FlexMeasures Reporters.

_clean_parameters(parameters: dict) dict

Use this function to clean up the parameters dictionary from the fields that are not to be persisted to the DB as data source attributes (when save_parameters=True), e.g. because they are already stored as TimedBelief properties, or otherwise.

Example:

An DataGenerator has the following parameters: [“start”, “end”, “field1”, “field2”] and we want just “field1” and “field2” to be persisted.

Parameters provided to the compute method (input of the method _clean_parameters): parameters = {

“start” : “2023-01-01T00:00:00+02:00”, “end” : “2023-01-02T00:00:00+02:00”, “field1” : 1, “field2” : 2

}

Parameters persisted to the DB (output of the method _clean_parameters): parameters = {“field1” : 1,”field2” : 2}

_compute(check_output_resolution=True, **kwargs) List[Dict[str, Any]]

This method triggers the creation of a new report.

The same object can generate multiple reports with different start, end, resolution and belief_time values.

check_output_resolution (default: True): set to False to skip the validation of the output event_resolution.

_compute_report(**kwargs) List[Dict[str, Any]]

Overwrite with the actual computation of your report.

Returns BeliefsDataFrame:

report as a BeliefsDataFrame.