html_url,issue_url,id,node_id,user,created_at,updated_at,author_association,body,reactions,performed_via_github_app,issue
https://github.com/pydata/xarray/issues/5697#issuecomment-908496157,https://api.github.com/repos/pydata/xarray/issues/5697,908496157,IC_kwDOAMm_X842Jo0d,4160723,2021-08-30T16:35:54Z,2021-08-30T16:35:54Z,MEMBER,"> So does this mean custom indexes have to implement vectorized or pointwise indexing on their own?
No I don't think so (sorry my thoughts are still confusing), we would still use the current implementation in Xarray for positional (vectorized, pointwise, etc.) indexing.
Currently label-based indexers go through these normalization steps before passing them to `Index.query`:
1. cast floating-point labels to coordinate dtype (`maybe_cast_to_coords_dtype()`)
2. convert `DataArray` objects to unlabelled data (via `.variable.data`)
The dimension (positional) indexers returned by `Index.query` may be also converted before passing them to `.isel`:
3. back to `Variable` or `DataArray` objects for advanced indexing
I think that `PandasIndex` should take care of 1. Casting floating-point labels (casting any object to a numpy array as a side effect) may be undesirable for other, custom indexes.
For 2 and 3, I'm not exactly sure what to do. We should probably avoid 2 since dimension labels are useful (e.g., it is used in `.xoak.sel`) and let the indexes handle that. This means that indexes should also handle 3. For pandas multi-indexes, this would allow us raising a more meaningful error message since they don't support `DataArray` or `Variable` objects as level indexers. It is also better to handle 2 and 3 in a per-case basis since a general solution for 3 is tricky with the new data model (non-dimensional indexes).
This means a lot of flexibility for custom indexes but also a great responsibility.
","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,968796847
https://github.com/pydata/xarray/issues/5697#issuecomment-908453953,https://api.github.com/repos/pydata/xarray/issues/5697,908453953,IC_kwDOAMm_X842JehB,2448579,2021-08-30T15:46:50Z,2021-08-30T15:46:50Z,MEMBER,"> leave indexers untouched and let Index objects do the validation and conversion.
So does this mean custom indexes have to implement vectorized or pointwise indexing on their own?","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,968796847
https://github.com/pydata/xarray/issues/5697#issuecomment-908447693,https://api.github.com/repos/pydata/xarray/issues/5697,908447693,IC_kwDOAMm_X842Jc_N,4160723,2021-08-30T15:38:42Z,2021-08-30T15:38:42Z,MEMBER,"> In #5692 (a551c7f) they are always coerced to arrays before maybe be converted as scalars.
This is not exactly true: slices are kept as-is.
#3153 is actually a workaround specific to Pandas index limitations (only `float64` floating -point labels supported), so it would make sense to move this within `PandasIndex`.
Other use-cases like [xoak](https://github.com/xarray-contrib/xoak) point-wise indexing only support `Variable` or `DataArray` objects as indexers (to ensure that all indexers have the same dimensions).
So it would probably be better to leave indexers untouched and let `Index` objects do the validation and conversion.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,968796847