You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
MultiIndex coordinates loc/sel not working in 0.19.0 #5691
Thanks for the report @genric. Probably some regression introduced in #5322. I'm surprised this hasn't been caught in the tests. I'm also surprised that it seems to be fixed in #5692. I'll take a closer look.
So the issue was that #3153 doesn't work well with multi-indexes that don't like numpy arrays nor even numpy scalars given as labels. Previously it worked because of multi-index virtual coordinates, i.e., the dtype of multi-index levels was ignored when internally re-organizing the indexers passed to .sel in xarray. However, this is not the case anymore as we are currently dropping virtual coordinates by real coordinates in the context of xarray's explicit indexes refactoring.
This should be fixed in #5692 (a551c7f), although #3153 still doesn't address the case of multi-index level coordinates with float32 values.
Activity
benbovy commentedon Aug 11, 2021
Thanks for the report @genric. Probably some regression introduced in #5322. I'm surprised this hasn't been caught in the tests. I'm also surprised that it seems to be fixed in #5692. I'll take a closer look.
fix multi-index selection regression
benbovy commentedon Aug 12, 2021
So the issue was that #3153 doesn't work well with multi-indexes that don't like numpy arrays nor even numpy scalars given as labels. Previously it worked because of multi-index virtual coordinates, i.e., the
dtypeof multi-index levels was ignored when internally re-organizing the indexers passed to.selin xarray. However, this is not the case anymore as we are currently dropping virtual coordinates by real coordinates in the context of xarray's explicit indexes refactoring.This should be fixed in #5692 (a551c7f), although #3153 still doesn't address the case of multi-index level coordinates with float32 values.
Explicit indexes (#5692)