MCPcopy Index your code
hub / github.com/pydata/xarray / test_map_blocks_template_convert_object

Function test_map_blocks_template_convert_object

xarray/tests/test_dask.py:1449–1463  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1447
1448
1449def 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()])

Callers

nothing calls this directly

Calls 8

raise_if_dask_computesFunction · 0.90
assert_identicalFunction · 0.90
make_daFunction · 0.85
to_datasetMethod · 0.45
iselMethod · 0.45
concatMethod · 0.45
map_blocksMethod · 0.45
to_dataarrayMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…