Repository navigation
[GUI] Initialize the ERP and scalp-map plot dialog from the dataset - #1014
Conversation
There was a problem hiding this comment.
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 finished @arnodelorme's task in 1m 4s —— View job Code review
BlockingNone. Important
NitsNone. Test gapsNone. The two new EEGLAB parity notes
|
arnodelorme
left a comment
There was a problem hiding this comment.
This review was written by an AI assistant during a nightly check, not by Arno.
Code review
- Overall assessment: Implementation matches EEGLAB, though automated tests do not yet check the initial dialog values computed from the dataset.
- Highest-risk area: Dialog field initialization in
src/eegprep/functions/popfunc/pop_timtopo.py(pop_timtopo_initial_valuesand_run_gui). - Merge recommendation: Safe to merge once a unit test covers
pop_timtopo_initial_valuesand_run_gui.
Blocking
None.
Important
None.
Nits
None.
Test gaps
- Severity: important
Location:src/eegprep/functions/popfunc/pop_timtopo.py(pop_timtopo_initial_values,_run_gui) andtests/test_gui_geometry.py(PUBLIC_CALLS,_CancelledDialog)
Why it matters:pop_timtopo_dialog_specnow leavestimerangeandtitleempty ("") so the spec matches the raw EEGLABuilist, whilepop_timtopo_initial_values(EEG)supplies the time limits and default plot title (including omitting" of <setname>"whensetnameis empty). Intests/test_gui_geometry.py,_CancelledDialog.run(self, spec, initial_values=None)records onlyself.spec, ignoresinitial_values, and cancels immediately. No other test intests/callspop_timtopo_initial_valuesor drivespop_timtopothroughgui=True, so ifinitial_valueswere dropped or misformatted, the entire test suite would still pass.
Suggested fix: Add a unit test intests/test_phase4_plot_wrappers.py(ortests/test_stream7_plots.py) that invokespop_timtopo(eeg, renderer=..., plot="off", return_com=True)with a stub renderer that mergesinitial_valuesoverspec.controlsdefaults, asserting both the formattedtimerangeand the generatedtitlefor a named dataset ("ERP data and scalp maps of ...") and an untitled dataset (setname=""producing"ERP data and scalp maps").
EEGLAB parity notes
- Checked against
functions/popfunc/pop_timtopo.mlines 62 to 76: thesuperguigeometry (5rows of[2 1]), empty window title,uilistdefaults, andevalstrinitialization oftimerange([num2str(EEG.xmin*1000) ' ' num2str(EEG.xmax*1000)]viadialog_time_range) andtitle('ERP data and scalp maps'plus optional' of ' EEG.setname) match EEGLAB. tools/visual_parity/visual_capture.py(capture_pop_timtopo_dialog) passespop_timtopo_initial_values(eeg)intorenderer.build_dialog, keeping visual capture aligned with_run_gui.- Tests run on commit
294fbe17e62040e9c94ff06ab64b35c4233969edin a detached worktree:PYTHONPATH=<worktree>/src:<worktree> .venv/bin/python -m pytest <worktree>/tests/test_gui_geometry.py: 169 passed, 80 skipped (Linux pixel comparison skipped on macOS).PYTHONPATH=<worktree>/src:<worktree> .venv/bin/python -m pytest <worktree>/tests/test_phase4_plot_wrappers.py -k timtopo: 3 passed.uv run --no-sync ruff checkon the three modified Python files: passed.- Offscreen
QtDialogRenderer().build_dialogand mock renderer check oneeglab_data.set,eeglab_data_epochs_ica.set, and an emptysetnamecopy: verified expectedtimerange,title, and history command output.
|
🤖 The test the second review asked for is added (commit |
Initialize the ERP and scalp-map plot dialog from the dataset. The continuous window measured 221 px high in MATLAB, 329 px before the fix and 221 px afterward. Stack base is #1012.
Across 2 native openings, the largest vertical control offset was 0.62 px (target 1 px). Numerical comparison of peak amplitude across drawn erp traces: 2/2 measured cases within tolerance.
EEGLAB
5e0be870, EEGPrep after336cd6b1, clean Linux checkouts. Part of #875.Fixes #1015.
Full inventory report for the project team. pop_timtopo (p. 38). PDF · Editable Word.