(obj)
| 1318 | |
| 1319 | @pytest.mark.parametrize("obj", [make_da(), make_ds()]) |
| 1320 | def test_map_blocks_add_attrs(obj): |
| 1321 | def add_attrs(obj): |
| 1322 | obj = obj.copy(deep=True) |
| 1323 | obj.attrs["new"] = "new" |
| 1324 | obj.cxy.attrs["new2"] = "new2" |
| 1325 | return obj |
| 1326 | |
| 1327 | expected = add_attrs(obj) |
| 1328 | with raise_if_dask_computes(): |
| 1329 | actual = xr.map_blocks(add_attrs, obj) |
| 1330 | |
| 1331 | assert_identical(actual, expected) |
| 1332 | |
| 1333 | # when template is specified, attrs are copied from template, not set by function |
| 1334 | with raise_if_dask_computes(): |
| 1335 | actual = xr.map_blocks(add_attrs, obj, template=obj) |
| 1336 | assert_identical(actual, obj) |
| 1337 | |
| 1338 | |
| 1339 | def test_map_blocks_change_name(map_da): |
nothing calls this directly
no test coverage detected
searching dependent graphs…