flexmeasures.data.models.reporting.profit

Classes

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

Compute the profit or loss due to energy/power flow.

Given power/energy and price sensors, this reporter computes the profit (revenue - cost) or losses (cost - revenue) of a power/energy flow under a certain tariff.

Sign convention (by default)

Power flows:

(+) production (-) consumption

Profit:

(+) gains (-) losses

This sign convention can be adapted to your needs:
  • The power/energy convention can be inverted by setting the sensor attribute consumption_is_positive to True.

  • The output (gains/losses) sign can be inverted by setting the reporter config attribute loss_is_positive to False.

_compute_report(start: datetime, end: datetime, input: list[dict[str, Any]], output: list[dict[str, Any]], belief_time: datetime | None = None) list[dict[str, Any]]
Parameters:
  • start – start time of the report

  • end – end time of the report

  • input – description of the power/energy sensor, e.g. input=[{“sensor”: 42}]

  • output – description of the output sensors where to save the report to. Specify multiple output sensors with different resolutions to save the results in multiple time frames (e.g. hourly, daily), e.g. output = [{“sensor” : 43}, {“sensor” : 44]}]

  • belief_time – datetime used to indicate we are interested in the state of knowledge at that time. It is used to filter input, and to assign a recording time to output.