diff --git a/documentation/changelog.rst b/documentation/changelog.rst index eed9fbda7..559e40764 100644 --- a/documentation/changelog.rst +++ b/documentation/changelog.rst @@ -33,6 +33,7 @@ Bugfixes * Fix browser console error when loading asset or sensor page with only a single data point [see `PR #732 `_] * Fix defaults for the ``--start-offset`` and ``--end-offset` options to ``flexmeasures add report``, which weren't being interpreted in the local timezone of the reporting sensor [see `PR #744 `_] * Relax constraint for overlaying plot traces for sensors with various resolutions, making it possible to show e.g. two price sensors in one chart, where one of them records hourly prices and the other records quarter-hourly prices [see `PR #743 `_] +* Resolve bug where different page loads would potentially influence the time axis of each other's charts, by avoiding mutation of shared field definitions [see `PR #746 `_] v0.14.0 | June 15, 2023 diff --git a/flexmeasures/data/models/charts/belief_charts.py b/flexmeasures/data/models/charts/belief_charts.py index 5d3f9d7da..f3dc06aed 100644 --- a/flexmeasures/data/models/charts/belief_charts.py +++ b/flexmeasures/data/models/charts/belief_charts.py @@ -33,7 +33,7 @@ def bar_chart( event_value_field_definition["scale"] = dict( domain={"unionWith": [0, 105]}, nice=False ) - event_start_field_definition = FIELD_DEFINITIONS["event_start"] + event_start_field_definition = FIELD_DEFINITIONS["event_start"].copy() event_start_field_definition["timeUnit"] = { "unit": "yearmonthdatehoursminutesseconds", "step": sensor.event_resolution.total_seconds(), @@ -103,7 +103,7 @@ def chart_for_multiple_sensors( minimum_non_zero_resolution = min(condition) if any(condition) else timedelta(0) # Set up field definition for event starts - event_start_field_definition = FIELD_DEFINITIONS["event_start"] + event_start_field_definition = FIELD_DEFINITIONS["event_start"].copy() event_start_field_definition["timeUnit"] = { "unit": "yearmonthdatehoursminutesseconds", "step": minimum_non_zero_resolution.total_seconds(),