-
-
Notifications
You must be signed in to change notification settings - Fork 11k
API: Make 64bit default integer on 64bit windows #24224
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
Merged
Merged
Changes from all commits
Commits
Show all changes
41 commits
Select commit
Hold shift + click to select a range
f1d1491
API: Make intp the default integer in NumPy core
seberg e3af907
API: Remove `int_` and `uint_` from Cython as they are misleading as …
seberg fbbecab
MAINT: Keep using `long` in for legacy random number generation
seberg 9b9325b
fixup cython
seberg 044e56e
fixup initial change
seberg 329d6bf
API: Add NPY_DEFAULT_INT which is runtime (unless NumPy >2 is forced)
seberg 4d13583
fixup initial (add/multiply reduction)
seberg 830c912
Fixup NPY_DEFAULT_INT definition (and version exposure)
seberg da9055e
ENH: Allow int64 explicitly in `ldexp`
seberg 1f942e3
TST: Adapt _ufunc_tests to use intp in ufuncs (default integer)
seberg e03e93e
API: rewire/rename np.int_ and np.uint scalars and add np.long/np.ulong
seberg 6402c8e
BUG: Fix (probably) legacy binomial and use `np.long` in random
seberg 59654aa
TST: Adapt some tests to ensure long use and test default int a bit
seberg 2a2600f
TST: Fix ufunc type resolution test for long (and a bit more)
seberg ab03464
TST: Fix legacy random test hashes to toggle on long (not default int)
seberg fc8ace2
TST: Remove duplicated test that needed adaption for default int change
seberg a901757
TST: Fix inplace_add ufunc test by using intp/default int
seberg ab675a3
TST: Adjust random test for long (not default int) return and branching
seberg 9532739
Use intp in np.random.binomial for inputs (core uses int64 always)
seberg a205087
BUG: Fix previously unused int64/uint64 in umath generation for cross…
seberg 8874e8e
BUG: Another random path that should probably keep using long
seberg 4a9f8a2
TST: One more small test fixup for changed default dtype
seberg 60bb095
BUG,API: like int32, intp must map to long if long and int are same size
seberg a2ceb3d
MAINT: Fix hypergeometric to use INT64, but raise if values surpass long
seberg cfe9960
Try with py_ssize_t (I am very unclear why float doesn't fail earlier)
seberg dd60409
Simply us Python `int()`...
seberg 3e38281
BUG: Ensure `randint` returns a Python integer by default
seberg 8f3fa96
Adjust type aliases after rebase
mtsokol 80308a7
Apply linting
mtsokol 960a4f0
TST: Fix random test for `dtype=int` being special cased in mtrand
seberg 9e69004
DOC: Rephrase now incorrect comment in mtrand.pyx
seberg 25b9d6c
TYP: Fixup typing for long changes
seberg 178966c
TST,BUG: Work around random bug in tests
seberg 83b5125
TST: Fix test due to changes on main
seberg a00fed5
TST: Fix randint test the right way
seberg b6df6cd
MAINT: Move Long-bound checks into helper
seberg 2cb3ab6
Update numpy/random/mtrand.pyx
seberg fe23665
DOC: Add release note and transition guide entry
seberg 6fbcd01
Fix typing and typo based on review
seberg b3bf8c3
TYP: Try fixing/working around windows ctypeslib mypy failures
seberg ba58f8b
Update doc/source/numpy_2_0_migration_guide.rst
seberg File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Default integer now 64bit on 64bit windows | ||
------------------------------------------ | ||
The default NumPy integer is now 64bit on all 64bit systems as the | ||
historic 32bit default on windows was a common source of issues. | ||
Most users should not notice this, the main issues may occur | ||
with code interfacing with libraries written in a compiled language | ||
like C. For more information see :ref:`migration_windows_int64`. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should define this in 1.26 too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might make it a bit easier to use for downstream, but they still will need to force
numpy>=1.26
at compile time. So I am tempted to say that unfortunately, it is better to vendor it:(unless you force
>2.0
at compile time)?Happy to follow-up with a backport, not sure it's helpful, but wouldn't hurt.