Skip to content

[EEGBrowser] Complete Phase 7 closeout - #110

Merged
suraj-ranganath merged 3 commits into
feature/eegbrowser-completionfrom
phase/eegbrowser-7-closeout
Jun 1, 2026
Merged

suraj-ranganath merged 3 commits into
feature/eegbrowser-completionfrom
phase/eegbrowser-7-closeout

Conversation

@suraj-ranganath

Copy link
Copy Markdown
Member

Remove stale EEGBrowser exclusion docs/placeholders, add packaged help and user-guide coverage, expand browser visual parity inventory, and harden session, resize, and large-data smoke coverage.

Evidence: ruff check, ruff format --check, ty check, focused pytest 217 passed/2 skipped, non-slow pytest 1548 passed/230 skipped/11 deselected, MATLAB parity attempt 1 passed/1 skipped, 12 visual compares, mixed console/GUI QA, and clean autoreview.

Residual risk: MATLAB Engine was unavailable for the conversion-helper parity test; visual differences are native rendering and antialiasing.

Closes #101

@claude

claude Bot commented Jun 1, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @suraj-ranganath's task in 5m 9s —— View job


Code review

  • Overall assessment: Looks good.
  • Highest-risk area: session.add_history early-return semantics (verified correct).
  • Merge recommendation: Safe to merge.

Blocking

None.

Important

None.

Nits

  • src/eegprep/functions/guifunc/visual_capture.py:493-500 — winrej is recomputed inside the rejcont_continuous branch even though it was already assigned at line 493 with the same argument. Minor; can be dropped:

    if variant == "rejcont_continuous":
        selected_rows = [0, 1, 2, 3]
        data = np.asarray(eeg["data"], dtype=float)[selected_rows, :]
        eeg["chanlocs"] = [eeg["chanlocs"][index] for index in selected_rows]
        # winrej = _demo_eegbrowser_winrej(variant)  # already set above
  • src/eegprep/functions/guifunc/menu_placeholders.py — PLACEHOLDER_ACTION_METADATA is now an empty mapping, which makes is_placeholder_action/placeholder_metadata/placeholder_message effectively dormant. Keeping the module is fine (stable hook for future phase work), and test_menu_placeholder_inventory.py still asserts the contract — flagging only so the dormant surface is intentional.

Test gaps

None — the LASTCOM preservation fix is covered by test_eegplot_browser_accept_callback_is_session_safe (tests/test_gui_rejection_dialogs.py:260), the control resync is covered by tests/test_eegplot_gui.py:55-57, decimation is covered by test_gui_large_continuous_data_decimates_visible_traces, and the doc/help text cleanup is asserted by test_browser_help_and_docs_do_not_describe_eegbrowser_as_excluded.

EEGLAB parity notes

  • The new eegbrowser_* cases in tools/visual_parity/cases.json mirror EEGLAB eegplot() arguments closely (channel/component/data2/spectral/rejcont/rejection_epochs paths, wincolor=[0 0.9 0] for rejcont, butlabel="Update Marks" for component activity), so EEGLAB users should see the expected paired figures.
  • Help text changes correctly drop the “EEGBrowser is out of scope” language now that browser-backed paths are wired through pop_rejmenu, pop_autorej, pop_selectcomps, eeg_rejsuperpose, and pop_rejepoch.

Notes on the substantive code changes

  1. EEGPrepSession.add_history (session.py:278-286) — The early-return on falsy command is a real bug fix. Previously, add_history("") (which store_current issues when command="") would call eegh("", ALLCOM) → return "" → assign self.LASTCOM = "", clobbering the last real command. With the guard, no-op calls now preserve LASTCOM, matching EEGLAB's behavior where LASTCOM retains the most recent real command. Verified against all callers (notify=False storage paths in store_current, delete_current, set_study, and the GUI accept_eegplot flow that sets store_command = "" if command in recorded_commands).

  2. EEGBrowserWindow._layout_children (eegbrowser.py:209) — Adding self.controls.sync_from_state() after set_geometry is necessary because _layout_children calls self.controls.show() (line 191) when transitioning out of noui, which makes every child widget visible — including event_button. The resync restores the correct hidden/visible state based on state.events, state.accept_label, etc. The new assertion window.controls.event_button.isHidden() is True (test_eegplot_gui.py:56) covers exactly this.

  3. visual_capture._demo_eegbrowser_eeg/capture_eegbrowser — New variants compose correctly: 8-channel winrej rows have 5+8=13 columns; the rejcont_continuous branch shrinks both data and chanlocs to 4 channels and uses 5+4=9-column winrej. _demo_eegbrowser_ica_eeg assigns identity ICA matrices so build_eegplot_model(..., component=True) resolves to icaact.

Checked: correctness, EEGLAB parity (eegplot CLI args, help wording, menu placeholder semantics), EEG dict handling (channel-major data, 1-based event latencies/winrej frames), test coverage for changed behavior, and AGENTS.md compliance (no runtime dependency on src/eegprep/eeglab/, packaged help under resources/help/, EEGLAB-parallel directory layout).
· branch phase/eegbrowser-7-closeout

@suraj-ranganath

suraj-ranganath commented Jun 1, 2026 •

Copy link
Copy Markdown
Member Author

🤖 EEGBrowser visual parity side-by-side captures (updated saturation)

Attachments

eegbrowser_continuous.png eegbrowser_continuous_marked.png
eegbrowser_continuous.png eegbrowser_continuous_marked.png
eegbrowser_epoched.png eegbrowser_epoched_marked.png
eegbrowser_epoched.png eegbrowser_epoched_marked.png
eegbrowser_events.png eegbrowser_grid_off.png
eegbrowser_events.png eegbrowser_grid_off.png
eegbrowser_labels.png eegbrowser_component_activity.png
eegbrowser_labels.png eegbrowser_component_activity.png
eegbrowser_data2_overlay.png eegbrowser_pop_eegplot_reject_data.png
eegbrowser_data2_overlay.png eegbrowser_pop_eegplot_reject_data.png
eegbrowser_rejcont_continuous.png eegbrowser_rejection_epochs.png
eegbrowser_rejcont_continuous.png eegbrowser_rejection_epochs.png

@suraj-ranganath

suraj-ranganath commented Jun 1, 2026 •

Copy link
Copy Markdown
Member Author

🤖 Verification evidence for Phase 7 closeout

Commands run:

  • uv run --no-sync ruff check .
  • uv run --no-sync ruff format --check .
  • uv run --no-sync ty check
  • uv run --no-sync pytest tests/test_menu_placeholder_inventory.py tests/test_public_api_examples.py tests/test_visual_parity.py tests/test_eegplot.py tests/test_eegplot_gui.py tests/test_console_workspace.py tests/test_gui_rejection_dialogs.py tests/test_rejection_workflows.py -> 217 passed, 2 skipped
  • EEGPREP_SKIP_MATLAB=1 uv run --no-sync pytest -m "not slow" -> 1548 passed, 230 skipped, 11 deselected
  • EEGPREP_EEGLAB_ROOT=/Users/suraj/Desktop/eeglab uv run --no-sync pytest tests/test_eegplot.py::test_eegplot_conversion_helpers_match_matlab tests/test_rejection_workflows.py::test_eeg_rejsuperpose_matches_eeglab_for_deterministic_marks -> 1 passed, 1 skipped because MATLAB Engine is unavailable for the conversion helper parity test
  • ./pre-commit.py --fix -> OK on staged files
  • .agents/skills/oc-autoreview-adapted/scripts/autoreview --mode local -> clean after fixing two visual fixture findings

Visual parity:

  • Captured EEGLAB and EEGPrep screenshots with EEGPREP_EEGLAB_ROOT=/Users/suraj/Desktop/eeglab
  • Compared 12 EEGBrowser cases: continuous, continuous marked, epoched, epoched marked, events, grid off, labels, component activity, data2 overlay, pop_eegplot reject data, pop_rejcont continuous, rejection epochs
  • After the mark-saturation follow-up, affected visual compares were rerun and updated side-by-side images are attached in the upload comment. The marked-case mean absolute deltas now range from 0.041573 to 0.061513.

Mixed console/GUI QA:

  • Launched eegprep-console --full --window-menu-bar, loaded sample_data/eeglab_data.set, opened the GUI pop_eegplot:data path, scrolled, marked samples, accepted rejection, and verified CURRENTSET, ALLCOM, and LASTCOM.
  • Built an eegplot(..., show=False) model from the console, returned to GUI display/reject paths, verified cancel left data unchanged, and exercised an empty EEG console error path.
  • Computer Use was attempted against the running Python/EEGPrep app but could not resolve the macOS Python process, and Terminal access is safety-blocked, so evidence was collected via the live console PTY and Qt widget interactions.

Saturation follow-up:

  • Increased EEGPrep winrej region fill/edge opacity so red/green marked regions read closer to EEGLAB while staying behind traces.
  • Reran uv run --no-sync pytest tests/test_eegplot_gui.py tests/test_visual_parity.py -> 47 passed.
  • Recaptured EEGPrep and compared marked browser cases: continuous marked, epoched marked, component activity, pop_eegplot reject data, pop_rejcont continuous, and rejection epochs.

@suraj-ranganath
suraj-ranganath merged commit 66b86ae into feature/eegbrowser-completion Jun 1, 2026
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.

1 participant