Skip to content

Commit 17c4e03

Browse files
Fix eeglab loading issue while calling _get_montage_information due to scalar x,y,z in 'nodatchans' (#13395)
Co-authored-by: Eric Larson <[email protected]>
1 parent 4b6004a commit 17c4e03

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

doc/changes/dev/13395.bugfix.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix loading problems caused by attempting to iterate floats in :func:`~mne.read_epochs_eeglab` for specific EEGLab data, by :newcontrib:`Emrecan Çelik`.

doc/changes/names.inc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@
7676
.. _Eduard Ort: https://github.com/eort
7777
.. _Emily Stephen: https://github.com/emilyps14
7878
.. _Emma Bailey: https://www.cbs.mpg.de/employees/bailey
79+
.. _Emrecan Çelik: https://github.com/emrecncelik
7980
.. _Enrico Varano: https://github.com/enricovara/
8081
.. _Enzo Altamiranda: https://www.linkedin.com/in/enzoalt
8182
.. _Eric Larson: https://larsoner.com

mne/io/eeglab/eeglab.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -166,9 +166,9 @@ def _get_montage_information(eeg, get_pos, *, montage_units):
166166
nodatchans = eeg.chaninfo["nodatchans"]
167167
types = nodatchans.get("type", [])
168168
descriptions = nodatchans.get("description", [])
169-
xs = nodatchans.get("X", [])
170-
ys = nodatchans.get("Y", [])
171-
zs = nodatchans.get("Z", [])
169+
xs = np.atleast_1d(nodatchans.get("X", []))
170+
ys = np.atleast_1d(nodatchans.get("Y", []))
171+
zs = np.atleast_1d(nodatchans.get("Z", []))
172172

173173
for type_, description, x, y, z in zip(types, descriptions, xs, ys, zs):
174174
if type_ != "FID":

0 commit comments

Comments
 (0)