Repository navigation
[GUI] Epoch rejection menu and its three actions - #1047
arnodelorme wants to merge 2 commits into
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.
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: needs changes
- Highest-risk area:
pop_rejmenufinal actions, main window modal test compatibility, and dataset commit parity - Merge recommendation: needs changes
Blocking
test_cancel_rejection_dialog_keeps_menus_history_and_datasethangs forever onpop_rejmenu:ica- File: and
eegprep/src/eegprep/functions/popfunc/pop_rejmenu.py
Lines 350 to 358 in 0b050df
eegprep/tests/test_gui_main_window.py
Lines 1358 to 1395 in 0b050df
- Why it matters:
pop_rejmenu_dialog_specnow setsaddbuttons=Falseand replaces the standardokandcancelbuttons withkeep,clear, andreject. Intests/test_gui_main_window.py,test_cancel_rejection_dialog_keeps_menus_history_and_datasetstill includes"pop_rejmenu:ica"and reschedulesQTimer.singleShot(0, cancel)wheneverdialog.findChild(QPushButton, "cancel")isNone. Becausepop_rejmenuno longer has acancelbutton, the modal loop never exits and the main CI test job will time out once this branch targetsdevelop. - Suggested fix: In
test_cancel_rejection_dialog_keeps_menus_history_and_dataset, detect whendialog.objectName() == "pop_rejmenu"and dismiss it withdialog.reject()aftergc.collect()(matching window close or Escape when no Cancel button exists).
- File:
Important
-
REJECT MARKED TRIALScloses the dialog before checking for zero or all marked trials- File: and
eegprep/src/eegprep/functions/guifunc/qt.py
Lines 668 to 679 in 0b050df
eegprep/src/eegprep/functions/popfunc/pop_rejmenu.py
Lines 58 to 65 in 0b050df
- Why it matters:
submit_dialogprompts"Reject the marked trials?"and callssource.window().accept()unconditionally. When zero epochs are marked, EEGLAB (functions/adminfunc/pop_rejmenu.m, lines 184 to 192) superposes marks first, warns"No epoch selected...", and keepspop_rejmenuopen without asking for rejection confirmation. Here, the user is asked to confirm, the dialog closes, andpop_rejmenusilently returns without rejecting anything or warning. Conversely, when every epoch is marked, the dialog closes first andpop_rejepochthen raisesValueError, discarding the open window and any calculations made in that session. - Suggested fix: Validate mark counts inside the
rejectbutton action before prompting and accepting the dialog. Superpose marks on the working dataset first. If none are marked, show a warning message box and keep the dialog open. If all epochs are marked, show the empty dataset warning and keep the dialog open. Only prompt"Reject the marked trials?"and accept the dialog when0 < marked < trials.
- File:
-
Rejecting trials from
pop_rejmenuin the main GUI overwritesALLEEG[CURRENTSET]in place instead of committing viapop_newset- File:
eegprep/src/eegprep/functions/guifunc/menu_actions.py
Lines 1494 to 1536 in 0b050df
- Why it matters: In EEGLAB (
functions/adminfunc/pop_rejmenu.m, lines 188 to 200),CLOSE (KEEP MARKS)updates the current dataset in place (eeg_store), whereasREJECT MARKED TRIALSremoves trials withpop_rejepochand commits the reduced dataset viapop_newset. InMenuActionDispatcher._run_pop_function,pop_rejmenuis not in_NEWSET_COMMIT_ACTIONSand unconditionally calls_store_current_from_gui, so rejecting epochs fromTools > Reject data epochs > Reject data (all methods)overwrites the current dataset without runningpop_newset(unlikepop_rejepochat line 233 andpop_eegplotat lines 1407 to 1410). - Suggested fix: When
pop_rejmenureturns with fewer trials thanselection(or withpop_rejepochin the command), commiteeg_outthroughself._commit_processed_dataset_from_gui(...)aspop_eegplotandpop_rejepochdo, keeping_store_current_from_gui(...)for mark updates that do not remove epochs.
- File:
Nits
- Packaged help resource
pop_rejmenu.mdstill describes removed controls- File:
eegprep/src/eegprep/resources/help/pop_rejmenu.md
Lines 14 to 17 in 0b050df
- Why it matters:
docs/source/api/preprocessing_and_artifacts.rstwas updated for the three actions, butsrc/eegprep/resources/help/pop_rejmenu.md(pophelp('pop_rejmenu')) still tells users to checkReject marked epochs when closingand clickCancel, both of which were removed in this PR. - Suggested fix: Update
src/eegprep/resources/help/pop_rejmenu.mdto describeClose (keep marks),Clear all marks, andReject marked trials.
- File:
Test gaps
tests/test_gui_rejection_dialogs.py(test_rejection_menu_final_actions)- File:
eegprep/tests/test_gui_rejection_dialogs.py
Lines 72 to 93 in 0b050df
- Add a case where
QMessageBox.questionreturnsStandardButton.NoonREJECT MARKED TRIALS, asserting the dialog remains open (result() != QDialog.Accepted) andrejectdoes not recordTrue. - Add cases for clicking
REJECT MARKED TRIALSwhen zero epochs are marked and throughMenuActionDispatcher.dispatch("pop_rejmenu:data").
- File:
EEGLAB parity notes
- Opening geometry, section weights,
Scroll Datalabels on the probability and kurtosis rows, popup menu strings, checkbox toggling onrejstatus == 3, and forcing all mark flags onREJECT MARKED TRIALSmatchfunctions/adminfunc/pop_rejmenu.m. The two behavioral parity gaps are the zero marked trial warning andpop_newsetcommit oncb_rejectnoted under Important.
Tests run in a detached worktree at 0b050dfa4982600cb266982ca48e42fc39cb52e2:
tests/test_gui_rejection_dialogs.py: 28 passed, 1 deselected.tests/test_rejection_workflows.py: 34 passed, 12 deselected.tests/test_gui_geometry.py,tests/test_guifunc_primitives.py,tests/test_package_help.py,tests/test_stream6_rejection_numbers.py,tests/test_stream11_help_errors.py: 196 passed, 56 skipped (Linux reference MATLAB geometry), 8 deselected.tests/test_gui_main_window.py(test_cancel_rejection_dialog_keeps_menus_history_and_dataset): hung indefinitely onpop_rejmenu:ica(canceled after 10 s).
Epoch rejection menu and its three actions · #1009, part of #875. Stack base PR #1046.
Across 2 native openings, maximum vertical control displacement was 0.81 px. The largest difference in overall width was 4.86 px. Of 3 output comparisons, 3 met tolerance. Applied the amplitude calculation used by the rejection menu followed by its eeg_rejsuperpose action on 80 real epochs, using the clean common base. Raw outputs, commands and checks are in tools-extra/numeric-inputs/.
The open window now has Close (keep marks), Clear all marks, and Reject marked trials, with confirmation before removal. Qt tests exercise all three and check that the buttons remain reachable on a short screen.
Clean Linux checkouts on jamming. EEGLAB
5e0be87059098662dc9b50fb378f9002b0ef173a, EEGPrep0b050dfa4982600cb266982ca48e42fc39cb52e2. Fixes #1009.Full inventory report for the project team. pop_rejmenu (p. 77). PDF · Editable Word.