| 1089 | |
| 1090 | @requires_scipy |
| 1091 | def test_interp_non_numeric_1d() -> None: |
| 1092 | ds = xr.Dataset( |
| 1093 | { |
| 1094 | "numeric": ("time", 1 + np.arange(0, 4, 1)), |
| 1095 | "non_numeric": ("time", np.array(["a", "b", "c", "d"])), |
| 1096 | }, |
| 1097 | coords={"time": (np.arange(0, 4, 1))}, |
| 1098 | ) |
| 1099 | actual = ds.interp(time=np.linspace(0, 3, 7)) |
| 1100 | |
| 1101 | expected = xr.Dataset( |
| 1102 | { |
| 1103 | "numeric": ("time", 1 + np.linspace(0, 3, 7)), |
| 1104 | "non_numeric": ("time", np.array(["a", "b", "b", "c", "c", "d", "d"])), |
| 1105 | }, |
| 1106 | coords={"time": np.linspace(0, 3, 7)}, |
| 1107 | ) |
| 1108 | xr.testing.assert_identical(actual, expected) |
| 1109 | |
| 1110 | |
| 1111 | @requires_scipy |