Skip to content

Apply summary y-ranges on the Group avg + Spread path (#186) - #189

Merged
jepegit merged 1 commit into
mainfrom
cursor/186-y-ranges-group-avg-spread-713a
Oct 4, 2026
Merged

jepegit merged 1 commit into
mainfrom
cursor/186-y-ranges-group-avg-spread-713a

Conversation

@jepegit

@jepegit jepegit commented Oct 3, 2026

Copy link
Copy Markdown
Contributor

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_json ran _add_spread_hover (from #40) before _apply_y_ranges. The range lookup finds a panel's axis by reading variable=<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_json resolves the variable → (xaxis, yaxis) map straight after collection.plot and hands it to _apply_y_ranges (new optional var_to_axes keyword; other callers unchanged).
  • The human-readable spread hover from Group-average summary plots lose detailed hover info #40 is kept as is.

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.
  • Both fail before the fix (range=None) and pass after; full uv run pytest is green.

Also

Open in Web Open in Cursor 

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>
@jepegit
jepegit merged commit b4c4264 into main Oct 4, 2026
3 checks passed
@jepegit
jepegit deleted the cursor/186-y-ranges-group-avg-spread-713a branch October 4, 2026 06:06
jepegit added a commit that referenced this pull request Oct 4, 2026
…s-713a

Keep the group-name additions after #189 and #190 squash-merged into main.

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

y ranges not working for cycle summary grouped with spread

2 participants