Open Berndone opened 4 months ago
Thanks for opening your first issue here at xarray! Be sure to follow the issue template! If you have an idea for a solution, we would really welcome a Pull Request with proposed changes. See the Contributing Guide for more. It may take us a while to respond here, but we really value your contribution. Contributors like you help make xarray better. Thank you!
You've chosen to support BASIC indexing so I wouldn't expect []
to work: https://docs.xarray.dev/en/latest/internals/how-to-add-new-backend.html#indexing-examples
It fails at least with OUTER_1VECTOR
too. Also, I might have a misunderstanding here, but isn't the purpose of the explicit_indexing_adapter
that the array will support outer indexing even if my raw_indexing_method
only supports basic indexing? E.g. when I use [1, 4]
as index raw_indexing_method
gets called with the index slice(1,4)
and the result is stripped of the additional values with index 2 and 3. Similar, I would expect the index []
converted to a corresponding basic index.
What happened?
I am implementing my own lazy loadable backend based on https://docs.xarray.dev/en/latest/internals/how-to-add-new-backend.html#how-to-support-lazy-loading using the xr.core.indexing.explicit_indexing_adapter.
I noticed that when you use
data[[]]
the method crashes, whilst a "normal" data array just returns an empty list.What did you expect to happen?
Same result when using a normal data array, not an exception.
Minimal Complete Verifiable Example
MVCE confirmation
Relevant log output
Anything else we need to know?
No response
Environment