Skip to content

fix: Windows and 32-bit Linux default to 32-bit integers in sums and prods UNLESS it's NumPy 2.0#3068

Merged
jpivarski merged 4 commits into
mainfrom
jpivarski/determine-Windows-dtype-from-NumPy
Apr 1, 2024
Merged

fix: Windows and 32-bit Linux default to 32-bit integers in sums and prods UNLESS it's NumPy 2.0#3068
jpivarski merged 4 commits into
mainfrom
jpivarski/determine-Windows-dtype-from-NumPy

Conversation

@jpivarski

Copy link
Copy Markdown
Member

Caught in this test: https://github.com/scikit-hep/awkward/actions/runs/8511994785/job/23312715586

Although we could check all platforms with

numpy._module.sum([given_dtype(0)]).dtype.type

I want to limit that to only the unusual platforms (Windows and 32-bit Linux) because the others are a quick lookup, and I don't want to slow down metadata-checking any more.

@jpivarski
jpivarski requested a review from tcawlfield April 1, 2024 19:37
@jpivarski

Copy link
Copy Markdown
Member Author

This is a good hint that we should test NumPy 2.0 on all platforms. NumPy used to have a 32-bit/64-bit split on Windows only, but now its dtypes are consistent across all platforms. However, that means that we need to be ready for it, too.

@tcawlfield tcawlfield left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jpivarski jpivarski changed the title fix: determine Windows dtype from NumPy, because it depends on NumPy 1.x vs 2.0 fix: Windows and 32-bit Linux default to 32-bit integers in sums and prods UNLESS it's NumPy 2.0 Apr 1, 2024
@jpivarski
jpivarski enabled auto-merge (squash) April 1, 2024 21:55
@jpivarski
jpivarski merged commit 567fe38 into main Apr 1, 2024
@jpivarski
jpivarski deleted the jpivarski/determine-Windows-dtype-from-NumPy branch April 1, 2024 21:57
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