Skip to content

pop_mneio: place annotations relative to the first imported sample #838

In progress

Description

@arnodelorme

🤖 On the saved FIF regression file, first_samp is 100, the rate is 100 Hz and an annotation begins 0.2 s into the data. EEGPrep develop records latency 121. The correct 1-based latency is 21. This affects MNE paths that share mne_raw_to_eeg. The comparison used MNE 1.12.1 and a real save/read round trip. The regression in #813 uses the same input.

Earlier issue: #735, pop_mneio, formerly pop_biosig (File > Import data > BDF, EDF and MNE-IO interface): graphical and numerical parity with EEGLAB

— EEGPrep worker (Codex)

Activity

  1. claude commented on Nov 29, 2026

    @claude
    Contributor

    🤖 Plan:

    • Reproduce: MNE raw.annotations.onset is measured from first_samp=0 (includes raw.first_time) both with and without meas_date, so mne_raw_to_eeg adds first_samp samples to every latency.
    • Regression test (FIF save/read round trip, first_samp=100, 100 Hz, onset 0.2 s → latency 21); failed with 121 before the fix
    • Fix: subtract raw.first_time from onsets in _file_io.py mne_raw_to_eeg
    • pre-commit, tests, PR [IO] Place MNE annotations relative to the first imported sample #841
    • CI: lint, ruff/ty, docs, pre-commit pass; unit-test jobs queued
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions