(x_new, expected)
| 718 | ], |
| 719 | ) |
| 720 | def test_datetime(x_new, expected) -> None: |
| 721 | da = xr.DataArray( |
| 722 | np.arange(24), |
| 723 | dims="time", |
| 724 | coords={"time": pd.date_range("2000-01-01", periods=24, unit="ns")}, |
| 725 | ) |
| 726 | |
| 727 | actual = da.interp(time=x_new) |
| 728 | expected_da = xr.DataArray( |
| 729 | np.atleast_1d(expected), |
| 730 | dims=["time"], |
| 731 | coords={"time": (np.atleast_1d(x_new).astype("datetime64[ns]"))}, |
| 732 | ) |
| 733 | |
| 734 | assert_allclose(actual, expected_da) |
| 735 | |
| 736 | |
| 737 | @requires_scipy |
nothing calls this directly
no test coverage detected
searching dependent graphs…