Skip to content

pop_importevent (File > Import event info > From MATLAB array or ASCII file): graphical and numerical parity with EEGLAB #790

Backlog
1 of 1 issue completed

Description

@suraj-ranganath

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.

Findings of the report for this function

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.

Files

Sub-issues

Sub-issues

1 of 1 Issues completed
Loading 1 sub-issues

Activity

  1. added
    function-parity
    on Nov 28, 2026
  2. claude commented on Nov 28, 2026

    @claude
    Contributor

    🤖 Plan:

    • 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
    • Pre-commit, tests, PR [GUI] Keep pop_importevent dialog open on import errors #801 (Part of #790, since this issue stays open until parity is signed off)
    • 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
    • src/eegprep/functions/popfunc/pop_importevent.py#L84-L93 - lowercase keyword error
    • src/eegprep/functions/guifunc/qt.py#L1061-L1078 - _accept_if_valid / spec.validate

    Proposed Fix

    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.

  3. arnodelorme commented on Dec 1, 2026

    @arnodelorme
    Collaborator

    🤖 New Linux layout finding for pop_importevent, with before and after captures and numerical verification, is tracked in #918 and PR #917.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    function-parity

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions