cubed icon indicating copy to clipboard operation
cubed copied to clipboard

Run tests against array-api-strict

Open tomwhite opened this issue 5 months ago • 2 comments

"The purpose of array-api-strict is to provide an implementation of the array API for consuming libraries to test against so they can be completely sure their usage of the array API is portable."

tomwhite avatar Jul 25 '25 08:07 tomwhite

I was actually just using this library yesterday - there are some really very subtle differences between numpy's behaviour and the array API standard, so testing against this explicitly would be worthwhile I think.

TomNicholas avatar Jul 25 '25 10:07 TomNicholas

Yes, although it will be quite a bit of work since we are implicitly using NumPy dtypes everywhere, which are not interchangeable with dtypes from the array API standard. E.g. the standard doesn't have itemsize (https://github.com/data-apis/array-api/issues/789), which we use a lot. And Zarr only understands NumPy dtypes so we'd have to do an explicit conversion between the two.

Doing this would help catch bugs like the one to do with np.empty that @TomAugspurger found in https://github.com/cubed-dev/cubed/issues/750#issuecomment-3114456613.

tomwhite avatar Jul 25 '25 10:07 tomwhite