Skip to content

pop_importbids (File > Import data > From BIDS folder structure): graphical and numerical parity with EEGLAB #742

Backlog
1 of 1 issue completed

Description

@arnodelorme

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_importbids, File menu: Import data > From BIDS folder structure, BIDS tools > Import BIDS folder to STUDY. 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.

Graphics

The import window (issue 707): EEGLAB, EEGPrep before, EEGPrep after.

707

Captured on jamming under a virtual screen (EEGLAB with getframe, EEGPrep with the Qt widget grab), and on the Mac where said.

The window: what differs from EEGLAB
  • EEGPrep imports BIDS with its own code. Only the window is made to look like EEGLAB's (rule 2).
  • The BIDS export wizard is ignored for now (rule 4).
The numbers: same file in both programs
  • Not tested: the File menu report did not compare a dataset imported from BIDS by both programs.
Files

Sub-issues

Sub-issues

1 of 1 Issues completed
Loading 1 sub-issues

Activity

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

    @claude
    Contributor

    🤖 Plan:

    No PR from me. This is a tracking issue. What remains is a human merge plus a comparison that needs MATLAB and the eeglab_tests checkout, and neither is available to this agent.

    Research

    A MATLAB comparison already exists, but it calls pop_load_frombids on one .set file. It does not call EEGPrep's pop_importbids on the BIDS folder. So the folder path is not compared: the subject query, bids_list_eeg_files, the derivative save, and std_checkset. The MATLAB side also runs with bidschanloc off, and the Python side infers locations, so channel locations are never compared.

    Relevant code

    Proposed Fix

    1. In test_load_frombids_matches_matlab_pop_importbids, replace the Python side with pop_importbids(bids_root, subjects=[subject], outputdir=tmp_path/"py"/subject, bidsevent="on", bidschanloc="off", eventtype="value"). Pick the _run-1_ dataset from the returned ALLEEG, the same way the MATLAB helper does. Keep the existing checks: data is exact, and event type, latency and duration stay within EVENT_ATOL.
    2. Save {EEG.chanlocs.labels} in _matlab_import_run1 and assert that the channel labels match. Comparing coordinates needs bidschanloc on on both sides, so that should be a separate decision.
    3. Run it once with the real MATLAB backend (eeglab-reference.yml, or uv run --no-sync pytest tests/test_ds003061_stage_parity.py --eeglab-backend=matlab ...) and post the counts here. That run is the "numbers" evidence this issue asks for.

    Open question: should the comparison include channel coordinates (bidschanloc on), or only data, events and labels?

  3. arnodelorme commented on Dec 1, 2026

    @arnodelorme
    CollaboratorAuthor

    🤖 The new pop_importbids layout finding is tracked in #992. PR #991 includes the actual MATLAB and Qt captures and the same-input numerical comparison.

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