Skip to content

ENH: testing: support 0-D arrays for rtol and atol#743

Merged
lucascolley merged 6 commits into
data-apis:mainfrom
prady0t:fix-non-float-rtol-atol-inputs
May 17, 2026
Merged

ENH: testing: support 0-D arrays for rtol and atol#743
lucascolley merged 6 commits into
data-apis:mainfrom
prady0t:fix-non-float-rtol-atol-inputs

Conversation

@prady0t
Copy link
Copy Markdown
Contributor

@prady0t prady0t commented May 16, 2026

As discussed here: scipy/scipy#25143 (comment)

prady0t and others added 4 commits May 17, 2026 02:50
Signed-off-by: Pradyot Ranjan <99216956+pradyotRanjan@users.noreply.github.com>
Signed-off-by: Pradyot Ranjan <99216956+pradyotRanjan@users.noreply.github.com>
Signed-off-by: Pradyot Ranjan <99216956+pradyotRanjan@users.noreply.github.com>
Copy link
Copy Markdown
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.

Nice, feel free to update your PR to SciPy to see what passes/fails with this change.

Comment thread src/array_api_extra/_lib/_testing.py
@lucascolley lucascolley changed the title ENH: Adding case for non float rtol and atol inputs ENH: testing: support 0-D arrays for rtol and atol May 16, 2026
@lucascolley lucascolley added enhancement New feature or request xpx.testing labels May 16, 2026
@lucascolley lucascolley added this to the 0.10.2 milestone May 16, 2026
Copy link
Copy Markdown
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.

For the CI failures here, I think we should update as_numpy_array to be a no-op on NumPy scalars.

@lucascolley
Copy link
Copy Markdown
Member

On second thought, seems like we can simplify this by just calling float on the input — want to see if this works for SciPy?

Comment thread src/array_api_extra/_lib/_testing.py Outdated
Co-authored-by: Lucas Colley <lucas.colley8@gmail.com>
@prady0t
Copy link
Copy Markdown
Contributor Author

prady0t commented May 17, 2026

On second thought, seems like we can simplify this by just calling float on the input

Yeah, that's what I initially suggested. Let's merge this.

@lucascolley lucascolley merged commit 2ec7cf5 into data-apis:main May 17, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request xpx.testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants