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_mneio: import recordings with both EEG and EOG without changing trigger units #839
🤖 A FIF containing EEG, EOG and a stimulus channel raises ValueError in the existing converter when it passes one voltage unit to every channel type. The regression uses 5 μV on both voltage channels and code 3 on the trigger channel. The expected values are 5, 5 and 3. This affects other MNE paths that share the converter. The fix is included with #813.
Earlier issue: #735, pop_mneio, formerly pop_biosig (File > Import data > BDF, EDF and MNE-IO interface): graphical and numerical parity with EEGLAB
Reproduced on develop (b9ad81c, MNE 1.12.1): a RawArray with eeg, eog, stim channels passed to mne_raw_to_eeg raises ValueError: "units" cannot be str if there is more than one channel type with a unit ['eeg', 'eog']. Root cause: raw.get_data(units="uV") uses one string unit for all channel types; the except TypeError fallback never catches this ValueError. The same function also labels every channel EEG.
The fix is already on branch agent/issue-813 (commit db5cff9, no PR open yet). It passes a per-type dict, units={kind: "uV" for kind in voltage_types ∩ channel_types}, so non-voltage channels such as stim keep their native values. It also sets chanloc type from the MNE channel type. That matches the issue note that the fix ships with #813, so I did not open a second PR that would conflict with it. If #813 will take a while, the mne_raw_to_eeg part of that commit (about 6 lines plus the regression test) can be cherry-picked into its own PR.
Separate finding, not covered by that branch: eeg_mne2eeg (exports through mne.export and eeglabio) scales every channel by 1e6. The same recording comes back as [5, 5, 3e6] instead of [5, 5, 3] (src/eegprep/functions/miscfunc/eeg_mne2eeg.py#L89-L96). It probably deserves its own issue.
Activity
claude commentedon Nov 29, 2026
🤖 Plan:
developResearch
Reproduced on
develop(b9ad81c, MNE 1.12.1): a RawArray witheeg,eog,stimchannels passed tomne_raw_to_eegraisesValueError: "units" cannot be str if there is more than one channel type with a unit ['eeg', 'eog']. Root cause:raw.get_data(units="uV")uses one string unit for all channel types; theexcept TypeErrorfallback never catches this ValueError. The same function also labels every channelEEG.Relevant code
src/eegprep/functions/popfunc/_file_io.py#L262-L267- single-stringunitssrc/eegprep/functions/popfunc/pop_fileio.py#L156,#L190- affected callerssrc/eegprep/functions/popfunc/pop_mffimport.py#L79- affected callerProposed Fix
The fix is already on branch
agent/issue-813(commit db5cff9, no PR open yet). It passes a per-type dict,units={kind: "uV" for kind in voltage_types ∩ channel_types}, so non-voltage channels such asstimkeep their native values. It also sets chanloctypefrom the MNE channel type. That matches the issue note that the fix ships with #813, so I did not open a second PR that would conflict with it. If #813 will take a while, themne_raw_to_eegpart of that commit (about 6 lines plus the regression test) can be cherry-picked into its own PR.Separate finding, not covered by that branch:
eeg_mne2eeg(exports throughmne.exportand eeglabio) scales every channel by 1e6. The same recording comes back as[5, 5, 3e6]instead of[5, 5, 3](src/eegprep/functions/miscfunc/eeg_mne2eeg.py#L89-L96). It probably deserves its own issue.