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

UI: Dashboard using GenericAssets #251

Merged
merged 17 commits into from Dec 21, 2021

Conversation

create-issue-branch[bot]
Copy link
Contributor

closes #249

@nhoening nhoening changed the base branch from main to project-9 December 1, 2021 08:43
@nhoening nhoening marked this pull request as ready for review December 16, 2021 14:33
@nhoening nhoening requested a review from Flix6x December 16, 2021 14:33
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.

Some fixes required. Let me know if you'd like me to pick up the latest_state viz in Altair.

flexmeasures/data/models/generic_assets.py Outdated Show resolved Hide resolved
flexmeasures/api/common/schemas/sensors.py Outdated Show resolved Hide resolved
flexmeasures/data/models/time_series.py Outdated Show resolved Hide resolved
flexmeasures/data/services/asset_grouping.py Show resolved Hide resolved
flexmeasures/data/services/asset_grouping.py Outdated Show resolved Hide resolved
flexmeasures/data/services/asset_grouping.py Show resolved Hide resolved
flexmeasures/ui/views/new_dashboard.py Outdated Show resolved Hide resolved
flexmeasures/ui/views/state.py Show resolved Hide resolved
flexmeasures/utils/error_utils.py Outdated Show resolved Hide resolved
flexmeasures/data/services/asset_grouping.py Outdated Show resolved Hide resolved
@nhoening
Copy link
Contributor

I feel the introduction we place on the left (" In a world with renewable energy, flexibility ...") could go away. What do you think?

@Flix6x
Copy link
Contributor

Flix6x commented Dec 20, 2021

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.

@nhoening nhoening requested a review from Flix6x December 21, 2021 09:14
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.

Nice work! Just some physics corrections left.

flexmeasures/utils/unit_utils.py Outdated Show resolved Hide resolved
>>> is_power_unit("°C") # False
>>> is_power_unit("EUR/kWh") # True
"""
return unit in ("W", "Wh", "kW", "kWh", "MW", "MWh")
Copy link
Contributor

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.

Copy link
Contributor

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)?

Copy link
Contributor

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?

Copy link
Contributor

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.

Copy link
Contributor

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.

Copy link
Contributor

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"?


def is_power_unit(unit: str) -> bool:
"""For example:
>>> is_power_unit("kWh") # True
Copy link
Contributor

Choose a reason for hiding this comment

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

Should be "kW".

Copy link
Contributor

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

Copy link
Contributor

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).

Copy link
Contributor

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.

@nhoening nhoening requested a review from Flix6x December 21, 2021 16:03
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.

Convenient properties you made there. Just a documentation fix left.

flexmeasures/data/models/generic_assets.py Outdated Show resolved Hide resolved
@nhoening nhoening merged commit 754b46b into project-9 Dec 21, 2021
@nhoening nhoening deleted the issue-249-UI_Dashboard_using_GenericAssets branch December 21, 2021 16:59
@Flix6x Flix6x added this to the 0.8.0 milestone Jan 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

UI: Dashboard using GenericAssets
2 participants