Repository navigation
[GUI] Move pop_editeventvals to EEGLAB's supergui layout - #885
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.
Event values uses EEGLAB's geometry and uilist with layout="supergui" and joins the geometry suite: the empty row above Event Num, EEGLAB's field button text (latency (ms) or (sec)), and the originally N line when urevent is not the event number, updated while browsing events.
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 17s —— View job Code review
BlockingNone. ImportantNone. Nits
Test gaps
EEGLAB parity notes
Checked for correctness bugs, EEGLAB parity, data structure compatibility, changed-behavior tests, and CLAUDE.md/AGENTS.md compliance. |
| def _original_text(event: Mapping[str, Any], number: int) -> str: | ||
| # pop_editeventvals.m lines 199-204: the urevent index when it is not the event number; | ||
| # memory keeps urevent 0-based (pop_loadset.py) | ||
| urevent = event.get("urevent") | ||
| if isinstance(urevent, (int, float, np.integer, np.floating)) and np.isfinite(urevent) and urevent + 1 != number: | ||
| return f"originally {int(urevent) + 1}" | ||
| return " " |
There was a problem hiding this comment.
Nit (EEGLAB parity): the originally N text is worked out once, against each event's position when the dialog opens, and then travels with that event's row in field_displays. Once Delete, Insert or Append moves events to new positions, the stored text no longer matches EEGLAB.
EEGLAB recomputes it on every goto against the event's current position (pop_editeventvals.m, % update original block: EEG.event(valnum).urevent ~= valnum). Example: delete event 3 of 10, where every urevent equals its number. In EEGLAB, the event now at position 3 (urevent 4) shows originally 4. Here it stays blank, because its text was " " when the dialog opened at position 4. An inserted row also gets "" where EEGLAB shows originally <urvalnum>.
Suggested fix: keep the raw 1-based urevent in the row (for example "urevent": int(urevent) + 1), not the finished string, and have _edit_event_structure/_navigate_indexed_form build the label from the row's current index. If you'd rather not touch qt.py in this PR, record it as a known difference in known_differences so the limitation is written down.
eegprep/src/eegprep/functions/popfunc/pop_editeventvals.py
Lines 355 to 363 in 90a9906
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.
Found in the review of this pull request: the line is not worked out again after Delete, Insert or Append.
Event values (
pop_editeventvals) now opens with the rows, row heights and controls EEGLAB gives it: it copies EEGLAB's geometry and control list and useslayout="supergui"from #878, and it joins the geometry test suite. On Linux the window has MATLAB's height (326 pixels, against 396 on develop) and every control sits within 0.4 pixel of MATLAB's row. This pull request is stacked on #884 (it needs that branch's button label rule): merge #884 first.pop_editeventvalsDrawn on jamming on November 29, 2026 with the epoched sample, from EEGLAB develop
5e0be870, EEGPrep developcea86f8f(before) and this branch (after). The EEGLAB panel is drawn from the argumentspop_editeventvals.mpasses toinputgui; EEGLAB fills the four value boxes right after, withpop_editeventvals('goto', 0), so they are empty in that panel only.Fixes #823
Fixes #859
What changes
latency (ms)on epoched data,latency (sec)on continuous data, the field name otherwise), which the supergui layout writesLatency (ms),Type,Epochassupergui.mdoes.originalline showsoriginally Nwhen the event'sureventis not its number (pop_editeventvals.mlines 199-204), and it follows the event shown while browsing. Memory keepsurevent0-based, so N is the 0-based value plus 1.Tests
tests/test_gui_geometry.py:pop_editeventvalshas the geometry and controls EEGLAB passes toinputgui(case recorded from EEGLAB develop), the port returns MATLAB's positions, and on Linux the drawn dialog has MATLAB's rows. The four value boxes are left out of the value comparison because EEGLAB fills them afterinputguireturns.test_field_buttons_and_values_share_columns_with_a_long_field_name(pop_editeventvals: keep field buttons aligned under Windows and with longer event names #859): with a long custom field name, all field buttons share one left edge and width, and so do all value boxes; the latency button readsLatency (ms). It runs on every CI platform, Windows included.tests/test_gui_geometry.pyon jamming: 54 passed. Tests that touchpop_editeventvals, the supergui layout or the Qt renderer: 618 passed.