Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions cf_xarray/geometry.py
Original file line number Diff line number Diff line change
Expand Up @@ -412,8 +412,8 @@ def reshape_unique_geometries(
out = out.unstack(temp_name)

# geom_var was reshaped also, reconstruct it from the unique values.
unique_indexes = xr.DataArray(unique_indexes, dims=(new_dim,))
out[geom_var] = ds[geom_var].isel({old_name: unique_indexes})
unique_indexes_da = xr.DataArray(unique_indexes, dims=(new_dim,))
out[geom_var] = ds[geom_var].isel({old_name: unique_indexes_da})
if old_name not in ds.coords:
# If there was no coord before, drop the dummy one we made.
out = out.drop_vars(old_name) # type: ignore[arg-type,unused-ignore] # Hashable/str stuff
Expand Down
Loading