From 4d339681999b85c9f63690d9aae1e2b37fcee034 Mon Sep 17 00:00:00 2001 From: Eric Larson Date: Sat, 2 Mar 2024 08:35:55 -0500 Subject: [PATCH] FIX: Try explicit copy --- mne/_fiff/tag.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/mne/_fiff/tag.py b/mne/_fiff/tag.py index e1ae5ae571a..145748f840a 100644 --- a/mne/_fiff/tag.py +++ b/mne/_fiff/tag.py @@ -202,8 +202,9 @@ def _read_matrix(fid, tag, shape, rlims): if matrix_coding == "sparse CCS": tmp_indices = fid.read(4 * nnz) indices = np.frombuffer(tmp_indices, dtype=">i4") + indices = np.array(indices, int) tmp_ptr = fid.read(4 * (ncol + 1)) - indptr = np.frombuffer(tmp_ptr, dtype=">i4") + indptr = np.array(np.frombuffer(tmp_ptr, dtype=">i4")) if indptr[-1] > len(indices) or np.any(indptr < 0): # There was a bug in MNE-C that caused some data to be # stored without byte swapping @@ -214,11 +215,12 @@ def _read_matrix(fid, tag, shape, rlims): ) ) indptr = np.frombuffer(tmp_ptr, dtype=" len(indices) or np.any(indptr < 0): @@ -231,6 +233,7 @@ def _read_matrix(fid, tag, shape, rlims): ) ) indptr = np.frombuffer(tmp_ptr, dtype="