()
| 1211 | |
| 1212 | @requires_dask |
| 1213 | def test_apply_dask_parallelized_one_arg() -> None: |
| 1214 | import dask.array as da |
| 1215 | |
| 1216 | array = da.ones((2, 2), chunks=(1, 1)) |
| 1217 | data_array = xr.DataArray(array, dims=("x", "y")) |
| 1218 | |
| 1219 | def parallel_identity(x): |
| 1220 | return apply_ufunc(identity, x, dask="parallelized", output_dtypes=[x.dtype]) |
| 1221 | |
| 1222 | actual = parallel_identity(data_array) |
| 1223 | assert isinstance(actual.data, da.Array) |
| 1224 | assert actual.data.chunks == array.chunks |
| 1225 | assert_identical(data_array, actual) |
| 1226 | |
| 1227 | computed = data_array.compute() |
| 1228 | actual = parallel_identity(computed) |
| 1229 | assert_identical(computed, actual) |
| 1230 | |
| 1231 | |
| 1232 | @requires_dask |
nothing calls this directly
no test coverage detected
searching dependent graphs…