Skip to content

TST: NumPy 1.x support #169

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 2 commits into from
Mar 19, 2025
Merged

TST: NumPy 1.x support #169

merged 2 commits into from
Mar 19, 2025

Conversation

crusaderky
Copy link
Contributor

@crusaderky crusaderky commented Mar 19, 2025

Out of scope: we need to start a conversation about how array-api-compat, array-api-extra, and scipy are going to support obsolete versions of backends other than NumPy.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
@lucascolley lucascolley linked an issue Mar 19, 2025 that may be closed by this pull request
Comment on lines +568 to +571
# Don't rely on OverflowError, as it is not guaranteed by the Array API.
nrtol = int(1.0 / rtol)
if nrtol > xp.iinfo(b.dtype).max:
# rtol * max_int < 1, so it's inconsequential
Copy link
Contributor Author

@crusaderky crusaderky Mar 19, 2025

Choose a reason for hiding this comment

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

In practice, this impacts only array-api-strict wrapping around numpy 1.x

@lucascolley
Copy link
Member

Out of scope: we need to start a conversation about how array-api-compat, array-api-extra, and scipy are going to support obsolete versions of backends other than NumPy.

Yeah, I think we are still at a stage where we can require that only the latest versions work. But we'll get to this point eventually.

@lucascolley lucascolley added the maintenance general maintenance label Mar 19, 2025
@lucascolley lucascolley added this to the 0.7.1 milestone Mar 19, 2025
@lucascolley
Copy link
Member

I linked the issue suggesting that we test with oldest SPEC 0 NumPy. Pros/cons of that vs. the approach of <2 here? Probably almost the same in practice.

@crusaderky
Copy link
Contributor Author

I linked the issue suggesting that we test with oldest SPEC 0 NumPy. Pros/cons of that vs. the approach of <2 here? Probably almost the same in practice.

That makes sense. Now testing vs. 1.25.0.

Copy link
Member

@lucascolley lucascolley left a comment

Choose a reason for hiding this comment

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

thanks @crusaderky !

@lucascolley lucascolley merged commit 3db7f75 into data-apis:main Mar 19, 2025
11 checks passed
@lucascolley lucascolley added testing and removed maintenance general maintenance labels Mar 19, 2025
@crusaderky crusaderky deleted the numpy1 branch March 20, 2025 11:47
@lucascolley
Copy link
Member

we should probably change the numpy1 env to test NumPy 1.22, as that is now the oldest supported by scikit-learn. Hopefully SPEC 0 will evolve to eventually converge with scikit-learn somehow, but there is no need to be more aggressive in the meantime.

NeilGirdhar pushed a commit to NeilGirdhar/array-api-extra that referenced this pull request Apr 2, 2025
* TST: NumPy 1.x support

* Downgrade to  oldest SPEC0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CI: test with oldest (SPEC 0) NumPy
2 participants