(self)
| 1859 | assert x.dtype == re_dtype |
| 1860 | |
| 1861 | def test_reindex_method(self) -> None: |
| 1862 | x = DataArray([10, 20], dims="y", coords={"y": [0, 1]}) |
| 1863 | y = [-0.1, 0.5, 1.1] |
| 1864 | actual = x.reindex(y=y, method="backfill", tolerance=0.2) |
| 1865 | expected = DataArray([10, np.nan, np.nan], coords=[("y", y)]) |
| 1866 | assert_identical(expected, actual) |
| 1867 | |
| 1868 | actual = x.reindex(y=y, method="backfill", tolerance=[0.1, 0.1, 0.01]) |
| 1869 | expected = DataArray([10, np.nan, np.nan], coords=[("y", y)]) |
| 1870 | assert_identical(expected, actual) |
| 1871 | |
| 1872 | alt = Dataset({"y": y}) |
| 1873 | actual = x.reindex_like(alt, method="backfill") |
| 1874 | expected = DataArray([10, 20, np.nan], coords=[("y", y)]) |
| 1875 | assert_identical(expected, actual) |
| 1876 | |
| 1877 | @pytest.mark.parametrize("fill_value", [dtypes.NA, 2, 2.0, {None: 2, "u": 1}]) |
| 1878 | def test_reindex_fill_value(self, fill_value) -> None: |
nothing calls this directly
no test coverage detected