Open
Description
What happened?
import xarray as xr
x = xr.DataArray(np.zeros((2, 3)), dims=("a", "b"))
assert x[("b", np.array([0, 1, 0])),].shape == (3,)
x[("b", np.array([0, 1, 0])),] += 1 # ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (2,) + inhomogeneous part.
Under the hood, this ends up being called, which fails:
x.variable[("b", np.array([0, 1, 0])),]