Open khaeru opened 3 weeks ago
thanks for the report!
This was introduced in #9530, and it was definitely not intentional to break vectorized indexing with sparse
(looks like I forgot to add a release note entry, which I would have put into "new features").
The issue here is the order of preference for the indexing adapters, which was switched from preferring __array_function__
to preferring __array_namespace__
if both are present. However, it looks like I missed sparse
when investigating whether any array type in use already implemented both (and our tests didn't catch them either).
There's two things I believe we can do (besides reverting if we need more time to figure out a good way to resolve this):
"__array_function__"
)not sure which one will be better in the end
work around the Array API not including vectorized indexing / indexing with an integer array
Let's move ahead with this. We already have the code in explicit_indexing_adapter
, we just need to figure out the right IndexingSupport
enum variant for whatever array api prescribes.
work around the Array API not including vectorized indexing / indexing with an integer array
Let's move ahead with this. We already have the code in
explicit_indexing_adapter
, we just need to figure out the rightIndexingSupport
enum variant for whatever array api prescribes.
The array API has discussed adding support for vectorized indexing in the near future: https://github.com/data-apis/array-api/issues/669
Hopefully this happens!
What happened?
Code that worked with xarray 2024.9.0 has begun to fail with xarray 2024.10.0, even though no breaking changes were advertised.
What did you expect to happen?
The below MCVE runs with xarray 2024.9.0, giving the output below.
I'd expect it runs the same way with xarray 2024.10.0.
Minimal Complete Verifiable Example
MVCE confirmation
Relevant log output
With xarray 2024.9.0:
With xarray 2024.10.0:
Anything else we need to know?
No response
Environment