-
Notifications
You must be signed in to change notification settings - Fork 14
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
Array API tests fixes #636
Conversation
@@ -108,6 +108,8 @@ jobs: | |||
# edge case failures (https://github.com/cubed-dev/cubed/issues/420) | |||
array_api_tests/test_linalg.py::test_tensordot | |||
array_api_tests/test_linalg.py::test_vecdot | |||
# (getitem with negative step size is not implemented) |
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.
:) we actually rewrite such queries in Xarray for Zarr
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.
Oh interesting! How do you do that?
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.
https://github.com/pydata/xarray/blob/99ee8c6ca54057a9b994d7685f36236f2d5a69d9/xarray/core/indexing.py#L1084 and friends. We rewrite the query to normal slice with +ve stride, then reverse in-memory after read :)
This is one of Xarray's magic tricks that very few people know about. We guarantee consistent indexing API over any array for the most part.
In pydata/xarray#8667, I suggested reusing this machinery for cubed.
EDIT: actually my comment is here: pydata/xarray#8834 (comment)
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.
Very cool. Would be great to reuse that. BTW Cubed flip
is implemented in a similar way, but it's only step=-1
of course.
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.
Opened #637 to track
f49df7c
to
bee866c
Compare
Fix some failures in https://github.com/cubed-dev/cubed/actions/workflows/array-api-tests.yml (there may be more).