array-api-tests
array-api-tests copied to clipboard
2023.12 support
We need a tracking issue for 2023.12 support in the test suite.
Here is the list of changes https://data-apis.org/array-api/latest/changelog.html#v2023-12
New Functions
- [x]
__array_namespace_info__(i.e., the inspection API) - [x]
clip - [x]
copysign - [x]
cumulative_sum - [x]
hypot - [x]
maximum - [x]
minimum - [x]
moveaxis - [x]
repeat - [x]
searchsorted - [x]
signbit - [x]
tile - [x]
unstack
API Changes
- [ ]
devicekeyword added toastype - [ ]
from_dlpackrequires exceptions in some cases - [ ]
copyanddevicekeywords tofrom_dlpack - [ ]
sum,prod,traceoutput dtype change (https://github.com/data-apis/array-api-tests/issues/234)
Other Changes (not sure if these need tests)
- [ ] Support for lazy functions in various APIs. Will probably need a real world lazy implementation to support this.
- [ ] Order of signed zeros unspecified for
maxandmin. Just need to make sure we aren't testing this. - [ ] Out of bounds unspecified for
take. - [ ]
tensordotshould support negative axes (not sure if this is already tested)
I think that's everything but you might want to read through the changes too to check if I missed something.
Note: clip is tricky, especially given the divergences between the standard and the NumPy implementation. We should be especially sure to that the test can catch possible issues with incorrect promotion behavior (clip should not promote but return the same dtype as x) so we can catch potential issues with integer overflow like described at https://github.com/numpy/numpy/issues/24976
Notes for copysign special cases: One can construct a nan with a negative sign bit using -float('nan'). To test the sign bit of a nan you'd either have to use signbit or use math.copysign.
I edited the above list to add a couple of things I missed.
Should this have been closed?
Should this have been closed?
Good catch!
I noticed the searchsorted test is broken because it uses __array_namespace_info__, which isn't listed correctly in the array-api stubs (it's also broken because it uses float instead of int for the sorter array, but that's an easy fix). I tried fixing this in the submodule:
diff --git a/src/array_api_stubs/_2023_12/__init__.py b/src/array_api_stubs/_2023_12/__init__.py
index 8415f276..537ea8f8 100644
--- a/src/array_api_stubs/_2023_12/__init__.py
+++ b/src/array_api_stubs/_2023_12/__init__.py
@@ -16,7 +16,7 @@ from .statistical_functions import *
from .utility_functions import *
from . import linalg
from . import fft
-from . import info
+from .info import __array_namespace_info__
__array_api_version__: str = "YYYY.MM"
but the fix doesn't seem to work.