Skip to content

[Release readiness] Stream 7: Plots and plot history #552

Closed

Description

@suraj-ranganath

[Release readiness] Stream 7: Plots and plot history

Context

This issue is one of 11 release-readiness streams for sccn/eegprep. The release goal is EEGLAB parity in the GUI and the numbers for everything except STUDY and third-party plugins (default / bundled plugins only: EEG-BIDS, ICLabel, clean_rawdata, dipfit, firfilt).

The audit (report eegprep_GUI_audit_2026-11-05.pdf, findings F1–F126 in findings.md) was run as a simulated user: hands-on GUI use of eegprep and EEGLAB side by side, with real datasets, plus numerical parity checks against MATLAB EEGLAB. EEGLAB was the pinned tree eeglab-8ac485f6 on the lab MATLAB machine (jamming, path ~/gui-parity/eeglab-8ac485f6), never modified. eegprep was develop at 0bda20da. Where the pinned tree lacked a plugin (Biosig, Fileio, neuroscanio, bva-io, Fieldtrip-lite, viewprops), comparisons against a bench copy are labelled non-pinned.

Of 144 in-scope menu items, 141 were tested hands-on in both GUIs. Not counted in that 141: Quit (not run, ends the session) and the two eegprep-only Plot items "View extended channel/component properties" (pinned EEGLAB has no viewprops; tested in eegprep only as F122).

This stream: Plot layouts and plot history (size L). Findings assigned: F71, F72, F73, F74, F76, F77, F78, F79, F82, F83, F85, F87, F99.

Files / functions owned (do not edit outside these without coordinating; see fix_streams.md):

popfunc/plot_utils.py (history_command); pop_spectopo.py + spectopo; pop_plottopo.py; pop_plotdata.py; pop_envtopo.py; pop_comperp.py; pop_eventstat.py; pop_signalstat.py; pop_headplot.py/headplot (colormap only); topoplot channel-location plotting; menu_actions.py: plot section (1530-1635)

Dependencies / merge order: Changing plot_utils.history_command alters expected history strings in DIPFIT settings and pop_prop_extended (S8 files): update only test expectations, then S8 rebases. Must not touch pop_newtimef/pop_newcrossf (S4).

Suggested tests from the stream plan: Matplotlib figure-structure tests (axes count, positions, shared y-limits); function tests for eventstat/signalstat values; MATLAB parity on jamming for eventstat (epoch ms) and for history strings runnable in MATLAB.

Common datasets used in the audit (copies only; never the originals):

  • eeglab_data.set — continuous tutorial (32 ch, 128 Hz, 30504 pnts)
  • eeglab_data_epochs_ica.set — epoched + ICA (80 epochs)
  • eeglab_data_numerical_events.set — numerical event types
  • BrainVision set (testbva.vhdr / related) — 32 ch, 2112 pnts, 17 events
  • test.bdf / test.edf — Biosemi / EDF samples
  • BIDS oddball sample for import/export
  • Neuroscan .EEG, BVA .mat, MFF folder, HDF5 eeglab_data_hdf5.set where noted
  • Channel location files: eeglab_chan32.locs, standard_1005.elc, standard-10-5-cap385.elp

Companion stream issues (together they cover F1–F126):

Stream Issue
1 Data safety #546
2 Dialogs and Edit selection #548
3 Scroll window #547
4 Signal processing #549
5 Channel locations and re-reference #550
6 Rejection numbers #551
7 Plots and plot history #552
8 ICLabel, component properties, DIPFIT #553
9 Importers #554
10 Export and BIDS #555
11 Main window, menus, preferences, help #556

Screenshots: image files for this stream are staged under /workspace/gui-parity/issues/stream-07/ and ready for gh issue edit --attach. Embedding via --attach failed with the current fine-grained GH_TOKEN (HTTP 403 on uploads.github.com). Run attach_screenshots.sh with a classic PAT that can upload user-attachments (or grant the fine-grained token Contents + attachments). Until then, screenshot filenames are listed under each finding.

Findings

Use the checkboxes to track progress. Full audit detail is carried over (not summarised away).

- [ ] F71 — high — Plot > Channel spectra and maps (no channel locations, BDF)

Finding (full audit text): eegprep crashes with raw IndexError "arrays used as indices must be of integer (or boolean) type". EEGLAB disables the freq/maps field and plots spectra without maps.

Evidence / screenshots: F71_bdf_spectopo_sbs.png (P_bdf_spectopo_*)

What needs fixing: Resolve the behaviour so eegprep matches EEGLAB for this item (GUI and numbers), unless EEGLAB is the buggy side — then keep the correct behaviour, document the difference, and lock it with a test. Add a regression test. Keep existing tolerances.

Screenshots (filenames; attach pending):

  • F71_bdf_spectopo_sbs.png — F71: EEGLAB vs eegprep side-by-side

- [ ] F72 — medium-high — Plot > Channel ERPs > In scalp/rect. array (pop_plottopo)

Finding (full audit text): eegprep draws a 6x6 rectangular grid with independent y-scales and no scale bar, ignoring the scalp layout (also with rect unchecked). EEGLAB places traces at scalp positions with a common scale.

Evidence / screenshots: F72_plottopo_sbs.png

What needs fixing: Resolve the behaviour so eegprep matches EEGLAB for this item (GUI and numbers), unless EEGLAB is the buggy side — then keep the correct behaviour, document the difference, and lock it with a test. Add a regression test. Keep existing tolerances.

Screenshots (filenames; attach pending):

  • F72_plottopo_sbs.png — F72: EEGLAB vs eegprep side-by-side

- [ ] F73 — medium — Plot > Component ERPs > In rectangular array (pop_plotdata)

Finding (full audit text): Each panel autoscaled independently, no common scale bar; EEGLAB uses one common scale (±11.8) with a scale bar. Same root as F72.

Evidence / screenshots: F73_cplotdata_sbs.png

What needs fixing: Resolve the behaviour so eegprep matches EEGLAB for this item (GUI and numbers), unless EEGLAB is the buggy side — then keep the correct behaviour, document the difference, and lock it with a test. Add a regression test. Keep existing tolerances.

Screenshots (filenames; attach pending):

  • F73_cplotdata_sbs.png — F73: EEGLAB vs eegprep side-by-side

- [ ] F74 — medium — Plot > Component ERPs > With comp. maps (compare)

Finding (full audit text): Not a compare: with 1 dataset eegprep plots without error (EEGLAB menu callback: if length(ALLEEG) == 1, error('Need at least 2 datasets')); with 2 datasets loaded the eegprep dialog lacks EEGLAB's first field "Dataset indices to subtract (Ex: '1 2'-> 1-2)" (pop_envtopo.m:96) because menu_actions.py:1587-1590 calls pop_envtopo(selection) for both variants. EEGLAB side weakness: two identical datasets with '2 1' gives a cryptic Axes/set LocSetLimits error.

Evidence / screenshots: F74_envcomp_1dataset_sbs.png, F74_envcomp2_dialog_sbs.png (EEGLAB dialog capture rendered blank; field cited from source), F74_eeglab_envcomp2_error.png

What needs fixing: Resolve the behaviour so eegprep matches EEGLAB for this item (GUI and numbers), unless EEGLAB is the buggy side — then keep the correct behaviour, document the difference, and lock it with a test. Add a regression test. Keep existing tolerances.

Screenshots (filenames; attach pending):

  • F74_envcomp2_dialog_sbs.png — F74: EEGLAB vs eegprep side-by-side
  • F74_eeglab_envcomp2_error.png — F74: EEGLAB
  • F74_envcomp_1dataset_sbs.png — F74: EEGLAB vs eegprep side-by-side

- [ ] F76 — low — Plot > Component ERPs > With component maps

Finding (full audit text): Default title "EEG Data epochs" vs EEGLAB "Largest ERP components of EEG Data epochs" (pop_envtopo.py:91/123). Numbers match.

Evidence / screenshots: F76_envtopo_title_sbs.png

What needs fixing: Resolve the behaviour so eegprep matches EEGLAB for this item (GUI and numbers), unless EEGLAB is the buggy side — then keep the correct behaviour, document the difference, and lock it with a test. Add a regression test. Keep existing tolerances.

Screenshots (filenames; attach pending):

  • F76_envtopo_title_sbs.png — F76: EEGLAB vs eegprep side-by-side

- [ ] F77 — low — Plot > Component maps > In 3-D

Finding (full audit text): viridis colormap with ±1 saturated scaling; EEGLAB jet with per-map scaling. No headplot spline warning / co-register dialog in eegprep. Channel 3-D maps match.

Evidence / screenshots: F77_cmap3d_colormap_sbs.png

What needs fixing: Resolve the behaviour so eegprep matches EEGLAB for this item (GUI and numbers), unless EEGLAB is the buggy side — then keep the correct behaviour, document the difference, and lock it with a test. Add a regression test. Keep existing tolerances.

Screenshots (filenames; attach pending):

  • F77_cmap3d_colormap_sbs.png — F77: EEGLAB vs eegprep side-by-side

- [ ] F78 — low — Plot > Channel locations > By name

Finding (full audit text): EOG1 label clipped; no "32 of 32 electrode locations shown" text; no click-to-toggle labels.

Evidence / screenshots: F78_chanloc_name_sbs.png

What needs fixing: Resolve the behaviour so eegprep matches EEGLAB for this item (GUI and numbers), unless EEGLAB is the buggy side — then keep the correct behaviour, document the difference, and lock it with a test. Add a regression test. Keep existing tolerances.

Screenshots (filenames; attach pending):

  • F78_chanloc_name_sbs.png — F78: EEGLAB vs eegprep side-by-side

- [ ] F79 — low (shared) — Plot > Channel spectra and maps, bad input

Finding (full audit text): Reversed/out-of-range freq range not validated by either: eegprep silently reverses the axis, EEGLAB gives a cryptic error.

Evidence / screenshots: F79_spectopo_bad_sbs.png

What needs fixing: Resolve the behaviour so eegprep matches EEGLAB for this item (GUI and numbers), unless EEGLAB is the buggy side — then keep the correct behaviour, document the difference, and lock it with a test. Add a regression test. Keep existing tolerances.

Screenshots (filenames; attach pending):

  • F79_spectopo_bad_sbs.png — F79: EEGLAB vs eegprep side-by-side

- [ ] F82 — low — Plot history strings

Finding (full audit text): Python keyword syntax, not runnable in EEGLAB, e.g. pop_spectopo(EEG, dataflag=1, timerange=[-1000, 1992.19], electrodes='off', percent=100, freqs=[6, 10, 22], freqrange=[2, 25]) and pop_timtopo(EEG, [float('nan')], ...); no figure; prefix. EEGLAB: figure; pop_spectopo(EEG, 1, [-1000 1992.1875], 'EEG', 'percent', 100, 'freq', [6 10 22], 'freqrange',[2 25],'electrodes','off');. Extends F27/F49/F55.

Evidence / screenshots: F82_plot_history_eegprep_vs_eeglab.png, logs/plot_history_eegprep.txt

What needs fixing: Resolve the behaviour so eegprep matches EEGLAB for this item (GUI and numbers), unless EEGLAB is the buggy side — then keep the correct behaviour, document the difference, and lock it with a test. Add a regression test. Keep existing tolerances.

Screenshots (filenames; attach pending):

  • F82_plot_history_eegprep_vs_eeglab.png — F82: F82_plot_history_eegprep_vs_eeglab

- [ ] F83 — high — Plot > Sum/Compare ERPs, Sum/Compare comp. ERPs (all menus)

Finding (full audit text): eegprep draws ONE axis with the channel-mean (or component-mean) add/subtract/difference traces, and the legend colours don't match the traces. EEGLAB pop_comperp draws a per-channel (or per-component) plottopo grid for the same inputs (sets 1 and 2).

Evidence / screenshots: F83_comperp_channels_sbs.png, F83_comperp_components_sbs.png, P_A_comperp_dlg_sbs.png

What needs fixing: Resolve the behaviour so eegprep matches EEGLAB for this item (GUI and numbers), unless EEGLAB is the buggy side — then keep the correct behaviour, document the difference, and lock it with a test. Add a regression test. Keep existing tolerances.

Screenshots (filenames; attach pending):

  • P_A_comperp_dlg_sbs.png — F83: EEGLAB vs eegprep side-by-side
  • F83_comperp_channels_sbs.png — F83: EEGLAB vs eegprep side-by-side
  • F83_comperp_components_sbs.png — F83: EEGLAB vs eegprep side-by-side

- [ ] F85 — high — Edit/Plot > Event statistics (pop_eventstat, all menus)

Finding (full audit text): Latency is shown in absolute samples (Mean 7509.06, Std 4542.13, Median 7449). EEGLAB uses epoch-relative ms (80 points, mean 207, trimmed mean 209, SD 260.5) and adds trimmed stats, quantiles and the KS normality test.

Evidence / screenshots: F85_eventstat_sbs.png, P_A_eventstat_dlg_sbs.png

What needs fixing: Resolve the behaviour so eegprep matches EEGLAB for this item (GUI and numbers), unless EEGLAB is the buggy side — then keep the correct behaviour, document the difference, and lock it with a test. Add a regression test. Keep existing tolerances.

Screenshots (filenames; attach pending):

  • P_A_eventstat_dlg_sbs.png — F85: EEGLAB vs eegprep side-by-side
  • F85_eventstat_sbs.png — F85: EEGLAB vs eegprep side-by-side

- [ ] F87 — medium — Plot > Data statistics (pop_signalstat, all menus)

Finding (full audit text): The numbers match (ch1 kurtosis 45.357, comp1 0.518899). eegprep shows only 5 stats (mean, SD, median, skewness, kurtosis). EEGLAB adds trimmed mean/SD, quantiles, the KS test with a verdict, and a fitted-normal histogram. The eegprep figure opens partly off-screen and its head plot has no electrode marker.

Evidence / screenshots: F87_sigstat_sbs.png

What needs fixing: Resolve the behaviour so eegprep matches EEGLAB for this item (GUI and numbers), unless EEGLAB is the buggy side — then keep the correct behaviour, document the difference, and lock it with a test. Add a regression test. Keep existing tolerances.

Screenshots (filenames; attach pending):

  • F87_sigstat_sbs.png — F87: EEGLAB vs eegprep side-by-side

- [ ] F99 — low — History for Preferences / comperp / crossf

Finding (full audit text): Preferences history has no arguments. comperp and crossf use Python keyword form, which EEGLAB can't run (extends F82).

Evidence / screenshots: F99_prefs_info_eegprep.png, F83_comperp_channels_sbs.png

What needs fixing: Resolve the behaviour so eegprep matches EEGLAB for this item (GUI and numbers), unless EEGLAB is the buggy side — then keep the correct behaviour, document the difference, and lock it with a test. Add a regression test. Keep existing tolerances.

Definition of done

  • Every finding checkbox in this issue is fixed (or explicitly documented as intentional / EEGLAB-only with a locked test).
  • A regression test exists for each finding (Qt offscreen and/or function test as appropriate for the stream).
  • Where numbers are involved: a numerical parity test against pinned EEGLAB eeglab-8ac485f6 on jamming. Do not loosen any existing tolerance — only Suraj or Arno may change tolerances; fix root causes instead.
  • Where EEGLAB itself is buggy: eegprep does the right thing; the difference is documented and locked with a test (documented-difference style).
  • Error messages state what is wrong, which function hit it, and the exact fix (e.g. the pip install eegprep[...] command).
  • No code comments that restate code or justify workarounds.
  • Changelog entry for the stream.
  • One PR against develop, CI green (ignore the known-broken Claude review check).
  • Before merge, retest the same way as the audit: each finding's GUI flow is re-run hands-on in both eegprep and EEGLAB side by side, with before/after screenshots, plus the MATLAB parity / reference checks where this stream requires them; post the results on the PR.
  • Merging requires Suraj's explicit approval (squash merge).

Dependencies and overlaps

Changing plot_utils.history_command alters expected history strings in DIPFIT settings and pop_prop_extended (S8 files): update only test expectations, then S8 rebases. Must not touch pop_newtimef/pop_newcrossf (S4).

Shared hotspots (from fix_streams.md):

  • menu_actions.py is split by method — only edit this stream's named methods.
  • tests/eeglab_python_backend_xfails.py and tests/parity_expected/: each stream adds/removes only its own entries.
  • Suggested merge order overall: S1 → S2/S9/S11 → S5; S7 → S8; S3/S4/S6/S10 independent.

References

  • Audit PDF: eegprep_GUI_audit_2026-11-05.pdf (Suraj / Arno)

  • Findings log: findings.md (F1–F126)

  • Stream plan: fix_streams.md

  • Pinned EEGLAB: eeglab-8ac485f6

Screenshots (filenames; attach pending):

  • F99_prefs_info_eegprep.png — F99: eegprep

Activity

  1. added
    bug
    epic
    on Nov 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugepic

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions