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

fix: prevent mutating the original FIELD_DEFINITIONS dict #746

Merged
merged 4 commits into from Jun 26, 2023
Merged
Changes from 2 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
4 changes: 2 additions & 2 deletions flexmeasures/data/models/charts/belief_charts.py
Expand Up @@ -29,7 +29,7 @@ def bar_chart(
stack=None,
**FIELD_DEFINITIONS["event_value"],
)
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(),
Expand Down Expand Up @@ -99,7 +99,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(),
Expand Down