(self)
| 2975 | assert key not in actual.xindexes |
| 2976 | |
| 2977 | def test_drop_index_labels(self) -> None: |
| 2978 | arr = DataArray(np.random.randn(2, 3), coords={"y": [0, 1, 2]}, dims=["x", "y"]) |
| 2979 | actual = arr.drop_sel(y=[0, 1]) |
| 2980 | expected = arr[:, 2:] |
| 2981 | assert_identical(actual, expected) |
| 2982 | |
| 2983 | with pytest.raises((KeyError, ValueError), match=r"not .* in axis"): |
| 2984 | actual = arr.drop_sel(y=[0, 1, 3]) |
| 2985 | |
| 2986 | actual = arr.drop_sel(y=[0, 1, 3], errors="ignore") |
| 2987 | assert_identical(actual, expected) |
| 2988 | |
| 2989 | with pytest.warns(FutureWarning): |
| 2990 | arr.drop([0, 1, 3], dim="y", errors="ignore") # type: ignore[arg-type] |
| 2991 | |
| 2992 | def test_drop_index_positions(self) -> None: |
| 2993 | arr = DataArray(np.random.randn(2, 3), dims=["x", "y"]) |
nothing calls this directly
no test coverage detected