Repository navigation
[GUI] Move four Edit dialogs to EEGLAB's supergui layout - #884
Conversation
Select data, Event fields, Select epochs or events and Channel locations use EEGLAB's geometry and uilist with layout="supergui", and join the geometry suite. Button labels follow supergui.m (capital first letter), runs of spaces collapse as in MATLAB, and & shows as itself. Event fields hides the epoch field and both event dialogs label field buttons with the stored description. Channel locations edits urchan (1-based, as in EEGLAB) and datachan.
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 25s —— View job Code review
BlockingNone. Important
NitsNone. Test gaps
EEGLAB parity notes
I could not run tests in this job: the sandbox refused |
| if field == "urchan": | ||
| # urchan is 0-based in memory (pop_loadset.py) and 1-based in EEGLAB's window | ||
| urchan = chan.get("urchan", "") | ||
| return _display_value(urchan + 1 if isinstance(urchan, (int, float, np.integer, np.floating)) else urchan) |
There was a problem hiding this comment.
Important: after "Look up locs" the window shows urchan one too high.
This +1 assumes urchan is stored counting from 0 (pop_loadset, pop_loadbv, pop_saveset). But _lookup_chanlocs stores it counting from 1 (
eegprep/src/eegprep/functions/popfunc/pop_chanedit.py
Lines 852 to 854 in 86a8465
tests/test_eeglab_execmenu.py:199 asserts urchan == 1 for channel 1 after a lookup. So if you click Look up locs, or let the dialog's automatic lookup prompt run, the window re-renders with channel 1 showing 2. A saved dataset then writes 2 to the .set file. The saving part was already wrong before this PR. What this PR adds is that the wrong value now shows in the window.
Suggested fix: in _lookup_chanlocs, set "urchan": index so that all stored values count from 0. Update test_eeglab_execmenu.py:199 to expect 0. Then add a test where a lookup is followed by pop_chanedit_dialog_spec, and check that field_urchan == "1" for channel 1.
There was a problem hiding this comment.
🤖 Fixed in a61e965: _lookup_chanlocs now stores urchan from 0, test_eeglab_execmenu.py expects 0, and test_pop_chanedit_lookup_keeps_urchan_zero_based runs a lookup then checks the window shows 1 for channel 1 (it failed with [1, 2] before the fix). The EEGLAB reference workflow is running again on this head.
Look up locs stored urchan from 1 while memory counts it from 0, so the window showed 2 for channel 1 and pop_saveset wrote 2. Found in the review of this pull request.
Four Edit menu dialogs now open with the rows, row heights and controls EEGLAB gives them: Select data (
pop_select), Event fields (pop_editeventfield), Select epochs or events (pop_selectevent) and Channel locations (pop_chanedit). Each copies EEGLAB's geometry and control list unchanged and useslayout="supergui"from #878; the four join the geometry test suite. On Linux each window has MATLAB's height and every control sits within 0.7 pixel of MATLAB's row.pop_selectpop_editeventfieldpop_selecteventpop_chaneditDrawn on jamming on November 29, 2026 with the epoched sample, from EEGLAB develop
5e0be870, EEGPrep developcea86f8f(before) and this branch (after). Widths differ because Qt measures text slightly differently from MATLAB, as in #878. One difference stays on purpose: EEGPrep's buttons keep their grey Qt colour (EEGLAB's are light blue), which this change does not touch.Fixes #821
What changes besides the layout
supergui.m(lines 387-394) gives every button label a capital first letter and lower case after it;button_textinguifunc/supergui.pyports that rule, and the supergui renderer applies it. MATLAB R2025b draws a label as HTML, which collapses runs of spaces, so the renderer does too, and it writes&as&&so Qt shows it (Xyz -> polar & sph.showed asXyz -> polar _sph.). Only dialogs withlayout="supergui"are affected.epochfield is no longer listed, as inpop_editeventfield.mlines 130-133. The description buttons carry the stored first row of each description, as EEGLAB's do.pop_selectevent.m; the field buttons show the stored description (no descriptionwhen there is none) instead of the field name.urchanis an edit box counted from 1, as in EEGLAB: it showed the 0-based value kept in memory. Achangefieldonurchan(from the window or a script) now converts EEGLAB's 1-based index to the 0-based memory value, and the datachan checkbox can be changed, as in EEGLAB. Numbers show as MATLAB'snum2strwrites them (84.9812, not84.981;0, not-0).Tests
tests/test_gui_geometry.py: the four dialogs have the geometry and controls EEGLAB passes toinputgui(cases recorded from EEGLAB develop withrecord_geometry.m), the port returns MATLAB's positions given MATLAB's text extents, and on Linux the drawn dialogs have MATLAB's rows and aligned edit boxes. One value differs on purpose:pop_chanedit.mline 347 tests a field namedurchans, which never exists, so EEGLAB starts with an emptyurchanbox; EEGPrep shows the index.button_textis tested against the cases ofsupergui.m.test_pop_chanedit_shows_and_edits_urchan_one_basedfails on develop (the window showed0) and passes here.tests/test_gui_geometry.pyon jamming: 51 passed.test_pop_chanedit_lookup_keeps_urchan_zero_based: Look up locs storedurchanfrom 1 while memory counts it from 0, so the window showed 2 for channel 1 andpop_savesetwrote 2 (found in review, fixed in a61e965; it failed with [1, 2] before).EEGLAB reference run
Workflow
eeglab-reference.yml(EEGLAB reference,workflow_dispatch) on this branch ata61e9650: https://github.com/sccn/eegprep/actions/runs/46314097404. EEGLABd0963be9and eeglab_testsfec88f9f(the commits pinned intests/eeglab_tests/__init__.py), real MATLAB backend through matlab-batch. All seven shards passed: 4,671 passed, 58 skipped, 0 failed, 24 minutes from start to end. Of the skips listed by reason, 35 are heavy reference tests that run only with--run-heavy-reference; the others need the AMICA binary, a Windows drive, a named host, or the neuroscanio, ERPSS and openbdf plugins, none of which this change touches. The only later commit,4722da2e, changes the changelog alone.