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

Add support for Numpy 2.x (take 2) #442

Merged
merged 22 commits into from
Oct 4, 2024
Merged
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
39f0b6c
Add feature flags for numpy 1 and 2
aMarcireau Jun 3, 2024
3b6c0b7
Remove outdated 1.0 functions, add new 2.0 functions
aMarcireau Jun 3, 2024
c2e55f8
Use the new "universal" access functions
aMarcireau Jun 3, 2024
e060735
Fix runtime tests
aMarcireau Jun 4, 2024
31924fb
Remove feature flags and always check the version at runtime where ap…
aMarcireau Jun 7, 2024
7f59548
Avoid API changes by using self.py()
aMarcireau Jun 8, 2024
9d7e0a2
Fixup
aMarcireau Jun 8, 2024
3777299
Fix flags for Windows
aMarcireau Jul 8, 2024
c89932b
Avoid half-open range patterns to appease our MSRV build.
adamreichold Jul 21, 2024
92b0947
Remove residual numpy-1/2 feature usage.
adamreichold Jul 21, 2024
9de97ba
Use explicit patterns so exhaustiveness checking works, but avoid ope…
adamreichold Jul 21, 2024
be3ce9b
Add ci job to test numpy2 and allow numpy2 in examples
maffoo Aug 31, 2024
1a93b96
Make size and buf fields public in npy_static_string
maffoo Aug 31, 2024
2882c6a
Fixes from @adamreichold review
maffoo Aug 31, 2024
61fb9e0
Simplify impl_api macro
maffoo Aug 31, 2024
17eda7f
lint
maffoo Sep 3, 2024
abebd0f
Fixes from review
maffoo Sep 20, 2024
da0807f
Apply suggestions from code review
davidhewitt Sep 23, 2024
6013343
Fix dtypes tests to work with numpy 1 or 2
maffoo Sep 23, 2024
5dd5280
Rename to _PyArray_DescrNumPy2 and _PyArray_LegacyDescr to match c code
maffoo Oct 3, 2024
4322102
Fail compilation on 32-bit windows
maffoo Oct 3, 2024
d09a35d
Add a changelog entry
maffoo Oct 3, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Add feature flags for numpy 1 and 2
By default, the extension is compile with support for numpy 1 and 2 (with runtime checks to pick the right binary offset where needed). Features or fields that are specific to a version are hidden by default. Users can opt-out of numpy 1 + numpy 2 by disabling default features and selecting a version. The library panics if the runtime version does not match the compilation version if only one version is selected.
  • Loading branch information
aMarcireau authored and maffoo committed Aug 31, 2024
commit 39f0b6c45f6a67674dda1795ac27aba95451309f
5 changes: 5 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -31,3 +31,8 @@ nalgebra = { version = "0.32", default-features = false, features = ["std"] }

[package.metadata.docs.rs]
all-features = true

[features]
default = ["numpy-1", "numpy-2"]
numpy-1 = []
numpy-2 = []