Skip to content

Commit 9e7fe95

Browse files
cbrnrlarsoner
andauthored
Fix EEGLAB import (nodatchans) (mne-tools#13097)
Co-authored-by: Eric Larson <larson.eric.d@gmail.com>
1 parent 715540a commit 9e7fe95

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

doc/changes/devel/13097.bugfix.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix bug when loading certain EEGLAB files that do not contain a ``nodatchans`` field, by `Clemens Brunner`_.

mne/io/eeglab/eeglab.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ def _get_montage_information(eeg, get_pos, *, montage_units):
162162
)
163163

164164
lpa, rpa, nasion = None, None, None
165-
if hasattr(eeg, "chaninfo") and isinstance(eeg.chaninfo["nodatchans"], dict):
165+
if hasattr(eeg, "chaninfo") and isinstance(eeg.chaninfo.get("nodatchans"), dict):
166166
nodatchans = eeg.chaninfo["nodatchans"]
167167
types = nodatchans.get("type", [])
168168
descriptions = nodatchans.get("description", [])

0 commit comments

Comments
 (0)