Version
v2026.8.0
How did you install UXarray?
Source
What happened?
When using UxDataArray.isel(indexers) or UxDataset.isel(indexers) with a pre-defined indexers dict, the dict itself is edited, so repeating the same .isel() code multiple times leads to different results.
What did you expect to happen?
I expected the indexers dict to not be modified directly.
The fix should be simple; inside .isel() methods, use a copy of indexers instead of popping grid_dim from the original.
Can you provide a MCVE to repoduce the bug?
obj = ux.tutorial.open_dataset('quad-hexagon') # obj is a UxDataset
chosen_faces = {'n_face': 0}
resultA = obj.isel(chosen_faces)
resultB = obj.isel(chosen_faces)
print((resultA.sizes['n_face'], resultB.sizes['n_face']))
# expected (1, 1), got (1, 4)
print(chosen_faces)
# expected {'n_face': 0}, got {}
# same issue occurs with UxDataArray, e.g. try above with obj=obj['t2m']
Version
v2026.8.0
How did you install UXarray?
Source
What happened?
When using
UxDataArray.isel(indexers)orUxDataset.isel(indexers)with a pre-definedindexersdict, the dict itself is edited, so repeating the same.isel()code multiple times leads to different results.What did you expect to happen?
I expected the indexers dict to not be modified directly.
The fix should be simple; inside
.isel()methods, use a copy ofindexersinstead of popping grid_dim from the original.Can you provide a MCVE to repoduce the bug?