Skip to content

Commit

Permalink
Backport PR #12909 on branch maint/1.8 (Fix GDF NumPy >= 2) (#12915)
Browse files Browse the repository at this point in the history
Co-authored-by: Clemens Brunner <[email protected]>
  • Loading branch information
meeseeksmachine and cbrnr authored Oct 23, 2024
1 parent ac2c4c0 commit 92cf6f2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions doc/changes/devel/12909.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix bug in :func:`mne.io.read_raw_gdf` when NumPy >= 2 is used, by `Clemens Brunner`_.
2 changes: 1 addition & 1 deletion mne/io/edf/edf.py
Original file line number Diff line number Diff line change
Expand Up @@ -1442,7 +1442,7 @@ def _read_gdf_header(fname, exclude, include=None):
ne = np.fromfile(fid, UINT8, 3)
n_events = ne[0]
for i in range(1, len(ne)):
n_events = n_events + ne[i] * 2 ** (i * 8)
n_events = n_events + int(ne[i]) * 2 ** (i * 8)
event_sr = np.fromfile(fid, FLOAT32, 1)[0]

pos = np.fromfile(fid, UINT32, n_events) - 1 # 1-based inds
Expand Down

0 comments on commit 92cf6f2

Please sign in to comment.