Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with mne.io.read_raw_eeglab in EEGLAB File Loading #13094

Closed
balandongiv opened this issue Feb 2, 2025 · 0 comments · Fixed by #13097
Closed

Issue with mne.io.read_raw_eeglab in EEGLAB File Loading #13094

balandongiv opened this issue Feb 2, 2025 · 0 comments · Fixed by #13097
Labels
Milestone

Comments

@balandongiv
Copy link

balandongiv commented Feb 2, 2025

Description of the problem

When using mne version 1.9.0 to load an EEGLAB .set file with mne.io.read_raw_eeglab, a KeyError: 'nodatchans' error may occur.

Steps to reproduce

Below is the code snippet that triggers the error:

import mne

file_path = "s01_061102n.set"
raw = mne.io.read_raw_eeglab(file_path, preload=True)

Below is the full error trace

Traceback (most recent call last):
  File "main.py", line 8, in <module>
    raw = mne.io.read_raw_eeglab(file_path, preload=True)
  File "...\site-packages\mne\io\eeglab\eeglab.py", line 328, in read_raw_eeglab
    return RawEEGLAB(
  File "<decorator-gen-267>", line 12, in __init__
  File "...\site-packages\mne\io\eeglab\eeglab.py", line 459, in __init__
    info, eeg_montage, _ = _get_info(eeg, eog=eog, montage_units=montage_units)
  File "...\site-packages\mne\io\eeglab\eeglab.py", line 230, in _get_info
    ch_names, ch_types, eeg_montage = _get_montage_information(
  File "...\site-packages\mne\io\eeglab\eeglab.py", line 165, in _get_montage_information
    if hasattr(eeg, "chaninfo") and isinstance(eeg.chaninfo["nodatchans"], dict):
KeyError: 'nodatchans'

Process finished with exit code 1

The output for mne.sys_info()

 + mne               1.9.0 (latest release)
 + numpy             2.2.1 (OpenBLAS 0.3.28 with 24 threads)
 + scipy             1.15.1
 + matplotlib        3.10.0 (backend=tkagg)

Numerical (optional)
 + sklearn           1.6.1
 + pandas            2.2.3
 - unavailable       numba, nibabel, nilearn, dipy, openmeeg, cupy, h5io, h5py

Visualization (optional)
 - unavailable       pyvista, pyvistaqt, vtk, qtpy, ipympl, pyqtgraph, mne-qt-browser, ipywidgets, trame_client, trame_server, trame_vtk, trame_vuetify

Ecosystem (optional)
 - unavailable       mne-bids, mne-nirs, mne-features, mne-connectivity, mne-icalabel, mne-bids-pipeline, neo, eeglabio, edfio, mffpy, pybv
None

Link to data

The file used to reproduce this issue can be downloaded from figshare.

Expected results

no error

Actual results

no error

Additional information

This issue has been highlighted at mne discourse

@balandongiv balandongiv added the BUG label Feb 2, 2025
@larsoner larsoner added this to the 1.10 milestone Feb 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants