(self, create_test_datatree: Callable[[], DataTree])
| 1846 | assert actual["arr_with_attrs"].attrs == attrs |
| 1847 | |
| 1848 | def test_args_kwargs(self, create_test_datatree: Callable[[], DataTree]) -> None: |
| 1849 | dt = create_test_datatree() |
| 1850 | |
| 1851 | def f(tree: DataTree, x: int, *, y: int, z: int) -> DataTree: |
| 1852 | return tree.assign( |
| 1853 | arr_with_attrs=xr.Variable("dim0", [], attrs=dict(x=x, y=y, z=z)) |
| 1854 | ) |
| 1855 | |
| 1856 | attrs = {"x": 1, "y": 2, "z": 3} |
| 1857 | |
| 1858 | actual = dt.pipe(f, attrs["x"], y=attrs["y"], z=attrs["z"]) |
| 1859 | assert actual["arr_with_attrs"].attrs == attrs |
| 1860 | |
| 1861 | def test_named_self(self, create_test_datatree: Callable[[], DataTree]) -> None: |
| 1862 | dt = create_test_datatree() |
nothing calls this directly
no test coverage detected