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

MAINT: more NumPy API shims #19141

Merged
merged 1 commit into from Aug 27, 2023
Merged

Conversation

tylerjereddy
Copy link
Contributor

@tylerjereddy tylerjereddy commented Aug 26, 2023

[skip circle]

@tylerjereddy tylerjereddy added the maintenance Items related to regular maintenance tasks label Aug 26, 2023
@tylerjereddy tylerjereddy added this to the 1.12.0 milestone Aug 26, 2023
@andyfaff
Copy link
Contributor

I was going to add an array-api helper function that would do something like asfarray today. I think some of these casts are slightly incorrect. asfarray converts to a floating point type. If the existing type is already floating point type it doesn't do anything. The replacement here will convert float32 to float64, which we don't want. The helper function would find a few uses in optimize, it doesn't need to be public, unless we want it to.

@tylerjereddy
Copy link
Contributor Author

Alright, sounds good, the testsuite isn't sensitive to the type width preservation, so we may want 1 or 2 checks for that if it is important then.

* to keep up with NumPy `2.0` related changes:
numpy/numpy#24376

* this cuts us down to 36 failures, 128 errors
vs. 48 and 129, respectively, on `main`

[skip circle]
@tylerjereddy
Copy link
Contributor Author

I revised this PR to back out the asfarray shims--I don't think it is sane for me to work on adjustments that the testsuite is not sensitive to.

The remaining changes here provide the improvements described in the revised original comment, and should directly match suggested substitutions at: https://numpy.org/devdocs/release/2.0.0-notes.html#numpy-2-0-python-api-removals

@tylerjereddy tylerjereddy changed the title WIP, MAINT: more NumPy API shims MAINT: more NumPy API shims Aug 26, 2023
@andyfaff
Copy link
Contributor

Do you still have the asfarray shims around?

I was going to add a helper function to act as an internal replacement, but I'd like to know how you dealt with removal of the function from __all__.

@andyfaff
Copy link
Contributor

This looks ok to me. Going to merge in an attempt to get CI unstuck.

@andyfaff andyfaff merged commit 8bb5e31 into scipy:main Aug 27, 2023
22 of 24 checks passed
@tylerjereddy tylerjereddy deleted the treddy_numpy_api_shims branch August 27, 2023 14:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance Items related to regular maintenance tasks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants