Skip to content

[GUI] Match the activity plot parameter dialog - #987

Merged
arnodelorme merged 3 commits into
developfrom
agent/issue-875-plot-plotdata
Dec 1, 2026
Merged

arnodelorme merged 3 commits into
developfrom
agent/issue-875-plot-plotdata

Conversation

@arnodelorme

@arnodelorme arnodelorme commented Dec 1, 2026 •

Copy link
Copy Markdown
Collaborator

Match the activity plot parameter dialog. The continuous window measured 171 px high in MATLAB, 254 px before the fix and 171 px afterward. Stack base is #984.

Continuous

Epoched

Displacement

Average plotted waveform

Across 2 native openings, the largest vertical control offset was 0.49 px (target 1 px). Numerical comparison of average plotted waveform: 2/2 measured cases within tolerance.

EEGLAB 5e0be870, EEGPrep after 2e458385, clean Linux checkouts. Part of #875.

Fixes #988.

Full inventory report for the project team. pop_plotdata (p. 41). PDF · Editable Word.

@claude claude Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Code review skipped — your organization has no extra usage available to pay for this review.

If your organization's extra usage balance is empty, an organization admin can add extra usage credits at claude.ai/admin-settings/usage. If its monthly spend limit was reached, an admin can raise it on the same page. If neither applies, contact Anthropic support.

Once extra usage is available, someone with write access to this repository can comment @claude review on this pull request to trigger a review.

@claude

claude Bot commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @arnodelorme's task in 45s —— View job


Code review

  • Overall assessment: The channel-dialog change is sound, but the new docs sentence describes component-dialog behavior that the code doesn't implement.
  • Highest-risk area: the component (typeplot=0) dialog prompt and layout in pop_plotdata_dialog_spec.
  • Merge recommendation: Needs changes.

Blocking

None.

Important

  • The docs describe behavior the code doesn't have. src/eegprep/functions/popfunc/pop_plotdata.py:115, docs/source/api/interactive_pop_workflows.rst:99
    • The new docs line says: "The component activity dialog displays the available index range and puts each multi-line prompt above its answer".
    • The component prompt is still the single-line "Component number(s):". So inputdlg2_geometry returns the side-by-side (1, 0.6) layout, and the dialog never shows the index range.
    • EEGLAB's pop_plotdata.m uses sprintf('Component number(s):\n(up to %d)', size(EEG.icaweights,1)) for components, and that newline makes inputdlg2 stack every prompt above its answer.
    • Fix: build the prompt by type. I left a committable suggestion inline. Otherwise, remove the docs sentence.

Nits

None.

Test gaps

  • Both new geometry cases (pop_plotdata, pop_plotdata.continuous) use typeplot=1, so nothing checks the component dialog's layout. Add 'pop_plotdata.component' ... @() pop_plotdata(EEG, 0) to tools/gui_geometry/matlab/record_geometry.m, plus the matching PUBLIC_CALLS entry in tests/test_gui_geometry.py (with pop_plotdata(eeg, 0, renderer=renderer) on an ICA dataset).

EEGLAB parity notes

  • The channel dialog now uses EEGLAB's inputdlg2 layout: (1, 0.6) geometry through supergui, with no hard-coded size. Its default 1:N is no longer blanked when there are no channels, which matches MATLAB.
  • I checked: the diff against origin/agent/issue-875-plot-prop, inputdlg2_geometry, the edits to the geometry case and reference files, and that the docs match the code. I didn't re-run the MATLAB geometry capture. The vendored EEGLAB checkout isn't in this CI clone, so the EEGLAB reference above is from upstream pop_plotdata.m.

count = int(EEG.get("nbchan", 0) or 0) if is_channel else np.asarray(EEG.get("icaweights", [])).shape[0]
label = "Channel" if is_channel else "Component"
controls = (
ControlSpec("text", f"{label} number(s):"),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Important (docs/behavior mismatch): This PR adds the following sentence to docs/source/api/interactive_pop_workflows.rst: "The component activity dialog displays the available index range and puts each multi-line prompt above its answer". The code doesn't do that. For typeplot=0, the first prompt is still the single-line "Component number(s):", so inputdlg2_geometry gets no multi-line prompts and returns the side-by-side (1, 0.6) layout. The upper bound never appears in the prompt either.

EEGLAB's pop_plotdata.m builds the component prompt as sprintf('Component number(s):\n(up to %d)', size(EEG.icaweights,1)), which makes inputdlg2 stack every prompt above its answer. The two recorded cases only cover typeplot=1, so the geometry test can't catch this.

Suggested fix: build the prompt by type, then add a pop_plotdata.component geometry case (MATLAB pop_plotdata(EEG, 0)) so the stacked layout is checked against EEGLAB:

Suggested change
ControlSpec("text", f"{label} number(s):"),
ControlSpec("text", "Channel number(s):" if is_channel else f"Component number(s):\n(up to {count})"),

If the component prompt is meant to stay single-line, drop the docs sentence instead.

@arnodelorme
arnodelorme changed the base branch from agent/issue-875-plot-prop to develop December 1, 2026 06:14
# Conflicts:
#	tests/test_gui_geometry.py
#	tools/gui_geometry/matlab/record_geometry.m
@arnodelorme

Copy link
Copy Markdown
Collaborator Author

🤖 Second round on the review above (commit 94ba7895). The branch now includes develop.

  • The reviewer's EEGLAB claim does not hold, so the prompt was not changed. EEGLAB develop (5e0be870) pop_plotdata.m line 89 passes the single-line prompt 'Component number(s):'. A fresh recording of pop_plotdata(EEG, 0) with MATLAB R2025b on jamming gives the side-by-side geometry [1 0.6] on its three rows, the same as the channel dialog. EEGPrep already does this.
  • The docs sentence was the real error and is corrected. It described an index range and stacked prompts that neither program shows.
  • Test gap closed. The component dialog is now a recorded case (pop_plotdata.component, case and MATLAB reference) and is compared through the public call pop_plotdata(EEG, 0).

Checked on jamming before the change was pushed: 117 geometry cases passed on this branch with the new case.

@arnodelorme arnodelorme left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This review was written by an AI assistant during a nightly check, not by Arno.

Code review

  • Overall assessment: Looks good.
  • Highest-risk area: None identified.
  • Merge recommendation: Safe to merge.

Blocking

None.

Important

None.

Nits

None.

Test gaps

None.

EEGLAB parity notes

None.

Checked pop_plotdata_dialog_spec against EEGLAB functions/popfunc/pop_plotdata.m and functions/guifunc/inputdlg2.m (both channel and component dialogs pass three single line prompts to inputdlg2 with [1 0.6] row weights, empty geomvert, and 1:N default index range, including "1:0" when empty), documentation synchronization in docs/source/api/interactive_pop_workflows.rst, geometry recordings in tools/gui_geometry/, and AGENTS.md compliance.

Tests run at 94ba7895713ac552acb37b8948d2745cdd65620a: tests/test_gui_geometry.py (149 passed, 70 Linux reference font checks skipped on macOS), tests/test_popfunc_visual_eeglab_tests.py (test_pop_plotdata_selects_modes_trials_averages_and_single_trial_overlays, 1 passed), tests/test_stream7_plots.py (plotdata replay check, 1 passed), and ruff check on src/eegprep/functions/popfunc/pop_plotdata.py and tests/test_gui_geometry.py (passed).

@arnodelorme
arnodelorme merged commit 9a98055 into develop Dec 1, 2026
9 checks passed
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.

pop_plotdata: Match the activity plot parameter dialog

1 participant