Fix chart interpolation for rows mixing real sensors with flex-config constants - #2356
Open
sankalpsthakur wants to merge 1 commit into
Open
Conversation
sankalpsthakur
force-pushed
the
fix/2253-constant-sensor-interpolation
branch
from
July 25, 2026 09:54
9aa7117 to
0a72506
Compare
Documentation build overview
31 files changed ·
|
sankalpsthakur
force-pushed
the
fix/2253-constant-sensor-interpolation
branch
from
July 28, 2026 10:14
0a72506 to
eb7bdbd
Compare
…rs with flex-config constants Signed-off-by: Sankalp Thakur <sankalphimself@gmail.com>
sankalpsthakur
force-pushed
the
fix/2253-constant-sensor-interpolation
branch
from
July 30, 2026 09:02
eb7bdbd to
0ae1fec
Compare
Contributor
|
@sankalpsthakur could you share some screenshots after the fixes? |
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Description
create_line_layerinflexmeasures/data/models/charts/belief_charts.pyso that a chart row's interpolation mode (linearvsstep-after) is decided only by the real sensors in that row, not by fixed-value/constant sensors sourced from flex-model / flex-context (e.g.soc-min,soc-max, capacities). Fixed-value sensors always reportevent_resolution == timedelta(0)by construction (they're synthetic, not backed by timed data), so a row mixing a real, non-instantaneous sensor with any such constant was incorrectly forced tolinearinterpolation instead of the correctstep-after.documentation/changelog.rstLook & Feel
No screenshot from this environment — the change affects the Vega-Lite
mark.interpolatevalue driving line rendering (straight-line "linear" vs staircase "step-after"), which is exactly what the two new regression tests assert on directly. The original bug report's before/after screenshots show a real (should be step-after) sensor's line rendering as smoothly interpolated/linear whenever it shares a row with a flex-model/flex-context constant.How to test
Run the two new tests in
flexmeasures/data/tests/test_belief_charts.py:test_mixed_row_with_fixed_value_sensor_keeps_step_afteris the regression case: a real 15-min-resolution sensor sharing a row with asoc-minfixed-value constant must producestep-after. Fails onmain(assertslinear == step-after→AssertionError), passes with this fix.test_real_instantaneous_sensor_still_uses_linearis a guard case proving a real instantaneous sensor alone still correctly getslinear.Full file for no-regression check:
pytest flexmeasures/data/tests/test_belief_charts.py -q(33 passed).Further Improvements
None identified — this is a targeted fix to the interpolation-selection predicate.
Related Items
Fixes #2253
AI/LLM disclosure
Sign-off