-
Notifications
You must be signed in to change notification settings - Fork 8
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
Support for older versions of the standard #8
Comments
Supporting this sort of thing would also make it easier to support draft changes to the standard alongside the most recent release. |
This issue and #7 are basically the same thing. We need to figure out a way to present different versions of array-api-strict with different subsets of functions or behaviors, ideally in a way that minimizes code duplication and maintenance burden. |
The naive way to do this would be to set a global flag. My worry though is that would break if you have multiple array consuming libraries in play at once. For instance, what if scikit-learn tests with array-api-strict but calls a scipy function, which also uses the array API. If scikit-learn requests, say, 2022.12 and scipy requests 2023.12, this would lead to an incompatibility. So instead, I think we should create simple Importantly, it should work just fine to pass an Array object from one namespace to another, because they are just shallow copies, so the above scikit-learn/scipy use-case would work seamlessly. The same would work for a data-dependent shapes mode (#7) or any other kind of mode. The namespace objects would just consist of some flags corresponding to enabled behaviors and the functions would automatically enable/disable those behaviors. One question here is testing. Will the test suite always support older versions of the standard? I think as long as we always add tests for new functionality under |
+1 generally, covering and testing multiple versions would be great for the test suite.
data-apis/array-api#589 might be interesting here.
I think so, yes. Footnotes
|
I'll have to think about this. Actually typing isn't something I had considered. I played around a little bit with converting type hints into type checks (#6) and I wasn't particularly pleased with what I found, so I gave up on it.
Yes we want this to just be a skip. Is |
Different versions can now be selected with |
Should we support older versions of the standard?
I don't think there's any point to supporting 2021.12, since no implementation actually supports it (including array-api-compat). However, as libraries actually start implementing the standard, being able to support multiple versions here could be useful.
For now, we could just tell people to install older versions of array-api-strict. But if people actually test against old versions of the standard, I would much rather just support them at once here than trying to support backport versions.
Plus, the
__array_namespace__
method has theversion
flag specifically for this sort of thing.By the way, if you were to ask the same question for array-api-compat, or any actual implementation for that manner, I would say no, unless the standard ends up adopting some serious backwards incompatible changes in some future version. But there could be an argument for the strict implementation to have this.
The text was updated successfully, but these errors were encountered: