| 20 | |
| 21 | class Interpolation: |
| 22 | def setup(self, *args, **kwargs): |
| 23 | self.ds = xr.Dataset( |
| 24 | { |
| 25 | "var1": (("x", "y"), randn_xy), |
| 26 | "var2": (("x", "t"), randn_xt), |
| 27 | "var3": (("t",), randn_t), |
| 28 | "var4": (("z",), np.array(["text"])), |
| 29 | "var5": (("k",), np.array(["a", "b", "c"])), |
| 30 | }, |
| 31 | coords={ |
| 32 | "x": np.arange(nx), |
| 33 | "y": np.linspace(0, 1, ny), |
| 34 | "t": pd.date_range("1970-01-01", periods=nt, freq="D"), |
| 35 | "x_coords": ("x", np.linspace(1.1, 2.1, nx)), |
| 36 | "z": np.array([1]), |
| 37 | "k": np.linspace(0, nx, 3), |
| 38 | }, |
| 39 | ) |
| 40 | |
| 41 | @parameterized(["method", "is_short"], (["linear", "cubic"], [True, False])) |
| 42 | def time_interpolation_numeric_1d(self, method, is_short): |