1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
|
Description: fix for numpy 2.0.
test_open_dat fails with numpy 2.0 and beyond with the following error:
.
# Make a 32 bit array
data = np.uint32(data16)
> data[occ] = data16[occ + 1] + data16[occ + 2] * 65536
E OverflowError: Python integer 65536 out of bounds for uint16
.
This change uses the freshly converted data array to uint32 for the
data concatenation instead of using the uint16 data16 array elements.
Author: Étienne Mollier <emollier@debian.org>
Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1095368
Forwarded: https://github.com/FCS-analysis/PyScanFCS/pull/19
Last-Update: 2025-02-08
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- pyscanfcs.orig/pyscanfcs/openfile.py
+++ pyscanfcs/pyscanfcs/openfile.py
@@ -95,7 +95,7 @@
# Make a 32 bit array
data = np.uint32(data16)
- data[occ] = data16[occ + 1] + data16[occ + 2] * 65536
+ data[occ] = data[occ + 1] + data[occ + 2] * 65536
if callback is not None:
ret = callback(**cb_kwargs)
|