-
Notifications
You must be signed in to change notification settings - Fork 5
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
ENH: add testing support utilities #17
Comments
These utilities are specific to the libraries we test with in SciPy, so I don't think they would fit into the current scope of this library. I think it may be possible to generalise Since there are no I agree that these utilities should be pulled out of SciPy into some package which other consuming libraries can re-use. But I think that it would be useful to keep them separate from array-api-extra to avoid confusion, by keeping this library as purely building on top of the standard. |
I discussed this with Evgeni a few weeks ago, and based on his description of the SciPy tooling, I suggested that these utilities be split out into a separate package that is a pytest extension (e.g., called something like |
To gauge interest of other downstream adopters: @betatim would you consider using scipy's |
A bit tricky to judge in the abstract. Right now we convert all outputs back to Numpy arrays and then use the "standard" all close, equal, etc tooling. So in principle having a For skipping particular namespaces: we use a decorator to generate combinations of |
#88 adds The xpx version misses a bunch of bells and whistles that the scipy version has:
I was keen to avoid scope creep in #88, so I stuck to the mvp for array-api-extra itself. |
also, since I commented above, the scope of xpx has expanded, so these are probably no longer out of scope. |
If anything, ISTM it'd be best to move xp_assert functions wholesale, as they are. 0d versions can either move or stay, of course. Not having two nearly but not quite identical functions in two packages is best avoided though. |
SciPy has two sets of testing support utilities:
{skip_xfail}_xp_backends
skips, https://github.com/scipy/scipy/blob/main/scipy/conftest.py#L215 . These are convenient for testing across the range of array api backends. Note that these are pytest-specific.xp_assert_{equal,close}
, https://github.com/scipy/scipy/blob/main/scipy/_lib/_array_api.py#L299. These wrap backend-specific assertions, and scipy effectively transitions fromnp.testing
to these ones. Quite a bit of effort went into crafting these ones, and ISTM these can be useful across the ecosystem.The text was updated successfully, but these errors were encountered: