From e5242bb734718161d21f5ebf52c7a635534f87b3 Mon Sep 17 00:00:00 2001 From: Heberto Mayorquin Date: Sun, 8 Nov 2026 21:54:26 -0600 Subject: [PATCH] Align the nev spike table dtype to avoid a segfault on numpy 2.0 and 2.1 --- neo/rawio/blackrockrawio.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/neo/rawio/blackrockrawio.py b/neo/rawio/blackrockrawio.py index 3c3cffea4..918297373 100644 --- a/neo/rawio/blackrockrawio.py +++ b/neo/rawio/blackrockrawio.py @@ -2021,12 +2021,15 @@ def _read_nev_data(self, spec, filename): position_dtype = "uint32" if n_packets <= 2**32 else "uint64" spikes = np.empty( positions.size, - dtype=[ - ("timestamp", ts_format), - ("packet_id", "uint16"), - ("unit_class_nb", "uint8"), - ("position", position_dtype), - ], + dtype=np.dtype( + [ + ("timestamp", ts_format), + ("packet_id", "uint16"), + ("unit_class_nb", "uint8"), + ("position", position_dtype), + ], + align=True, + ), ) for field in ("timestamp", "packet_id", "unit_class_nb"): spikes[field] = packets[field][positions]