From ee320227e38eebbd2eff2a41139e50e35d15ef74 Mon Sep 17 00:00:00 2001 From: "F.N. Claessen" Date: Thu, 14 Jul 2022 12:41:59 +0200 Subject: [PATCH 1/4] Switch interpretation of charging sensor to discharging for positive values Signed-off-by: F.N. Claessen --- flexmeasures/cli/data_add.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flexmeasures/cli/data_add.py b/flexmeasures/cli/data_add.py index 0eeaa7868..6b4bbb7ea 100755 --- a/flexmeasures/cli/data_add.py +++ b/flexmeasures/cli/data_add.py @@ -970,7 +970,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", From c51bd35d6571c1203e0c922a48e44c84eb114306 Mon Sep 17 00:00:00 2001 From: "F.N. Claessen" Date: Thu, 14 Jul 2022 12:44:39 +0200 Subject: [PATCH 2/4] Stop using the SI prefix when formatting quantitative data values, now that we show the unit right next to the value Signed-off-by: F.N. Claessen --- flexmeasures/data/models/charts/belief_charts.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flexmeasures/data/models/charts/belief_charts.py b/flexmeasures/data/models/charts/belief_charts.py index 6f1570666..5bcc8344b 100644 --- a/flexmeasures/data/models/charts/belief_charts.py +++ b/flexmeasures/data/models/charts/belief_charts.py @@ -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, **{ From 3fe687e7914950a3faf71a9cdb414b6db0823ecb Mon Sep 17 00:00:00 2001 From: "F.N. Claessen" Date: Thu, 14 Jul 2022 13:07:50 +0200 Subject: [PATCH 3/4] Avoid showing "null" versions for data source models Signed-off-by: F.N. Claessen --- flexmeasures/data/models/data_sources.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/flexmeasures/data/models/data_sources.py b/flexmeasures/data/models/data_sources.py index f2b693a12..e51f5490e 100644 --- a/flexmeasures/data/models/data_sources.py +++ b/flexmeasures/data/models/data_sources.py @@ -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, ) From 2321f512b538a7f6b017f4b1c52ea98ae67af128 Mon Sep 17 00:00:00 2001 From: "F.N. Claessen" Date: Thu, 21 Jul 2022 19:34:21 +0200 Subject: [PATCH 4/4] Changelog entry Signed-off-by: F.N. Claessen --- documentation/changelog.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/documentation/changelog.rst b/documentation/changelog.rst index d54261042..e27ba1edf 100644 --- a/documentation/changelog.rst +++ b/documentation/changelog.rst @@ -20,6 +20,7 @@ Bugfixes * Do not fail asset page if entity addresses cannot be built [see `PR #457 `_] * Time scale axes in sensor data charts now match the requested date range, rather than stopping at the edge of the available data [see `PR #449 `_] * The docker-based tutorial now works with UI on all platforms (port 5000 did not expose on MacOS) [see `PR #465 `_] +* Fix interpretation of scheduling results in toy tutorial [see `PR #466 `_] Infrastructure / Support ----------------------