()
| 1128 | @requires_dask |
| 1129 | @requires_scipy |
| 1130 | def test_interp_vectorized_dask() -> None: |
| 1131 | # Synthetic dataset chunked in the two interpolation dimensions |
| 1132 | import dask.array as da |
| 1133 | |
| 1134 | nt = 10 |
| 1135 | nlat = 20 |
| 1136 | nlon = 10 |
| 1137 | nq = 21 |
| 1138 | ds = xr.Dataset( |
| 1139 | data_vars={ |
| 1140 | "foo": ( |
| 1141 | ("lat", "lon", "dayofyear", "q"), |
| 1142 | da.random.random((nlat, nlon, nt, nq), chunks=(10, 10, 10, -1)), |
| 1143 | ), |
| 1144 | "bar": (("lat", "lon"), da.random.random((nlat, nlon), chunks=(10, 10))), |
| 1145 | }, |
| 1146 | coords={ |
| 1147 | "lat": np.linspace(-89.5, 89.6, nlat), |
| 1148 | "lon": np.linspace(-179.5, 179.6, nlon), |
| 1149 | "dayofyear": np.arange(0, nt), |
| 1150 | "q": np.linspace(0, 1, nq), |
| 1151 | }, |
| 1152 | ) |
| 1153 | |
| 1154 | # Interpolate along non-chunked dimension |
| 1155 | with raise_if_dask_computes(): |
| 1156 | actual = ds.interp(q=ds["bar"], kwargs={"fill_value": None}) |
| 1157 | expected = ds.compute().interp(q=ds["bar"], kwargs={"fill_value": None}) |
| 1158 | assert_identical(actual, expected) |
| 1159 | |
| 1160 | |
| 1161 | @requires_scipy |
nothing calls this directly
no test coverage detected
searching dependent graphs…