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

Toy tutorial UI fixes #466

Merged
merged 5 commits into from Jul 21, 2022
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion flexmeasures/cli/data_add.py
Expand Up @@ -996,7 +996,7 @@ def add_toy_account(kind: str, name: str):
)
# add charging sensor to battery
charging_sensor = Sensor(
name="charging",
name="discharging",
generic_asset=asset,
unit="MW",
timezone="Europe/Amsterdam",
Expand Down
2 changes: 1 addition & 1 deletion flexmeasures/data/models/charts/belief_charts.py
Expand Up @@ -79,7 +79,7 @@ def chart_for_multiple_sensors(
unit = sensor.unit if sensor.unit else "a.u."
event_value_field_definition = dict(
title=f"{capitalize(sensor.sensor_type)} ({unit})",
format=[".3s", unit],
format=[".3~r", unit],
formatType="quantityWithUnitFormat",
stack=None,
**{
Expand Down
5 changes: 4 additions & 1 deletion flexmeasures/data/models/data_sources.py
Expand Up @@ -88,9 +88,12 @@ def __str__(self):
return self.description

def to_dict(self) -> dict:
model_incl_version = self.model if self.model else ""
if self.model and self.version:
model_incl_version += f" ({self.version}"
return dict(
id=self.id,
name=self.name,
model=f"{self.model} ({self.version})" if self.model else "",
model=model_incl_version,
description=self.description,
)