-
Notifications
You must be signed in to change notification settings - Fork 45
Versioning support, bulk of complex testing #165
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
Conversation
array_api_tests/__init__.py
Outdated
__all__ = ["COMPLEX_VER", "api_version", "xps"] | ||
|
||
|
||
COMPLEX_VER: str = "2022.12" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't like this. There's more that was added in 2022 than just complex numbers.
Why not convert the version string to a tuple of numbers, so you can just compare like if version >= (2022,)
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah this is just meant to represent the version where complex numbers were added, not some be-end-all. It existed as a variable for historic reasons, as it was previously "draft"
and then something I'd just updated, but really I can grep-replace instances of it to "2022.12"
now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would rather just use inline version checks with the actual version. That's much more explicit to anyone reading the test code. We can include links to the spec changelog or versionadded admonitions as references if needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would rather just use inline version checks with the actual version. That's much more explicit to anyone reading the test code. We can include links to the spec changelog or versionadded admonitions as references if needed.
Pushed a change which represents what I was going for, which I think is what you're saying.
* Update test_sign for complex inputs * Use result dtype for res_type inference in assert-against-refimpl utils * Test `xp.real()` and `xp.imag()`
dfef8b4
to
03b735f
Compare
Does hypothesis use the |
I tried running this on data-apis/array-api-compat#14 and there were several failures (outside of the expected XFAILs).
(there might be more too since the known xfails were all skipped). |
Nope. It uses
Thanks for the report, I've identified a few issues before we can get this in. I'll prioritise resolving them so hopefully end of next week everythings up-to-speed. |
Also ignore very large distances
I should of mentioned last week I think I've addressed any blocking issues @asmeurer. So I'll continue to work on this branch, but if things look good to you it's okay to merge as-is on my end. |
Let's merge this. I'll open an issue if I notice any issues with testing the compat library. |
Resolves #20 with the introduced marker
min_version(api_version)
, so tests only run when specified with a later version. The env varARRAY_API_TESTS_VERSION
allows one to specify a version to test with, which currently defaults toxp.__array_api_version__
and fallsback to"2021.12"
.Covers complex testing for extended and new functions in the
2022.12
spec. Does not cover outside of that yet, nor complex special cases—something for a future PR.Realise I need to update Hypothesis first so it recognizes
2022.12
before I'd want this merged.