Skip to content

Commit e899f3e

Browse files
authored
Merge pull request #1962 from h-mayorquin/fix_blackrock_bug
BlackrockRawIO: align the `.nev` spike dtype to avoid a segfault on numpy 2.0 and 2.1
2 parents 57f8d78 + e5242bb commit e899f3e

1 file changed

Lines changed: 9 additions & 6 deletions

File tree

‎neo/rawio/blackrockrawio.py‎

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2021,12 +2021,15 @@ def _read_nev_data(self, spec, filename):
20212021
position_dtype = "uint32" if n_packets <= 2**32 else "uint64"
20222022
spikes = np.empty(
20232023
positions.size,
2024-
dtype=[
2025-
("timestamp", ts_format),
2026-
("packet_id", "uint16"),
2027-
("unit_class_nb", "uint8"),
2028-
("position", position_dtype),
2029-
],
2024+
dtype=np.dtype(
2025+
[
2026+
("timestamp", ts_format),
2027+
("packet_id", "uint16"),
2028+
("unit_class_nb", "uint8"),
2029+
("position", position_dtype),
2030+
],
2031+
align=True,
2032+
),
20302033
)
20312034
for field in ("timestamp", "packet_id", "unit_class_nb"):
20322035
spikes[field] = packets[field][positions]

0 commit comments

Comments
 (0)