Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pyscanfcs/openfile.py: fix for numpy 2.0. #19

Merged
merged 1 commit into from
Feb 9, 2025

Conversation

emollier
Copy link
Contributor

@emollier emollier commented Feb 8, 2025

As initially identified in Debian bug #1095368, 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.

As initially identified in [Debian bug #1095368], 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.

[Debian bug #1095368]: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1095368
@paulmueller paulmueller merged commit fd36e54 into FCS-analysis:master Feb 9, 2025
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants