Apply summary y-ranges on the Group avg + Spread path (#186) - #189
Merged
Merged
Conversation
The per-panel y-range lookup reads the summary column id out of each trace's hovertemplate (variable=<id>). With Spread on, the app's hover rewrite from #40 had already replaced that id with the pretty axis title by the time the ranges were applied, so none of them matched a facet axis and every panel stayed autoscaled. figure_json now resolves the variable -> axis map straight after collection.plot and passes it to _apply_y_ranges. Adds regression tests for both-ends and one-sided ranges on the spread path. Co-authored-by: Jan Petter Maehlen <jepe@ife.no>
This was referenced Oct 3, 2026
Merged
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.
Closes #186
Problem
With Group avg and Spread both on, the per-panel Y ranges on the Cycle summary were silently ignored: every panel stayed autoscaled while the same ranges worked for the plain and group-avg-only paths.
Root cause
collect.figure_jsonran_add_spread_hover(from #40) before_apply_y_ranges. The range lookup finds a panel's axis by readingvariable=<summary column id>out of the traces' hovertemplate; the spread hover rewrite replaces that id with the pretty axis title, so the column ids were gone from the figure by the time the ranges were applied and nothing matched (cellpy's pretty-title fallback does not match the app's unit-bearing titles either).Fix
figure_jsonresolves thevariable → (xaxis, yaxis)map straight aftercollection.plotand hands it to_apply_y_ranges(new optionalvar_to_axeskeyword; other callers unchanged).Tests
test_summary_figure_y_ranges_apply_with_group_avg_and_spread— two ranges pinned on the spread figure, third panel still autoranged, spread bands present.test_summary_figure_y_ranges_one_sided_with_spread— a blank end is filled from the panel's own extent.range=None) and pass after; fulluv run pytestis green.Also
.issueflows/tracking files for y ranges not working for cycle summary grouped with spread #186 (solved).graphify update .artifacts refreshed, as in previous PRs.