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

Part 3 PyO3 0.21 upgrade: Remove usage of deprecated numpy crate APIs #15666

Closed
Tracked by #15215
itamarst opened this issue Apr 15, 2024 · 3 comments · Fixed by #15668
Closed
Tracked by #15215

Part 3 PyO3 0.21 upgrade: Remove usage of deprecated numpy crate APIs #15666

itamarst opened this issue Apr 15, 2024 · 3 comments · Fixed by #15668
Labels
enhancement New feature or an improvement of an existing feature

Comments

@itamarst
Copy link
Contributor

Description

numpy has switched a number of APIs to use PyO3's new Bound<> API. We should use numpy's new replacement APIs instead of the deprecated ones.

Search for "#15215" to find places where deprecation is manually suppressed; there should be none left when this PR is merged.

@itamarst itamarst added the enhancement New feature or an improvement of an existing feature label Apr 15, 2024
@itamarst
Copy link
Contributor Author

itamarst commented Apr 15, 2024

Ah, looks like Ritchie did most of these already, so there's just one instance of numpy APIs left.

@itamarst itamarst changed the title Part 2 PyO3 0.21 upgrade: Remove usage of deprecated numpy crate APIs Part 3 PyO3 0.21 upgrade: Remove usage of deprecated numpy crate APIs Apr 15, 2024
@ritchie46
Copy link
Member

Yes, I think it would also be worth it to use the bounded API wherever we can. This can increase perf by 25% according to their benchmarks. So we should see if we can remove all GilRef API usages (even if not deprecated yet).

@itamarst
Copy link
Contributor Author

The other APIs are also deprecated, it's just the deprecation warnings are suppressed by the gil-refs feature in the pyo3 crate to make upgrades easier.

This issue is specifically about the numpy. Switching to Bound<> for pyo3 crate APIs is what I will start on next (i.e. next 5 minutes 😁).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or an improvement of an existing feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants