Skip to content

Commit dc92b07

Browse files
committed
simplifyy
1 parent fa542ed commit dc92b07

1 file changed

Lines changed: 1 addition & 6 deletions

File tree

xarray/core/indexes.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1569,12 +1569,7 @@ def sel(
15691569
else:
15701570
# Exact matching: check if positions are close to integers
15711571
if not np.all(np.abs(pos - (rounded := np.round(pos))) < eps):
1572-
coord_name = (
1573-
self.transform.coord_names[0]
1574-
if len(self.transform.coord_names) == 1
1575-
else dim
1576-
)
1577-
raise KeyError(f"not all values found in index {coord_name!r}")
1572+
raise KeyError(f"not all values found in index {dim!r}")
15781573
pos = rounded.astype("int")
15791574
if isinstance(label0_obj, Variable):
15801575
results[dim] = Variable(dims0, pos)

0 commit comments

Comments
 (0)