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
base: main
Are you sure you want to change the base?
[reporting] Convert the units of the input data to a target unit. #1044
Conversation
Signed-off-by: Victor Garcia Reolid <victor@seita.nl>
There was a problem hiding this 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?
…eporter-unit-conversion
Signed-off-by: Victor Garcia Reolid <victor@seita.nl>
Indeed, this PR lacked a test. Other than that, I also added the changelog entry. |
flexmeasures/data/models/reporting/tests/test_pandas_reporter.py
Outdated
Show resolved
Hide resolved
Signed-off-by: Victor Garcia Reolid <victor@seita.nl>
dict(name="sensor_4_kw", sensor=s4), | ||
dict(name="sensor_4_mw", sensor=s4), | ||
dict(name="sensor_4_mwh", sensor=s4), |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
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:
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.