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

Method test_args

xarray/tests/test_datatree.py:1824–1833  ·  view source on GitHub ↗
(self, create_test_datatree: Callable[[], DataTree])

Source from the content-addressed store, hash-verified

1822 assert actual.identical(dt)
1823
1824 def test_args(self, create_test_datatree: Callable[[], DataTree]) -> None:
1825 dt = create_test_datatree()
1826
1827 def f(tree: DataTree, x: int, y: int) -> DataTree:
1828 return tree.assign(
1829 arr_with_attrs=xr.Variable("dim0", [], attrs=dict(x=x, y=y))
1830 )
1831
1832 actual = dt.pipe(f, 1, 2)
1833 assert actual["arr_with_attrs"].attrs == dict(x=1, y=2)
1834
1835 def test_kwargs(self, create_test_datatree: Callable[[], DataTree]) -> None:
1836 dt = create_test_datatree()

Callers

nothing calls this directly

Calls 2

create_test_datatreeFunction · 0.85
pipeMethod · 0.45

Tested by

no test coverage detected