(self)
| 2065 | data.tail(time=-3) |
| 2066 | |
| 2067 | def test_thin(self) -> None: |
| 2068 | data = create_test_data() |
| 2069 | |
| 2070 | expected = data.isel(time=slice(None, None, 5), dim2=slice(None, None, 6)) |
| 2071 | actual = data.thin(time=5, dim2=6) |
| 2072 | assert_equal(expected, actual) |
| 2073 | |
| 2074 | expected = data.isel({dim: slice(None, None, 6) for dim in data.dims}) |
| 2075 | actual = data.thin(6) |
| 2076 | assert_equal(expected, actual) |
| 2077 | |
| 2078 | with pytest.raises(TypeError, match=r"either dict-like or a single int"): |
| 2079 | data.thin([3]) # type: ignore[arg-type] |
| 2080 | with pytest.raises(TypeError, match=r"expected integer type"): |
| 2081 | data.thin(dim2=3.1) |
| 2082 | with pytest.raises(ValueError, match=r"cannot be zero"): |
| 2083 | data.thin(time=0) |
| 2084 | with pytest.raises(ValueError, match=r"expected positive int"): |
| 2085 | data.thin(time=-3) |
| 2086 | |
| 2087 | @pytest.mark.filterwarnings("ignore::FutureWarning") |
| 2088 | def test_sel_fancy(self) -> None: |
nothing calls this directly
no test coverage detected