Repository navigation
[GUI] Match the pop_rejtrend dialog to EEGLAB - #911
Conversation
Use the supergui layout, EEGLAB's blank geometry row, the full slope and R-square labels, and blank checkbox strings from pop_rejtrend.m. Fixes #910 Co-Authored-By: Claude Opus 5.5 <[email protected]>
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 @claude[bot]'s task in 51s —— View job Code review
BlockingNone. Important
NitsNone. Test gapsNone. The new parametrized test covers the geometry, layout and shown strings for both the data and component variants. EEGLAB parity notes
Checked for correctness bugs, EEGLAB parity, data structure compatibility, changed-behavior tests, and CLAUDE.md/AGENTS.md compliance. |
| # pop_rejtrend.m line 118 swaps the units of its fastif: data shows std. dev., components show uV. | ||
| slope_unit = "std. dev./epoch" if is_data else "uV/epoch" |
There was a problem hiding this comment.
Important (needs a maintainer decision): this copies a wrong unit label from EEGLAB into the data dialog.
trend_marks fits slopes to the raw rows and never normalizes them (
eegprep/src/eegprep/functions/popfunc/_rejection.py
Lines 218 to 226 in 36cc26f
maxslope is therefore in µV per window. A researcher who reads "std. dev./epoch" would pick a threshold on the wrong scale. The review standard says EEGPrep does the correct thing where EEGLAB has a bug, documents the difference and locks it with a test. A literal copy goes against that.
Suggested fix: show the true unit, "uV/epoch" if is_data else "std. dev./epoch" (or just drop the unit from the component label). Then update the changelog entry and the parametrized test, and add a line to resources/help/pop_rejtrend.md saying EEGPrep fixes EEGLAB's swapped label. If the maintainers would rather keep the literal copy for screenshot parity, a short note in the help file would at least tell users the real unit.
# Conflicts: # docs/source/changelog.rst # src/eegprep/functions/popfunc/pop_rejtrend.py
|
🤖 Second round on the review above (commit
|
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: Safe to merge. PR #927 (
8e2a9db3) already landed thepop_rejtrend_dialog_specchanges ondevelop, and the remainingchangelog.rstandpop_rejtrend.mdadditions in this branch are accurate, with one optional duplicate test nit. - Highest-risk area: Slope unit explanation in
src/eegprep/resources/help/pop_rejtrend.md. - Merge recommendation: Safe to merge.
Blocking
None.
Important
None.
Nits
- Duplicate dialog spec test in
tests/test_stream6_rejection_numbers.py(test_pop_rejtrend_dialog_matches_eeglab_uilist, lines 777 to 806): After mergingorigin/develop(c263758b),src/eegprep/functions/popfunc/pop_rejtrend.pyhas no diff againstdevelopbecause PR #927 (8e2a9db3) already updatedpop_rejtrend_dialog_specand addedpop_rejtrendandpop_rejtrend.icatotests/test_gui_geometry.py.test_pop_dialog_has_the_geometry_eeglab_passes_to_inputguialready checkslayout,geometry,title,help_text, and every control style, string, and default value oneeglab_data_epochs_ica.setagainst the recorded MATLABuilistfiles (tools/gui_geometry/cases/pop_rejtrend.jsonandpop_rejtrend.ica.json). Keeping a second hardcoded copy of those control strings intests/test_stream6_rejection_numbers.pyduplicates that coverage (AGENTS.md, Testing: only add a test that catches a real bug existing tests miss).
Suggested fix: Remove thepop_rejtrend_dialog_specimport andtest_pop_rejtrend_dialog_matches_eeglab_uilistfromtests/test_stream6_rejection_numbers.pyso this PR carries only thedocs/source/changelog.rstentry andsrc/eegprep/resources/help/pop_rejtrend.mdunit note missing from #927, or merge as is if the extra unit test is wanted.
Test gaps
None.
EEGLAB parity notes
- Slope unit note verified: Checked
src/eegprep/resources/help/pop_rejtrend.mdanddocs/source/changelog.rstagainstpop_rejtrend.m(header lines 15 to 18 vsfastifat line 118),rejtrend.m(lines 76 to 83), andsrc/eegprep/functions/popfunc/_rejection.py(trend_marks, lines 219 to 232). Becauserejtrendfits againstlinspace(1 / winsize, 1, winsize)on unnormalized channel rows (µV) or raw ICA activations,maxslopeis in data units (µV) per window ofwinsizepoints for channels and component activation units per window for ICA, while the dialog keeps EEGLAB's swappeduiliststrings for GUI geometry parity. - No numerical change: The diff against
developtouches only documentation, help text, and tests, so no MATLAB reference run is needed.
Tests run: Ran .venv/bin/python -m pytest tests/test_stream6_rejection_numbers.py tests/test_guifunc_pophelp_chansel.py tests/test_gui_geometry.py -k "not layout_places_controls or rejtrend" on commit cd6981351316e9a2520a8cb1bcd40fd5355dd7be in a detached worktree: 120 passed, 67 skipped (Linux MATLAB reference pixel checks on macOS), 74 deselected in 15.04s.
Draw the linear trend rejection dialog with the supergui layout and the geometry, labels and blank checkbox strings of pop_rejtrend.m, so rows sit as close as in EEGLAB and the slope unit and R-square example appear. EEGLAB swaps the slope units between the data and component dialogs; the port copies that literally. GUI only, no numerical change.
Fixes #910
🤖 Generated with Claude Code