(self)
| 1234 | assert_identical(array[1], array.sel(x_meta=0.2)) |
| 1235 | |
| 1236 | def test_sel_method(self) -> None: |
| 1237 | data = DataArray(np.random.randn(3, 4), [("x", [0, 1, 2]), ("y", list("abcd"))]) |
| 1238 | |
| 1239 | with pytest.raises(KeyError, match="Try setting the `method`"): |
| 1240 | data.sel(y="ab") |
| 1241 | |
| 1242 | expected = data.sel(y=["a", "b"]) |
| 1243 | actual = data.sel(y=["ab", "ba"], method="pad") |
| 1244 | assert_identical(expected, actual) |
| 1245 | |
| 1246 | expected = data.sel(x=[1, 2]) |
| 1247 | actual = data.sel(x=[0.9, 1.9], method="backfill", tolerance=1) |
| 1248 | assert_identical(expected, actual) |
| 1249 | |
| 1250 | def test_sel_drop(self) -> None: |
| 1251 | data = DataArray([1, 2, 3], [("x", [0, 1, 2])]) |
nothing calls this directly
no test coverage detected