Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[reporting] Convert the units of the input data to a target unit. #1044

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

victorgarcia98
Copy link
Contributor

Description

In order to make reporters more reusable, we need to get the data in a known unit. For example, if we want to have a reporter to compute the P&L, we need the units to work out, for example:

P&L [EUR] = Price [EUR/MWh] x Energy [MWh]

Before, we expect the sensors to have certain units which made the reporter unusable for sensors with equivalent (but different) units. Moreover, I hope this new feature helps to improve the readability of reporter configurations.


  • I agree to contribute to the project under Apache 2 License.
  • To the best of my knowledge, the proposed patch is not based on code under GPL or other license that is incompatible with FlexMeasures

Signed-off-by: Victor Garcia Reolid <victor@seita.nl>
Copy link
Contributor

@Flix6x Flix6x left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, makes sense. This PR is still in draft. Is more needed, or just a changelog entry?

Signed-off-by: Victor Garcia Reolid <victor@seita.nl>
Signed-off-by: Victor Garcia Reolid <victor@seita.nl>
@victorgarcia98 victorgarcia98 marked this pull request as ready for review April 29, 2024 17:57
@victorgarcia98
Copy link
Contributor Author

Indeed, this PR lacked a test. Other than that, I also added the changelog entry.

Signed-off-by: Victor Garcia Reolid <victor@seita.nl>
Comment on lines +197 to +199
dict(name="sensor_4_kw", sensor=s4),
dict(name="sensor_4_mw", sensor=s4),
dict(name="sensor_4_mwh", sensor=s4),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This also saves the results under sensor 4, right? Do we also convert the results back to its unit?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The saving happens on the CLI command and, eventually, will happen on the job. The output of the reporter contains the sensor to which save the data to.

If we wanted to also convert the results of an output to the units of the sensor, we should tag the units of the transformations, at least, the last one. Alternatively, we could define the unit of the results in the required_output. What do you think?

Copy link
Contributor

@Flix6x Flix6x Apr 30, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using the required_output makes sense, I think. It's then the job of whoever writes the reporter config to get the units right, and whoever writes the input/output just needs to pass a sensor to make the reporter convert from/to the sensor's units.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants