Skip to content

ENH: testing: make assertion functions public#753

Merged
lucascolley merged 3 commits into
data-apis:mainfrom
lucascolley:public-assertions
May 25, 2026
Merged

ENH: testing: make assertion functions public#753
lucascolley merged 3 commits into
data-apis:mainfrom
lucascolley:public-assertions

Conversation

@lucascolley
Copy link
Copy Markdown
Member

@lucascolley lucascolley commented May 23, 2026

Towards gh-17.

@lucascolley lucascolley added this to the 0.10.2 milestone May 23, 2026
@lucascolley lucascolley marked this pull request as ready for review May 23, 2026 15:21
@lucascolley lucascolley added enhancement New feature or request xpx.testing labels May 23, 2026
@lucascolley
Copy link
Copy Markdown
Member Author

@ev-br @mdhaber @paddyroddy could I perhaps interest anyone in running pixi run open-docs on this branch and reviewing the documentation of this new public API?

@lundybernard
Copy link
Copy Markdown

lundybernard commented May 23, 2026

@ev-br @mdhaber @paddyroddy could I perhaps interest anyone in running pixi run open-docs on this branch and reviewing the documentation of this new public API?

assert_close rtol and atol parameters

Docs are unclear, both params say only "Relative tolerance" / "Absolute tolerance" with no explanation of how they combine in the comparison. Since these are core to the function, additional details in the NOTES section or doc-string would be helpful.
The NumPy docs are similarly sparse.

rtol default value

The Notes section mentions sqrt(eps) as the default rtol basis, but doesn't explain why. That came from SciPy PR #20625 (scipy/scipy#20625) and a Scientific Python Discourse thread about float32 vs float64 strictness. The rationale (float32 tolerance ~1e-3 vs float64 ~6e-8) is not obvious and worth a sentence in the Notes.

xp param

At first glance this name is perplexing, there's a good explanation on the first page of the docs. A link to the full explanation may be helpful, but its easy enough to dig up.

Copy link
Copy Markdown

@lundybernard lundybernard left a comment

Choose a reason for hiding this comment

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

spotted a few minor issues

Comment thread src/array_api_extra/testing.py Outdated
Comment thread src/array_api_extra/testing.py Outdated
Comment thread src/array_api_extra/testing.py Outdated
Comment thread src/array_api_extra/testing.py Outdated
Comment thread pixi.toml
@lucascolley
Copy link
Copy Markdown
Member Author

gonna click this in so that feedback on the new docs is easier once they are deployed. The API is still subject to change until the next release. But this will at least unblock work on gh-755

@lucascolley lucascolley enabled auto-merge (squash) May 25, 2026 14:40
@lucascolley lucascolley disabled auto-merge May 25, 2026 14:41
@lucascolley lucascolley merged commit dbde5a9 into data-apis:main May 25, 2026
12 of 13 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.

3 participants