Skip to content

Optimize the step-3 and step-4 result views - #414

Merged
pauladkisson merged 1 commit into
mainfrom
optimize_viz
Aug 5, 2026
Merged

Optimize the step-3 and step-4 result views#414
pauladkisson merged 1 commit into
mainfrom
optimize_viz

Conversation

@pauladkisson

@pauladkisson pauladkisson commented Aug 5, 2026

Copy link
Copy Markdown
Collaborator

Fixes #403

Details (AI-generated)

Three changes, spanning the Step 3 result views as well as the Step 4 transients tab.

Responsive plot width. PLOT_WIDTH = 750 is gone; trace panels set responsive=True with a fixed height, and their panes and containing Columns are sizing_mode="stretch_width". This restores what the matplotlib pop-ups had — a resizable window the plot filled.

One stacked layout per recording site. The preprocessing and artifact-removal reviews rendered control/signal/fit and z-score/ΔF/F as two sections, each with its own Recording site selector — so the two could sit on different sites at once. They are now one hv.Layout of five panels under a single selector, sharing an x-axis so zoom links across all of them. build_control_signal_fit takes an optional extra_traces dict; the marking page still gets its three panels.

plot_zScore_dff removed. It was read into a local in preprocess.py and never used again — z-score and ΔF/F are written unconditionally. Its only real consumers were the two view builders, where it decided whether to render a section over data that always exists on disk, defaulting to None (render nothing). Dropped from the parameter form, GuPPyParamtersUsed.json, and the docs. Old parameter files carrying the key are ignored by setInputParameters.

No artifact shading before removal. The preprocessing review shaded saved keep-windows, implying a removal that has not happened yet. Since the post-removal page already shaded nothing, this drops shading out of PreprocessingReviewView entirely; build_control_signal_fit's spans argument became optional. The Select Artifact Windows page is unchanged.

Test note: without the spans layer a single-trace panel resolves to a bare hv.RGB rather than an hv.Overlay, so the test helpers normalize across both shapes.

Scope: #403 is titled for the transients view, but the preprocessing review carries the same roughness and the same fix, so it is covered here too.

🤖 Generated with Claude Code

Trace plots stretch to the browser width instead of a fixed 750 px, across
the preprocessing, artifact-window, artifact-removal and transient-peak views.

The preprocessing and artifact-removal reviews now stack all five traces for a
recording site — control, signal, signal+fit, z-score and dF-F — in one
axis-linked layout under a single site selector, replacing the separate
z-score/dF-F section that carried its own unsynced selector. The plot_zScore_dff
parameter only gated whether that section rendered over data preprocessing
always writes, so it is removed from the form, the provenance snapshot and docs.

The preprocessing review no longer shades saved artifact windows, which implied
a removal that has not happened yet. Shading remains on the Select Artifact
Windows page, so build_control_signal_fit's spans argument is now optional.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@pauladkisson
pauladkisson enabled auto-merge August 5, 2026 17:54
@codecov

codecov Bot commented Aug 5, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@pauladkisson
pauladkisson merged commit 87cc59a into main Aug 5, 2026
12 checks passed
@pauladkisson
pauladkisson deleted the optimize_viz branch August 5, 2026 18:09
pauladkisson added a commit that referenced this pull request Aug 6, 2026
The tonic pages predated PRs #410/#413/#414 and were the last ones still using
the patterns those replaced.

Define Tonic Epochs now mirrors Select Artifact Windows: one form row per window
(label, numeric bounds nudgeable with the arrow keys, delete button) instead of
a fixed three-row Tabulator, an "Add epoch" button, a column header, and an
empty-state hint. Both pages' plots stack z-score and dF/F on a shared, linked
time axis, stretch to the tab width, and render by per-pixel sample density, so
a full-length recording no longer ships every sample to the browser. Editing a
bound repaints the shaded spans through a pipe rather than re-aggregating the
traces. The signal toggle is gone, since both traces are now shown at once.

Windows saved on disk are reloaded when the page reopens, so a revisit shows the
current definitions rather than a blank table.

build_control_signal_fit's panel builder is extracted as _shaded_panel and
shared with the new build_stacked_traces.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.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.

Optimize Transients Visualization

1 participant