From ca9e580c4ff2ffc69c0a1ae368c66e31dc556a64 Mon Sep 17 00:00:00 2001 From: Ben Beasley Date: Thu, 18 Jul 2024 03:08:00 -0400 Subject: [PATCH] Fix reading numeric array data on big-endian hosts (#98) * Fix reading numeric array data on big-endian hosts * Add changelog entry for PR#98 --- CHANGELOG.md | 2 ++ pyxdf/pyxdf.py | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3bff8de..7240dd5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,6 @@ ## [UNRELEASED] - YYYY-MM-DD +### Fixed +- Fix reading numeric array data on big-endian hosts ([#98](https://github.com/xdf-modules/pyxdf/pull/98) by [Ben Beasley](https://github.com/musicinmybrain)) ## [1.16.7] - 2024-07-17 ### Added diff --git a/pyxdf/pyxdf.py b/pyxdf/pyxdf.py index e64bbd3..c581f61 100644 --- a/pyxdf/pyxdf.py +++ b/pyxdf/pyxdf.py @@ -468,7 +468,9 @@ def _read_chunk3(f, s): f.readinto(raw) # no fromfile(), see # https://github.com/numpy/numpy/issues/13319 - values[k, :] = np.frombuffer(raw, dtype=s.dtype, count=s.nchns) + values[k, :] = np.frombuffer( + raw, dtype=s.dtype.newbyteorder("<"), count=s.nchns + ) return nsamples, stamps, values