()
| 1447 | |
| 1448 | |
| 1449 | def test_map_blocks_template_convert_object(): |
| 1450 | da = make_da() |
| 1451 | ds = da.to_dataset() |
| 1452 | |
| 1453 | func = lambda x: x.to_dataset().isel(x=[1]) |
| 1454 | template = xr.concat([da.to_dataset().isel(x=[i]) for i in [1, 5, 9]], dim="x") |
| 1455 | with raise_if_dask_computes(): |
| 1456 | actual = xr.map_blocks(func, da, template=template) |
| 1457 | assert_identical(actual, template) |
| 1458 | |
| 1459 | func = lambda x: x.to_dataarray().isel(x=[1]) |
| 1460 | template = xr.concat([ds.to_dataarray().isel(x=[i]) for i in [1, 5, 9]], dim="x") |
| 1461 | with raise_if_dask_computes(): |
| 1462 | actual = xr.map_blocks(func, ds, template=template) |
| 1463 | assert_identical(actual, template) |
| 1464 | |
| 1465 | |
| 1466 | @pytest.mark.parametrize("obj", [make_da(), make_ds()]) |
nothing calls this directly
no test coverage detected
searching dependent graphs…