Skip to content

Commit

Permalink
sel: add todo note about rounding decimal pos
Browse files Browse the repository at this point in the history
  • Loading branch information
benbovy committed Sep 24, 2024
1 parent e9a11ef commit 0b3fd9e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions xarray/core/indexes.py
Original file line number Diff line number Diff line change
Expand Up @@ -1476,6 +1476,9 @@ def sel(
results = {}
dims0 = tuple(dim_size0)
for dim, pos in dim_positions.items():
# TODO: rounding the decimal positions is not always the behavior we expect
# (there are different ways to represent implicit intervals)
# we should probably make this customizable.
pos = np.round(pos).astype("int")
if isinstance(label0_obj, Variable):
xr_pos = Variable(dims0, pos)
Expand Down

0 comments on commit 0b3fd9e

Please sign in to comment.