You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
pop_importevent (File > Import event info > From MATLAB array or ASCII file): graphical and numerical parity with EEGLAB #790
EEGPrep checks each EEGLAB function on its own, in one issue, for both the window and the numbers (Arno, November 26, 2026). This issue is pop_importevent, File menu: Import event info > From MATLAB array or ASCII file. It stays open until the window and the numbers are both acceptably close to EEGLAB's, even when a pull request is merged or closed.
Window: An invalid field name closes the form and loses the selected inputs. The example shows two fields for the three-column tutorial file.
Numbers: With lowercase field names, all 100 imported event types and latencies matched EEGLAB.
What remains: Keep the file and settings available for correction. Explain that the reserved fields latency and type must be lowercase and that names follow the file column order.
Repro on develop (aa81d9ab): On the tutorial recording, choose tutorial_eventtable.txt, enter Latency Type Position, skip one header line and click Ok.
Done when: Correct the same form to latency type position and import all 100 events with matching types and latencies. The failed submission and Cancel must leave EEG and history intact.
Add an offscreen GUI test: Ok with Latency Type Position keeps the form open with the file and settings; correcting to lowercase imports the events; one history entry
Wire pop_importevent_dialog_spec to the existing DialogSpec.validate hook so import errors show a warning and keep the dialog open
CI green (the Qt test only runs in CI; libEGL is missing locally)
Research
The dialog accepts any input; pop_importevent then raises the lowercase-keyword ValueError after the form has closed, so the menu shows an error and the user loses all inputs. DialogSpec.validate already keeps a dialog open on ValueError (used by pop_editset, pop_dipfit_settings).
Relevant code
src/eegprep/functions/popfunc/pop_importevent.py#L46-L55 - GUI result parsed after dialog closes
Move GUI-result parsing into _gui_options() and set validate= on the dialog spec to dry-run _import_event_records on the current values (file errors re-raised as ValueError). Error text now says that latency and type must be lowercase and that fields follow the file column order. Help and API docs updated.
Not changed: the dialog's field-name example (Ex: type latency duration). The vendored EEGLAB pop_importevent.m is not in this checkout, so I could not confirm EEGLAB's wording; a human should compare it with EEGLAB L160.
Activity
claude commentedon Nov 28, 2026
🤖 Plan:
Latency Type Positionkeeps the form open with the file and settings; correcting to lowercase imports the events; one history entrypop_importevent_dialog_specto the existingDialogSpec.validatehook so import errors show a warning and keep the dialog openPart of #790, since this issue stays open until parity is signed off)Research
The dialog accepts any input;
pop_importeventthen raises the lowercase-keywordValueErrorafter the form has closed, so the menu shows an error and the user loses all inputs.DialogSpec.validatealready keeps a dialog open onValueError(used bypop_editset,pop_dipfit_settings).Relevant code
src/eegprep/functions/popfunc/pop_importevent.py#L46-L55- GUI result parsed after dialog closessrc/eegprep/functions/popfunc/pop_importevent.py#L84-L93- lowercase keyword errorsrc/eegprep/functions/guifunc/qt.py#L1061-L1078-_accept_if_valid/spec.validateProposed Fix
Move GUI-result parsing into
_gui_options()and setvalidate=on the dialog spec to dry-run_import_event_recordson the current values (file errors re-raised asValueError). Error text now says thatlatencyandtypemust be lowercase and that fields follow the file column order. Help and API docs updated.Not changed: the dialog's field-name example (
Ex: type latency duration). The vendored EEGLABpop_importevent.mis not in this checkout, so I could not confirm EEGLAB's wording; a human should compare it with EEGLAB L160.arnodelorme commentedon Dec 1, 2026
🤖 New Linux layout finding for pop_importevent, with before and after captures and numerical verification, is tracked in #918 and PR #917.