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
UI: Dashboard using GenericAssets #251
UI: Dashboard using GenericAssets #251
Conversation
…hboard_using_GenericAssets
…class AssetGroup, which is aimed to replace resources.Resource; created new view /sensor/<id>/state
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.
Some fixes required. Let me know if you'd like me to pick up the latest_state
viz in Altair.
I feel the introduction we place on the left (" In a world with renewable energy, flexibility ...") could go away. What do you think? |
I agree. One alternative is to move it to an "About" modal in the footer, next to "Credits". After all, this copy did receive quite some attention. |
…ntify power sensors by unit
…tion and power sensors
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.
Nice work! Just some physics corrections left.
flexmeasures/utils/unit_utils.py
Outdated
>>> is_power_unit("°C") # False | ||
>>> is_power_unit("EUR/kWh") # True | ||
""" | ||
return unit in ("W", "Wh", "kW", "kWh", "MW", "MWh") |
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.
Wh, kWh and MWh are not power units.
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.
That's true.
Would it not make sense to also include in the dashboard sensors which report energy (e.g. kWh)?
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.
Can you give an example?
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.
No. Metering is a big world. If you know about a general rule which lets all sensors send power data exclusively, let me know.
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.
Would it not make sense to also include in the dashboard sensors which report energy (e.g. kWh)?
Then also, no.
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.
I can't parse this answer. Does it mean "no"?
flexmeasures/utils/unit_utils.py
Outdated
|
||
def is_power_unit(unit: str) -> bool: | ||
"""For example: | ||
>>> is_power_unit("kWh") # True |
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.
Should be "kW"
.
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.
Perhaps a good place to start using pint
:
def is_power_unit(unit: str) -> bool:
return (pint.Quantity(unit) / pint.Quantity("W")).dimensionless
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.
I believe that should not be introduced this quickly: From my examples, it can already lead to these kinds of errors:
pint.errors.UndefinedUnitError: 'EUR' is not defined in the unit registry
pint.errors.OffsetUnitCalculusError: Ambiguous operation with offset unit (degree_Celsius, watt).
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.
Good point. I have been experimenting with pint today, and there are quite a few issues that would still need streamlining. I'd be happy to take this on in a separate PR.
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.
Convenient properties you made there. Just a documentation fix left.
closes #249