From b03d397f09d8ae95459ca1e86889ae2da9a2a10e Mon Sep 17 00:00:00 2001 From: Felix Claessen <30658763+Flix6x@users.noreply.github.com> Date: Mon, 31 Oct 2022 15:44:47 +0100 Subject: [PATCH] Fix scheduler for Charge Points (#517) * Fix bug: list multiplication refers to the same object; as a consequence, any new device constraint overwrote all previously set device constraints Signed-off-by: F.N. Claessen * changelog entry Signed-off-by: F.N. Claessen Signed-off-by: F.N. Claessen --- documentation/changelog.rst | 8 ++++++++ flexmeasures/data/models/planning/charging_station.py | 7 ++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/documentation/changelog.rst b/documentation/changelog.rst index dd56a80ae..2fd2defba 100644 --- a/documentation/changelog.rst +++ b/documentation/changelog.rst @@ -25,6 +25,14 @@ Infrastructure / Support * Remove bokeh dependency and obsolete UI views [see `PR #476 `_] +v0.11.3 | November XX, 2022 +============================ + +Bugfixes +----------- +* Fix scheduler for Charge Points when taking into account inflexible devices [see `PR #517 `_] + + v0.11.2 | September 6, 2022 ============================ diff --git a/flexmeasures/data/models/planning/charging_station.py b/flexmeasures/data/models/planning/charging_station.py index 40a321c63..a53df9610 100644 --- a/flexmeasures/data/models/planning/charging_station.py +++ b/flexmeasures/data/models/planning/charging_station.py @@ -110,9 +110,10 @@ def schedule_charging_station( ] if inflexible_device_sensors is None: inflexible_device_sensors = [] - device_constraints = [initialize_df(columns, start, end, resolution)] * ( - 1 + len(inflexible_device_sensors) - ) + device_constraints = [ + initialize_df(columns, start, end, resolution) + for i in range(1 + len(inflexible_device_sensors)) + ] for i, inflexible_sensor in enumerate(inflexible_device_sensors): device_constraints[i + 1]["derivative equals"] = get_power_values( query_window=(start, end),