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
In UxDataset.isel() if "n_face" coords assigned: ValueError: dimension 'n_face' already exists as a scalar variable #1714
When using isel() on UxDataset in a similar pattern as the workflow described in #1641, got strange ValueError (see title). This applies when using isel() on a UxDataset with coordinates assigned for n_face, which maybe isn't a central feature uxarray intends to support, but I also think this behavior shouldn't lead to a confusing crash. Similar workflow for UxDataArray works just fine.
What did you expect to happen?
I expected .isel() to select by index, and keep coordinates, without complaining about "n_face" having coordinates assigned to it, similarly to how it would work with xarray.Dataset.isel().
Can you provide a MCVE to repoduce the bug?
uxds=ux.tutorial.open_dataset("outCSne30-vortex")
uxds1=uxds.assign_coords(n_face=np.arange(uxds.n_face.size))
uxds1.isel(n_face=[0,1,2])
# crashes with ValueError# meanwhile, the following each work just fine, and behave how I would expect:uxds1.to_xarray().isel(n_face=[0,1,2])
uxds1['psi'].isel(n_face=[0,1,2])
Activity
Fix isel() bugs: missing indexers' coords; UxDataset.isel() silently …