flexmeasures.data.models.reporting

Modules

flexmeasures.data.models.reporting.aggregator

flexmeasures.data.models.reporting.pandas_reporter

Classes

class flexmeasures.data.models.reporting.Reporter(sensor: Sensor, reporter_config_raw: dict | None = None)

Superclass for all FlexMeasures Reporters.

__init__(sensor: Sensor, reporter_config_raw: dict | None = None) None

Initialize a new Reporter.

Attributes: :param sensor: sensor where the output of the reporter will be saved to. :param reporter_config_raw: dictionary with the serialized configuration of the reporter.

_compute(start: datetime, end: datetime, input_resolution: timedelta | None = None, belief_time: datetime | None = None) BeliefsDataFrame

Overwrite with the actual computation of your report.

Returns BeliefsDataFrame:

report as a BeliefsDataFrame.

compute(start: datetime, end: datetime, input_resolution: timedelta | None = None, belief_time: datetime | None = None, **kwargs) tb.BeliefsDataFrame

This method triggers the creation of a new report.

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

In the future, this function will parse arbitrary input arguments defined in a schema.

deserialize_config()

Validate the report config against a Marshmallow Schema. Ideas: - Override this method - Call superclass method to apply validation and common variables deserialization (see PandasReporter) - (Partially) extract the relevant reporter_config parameters into class attributes.

Raises ValidationErrors or ValueErrors.

fetch_data(start: datetime, end: datetime, input_resolution: timedelta | None = None, belief_time: datetime | None = None)

Fetches the time_beliefs from the database