MCPcopy
hub / github.com/pydata/xarray / test_assert_equal_transpose_datatree

Function test_assert_equal_transpose_datatree

xarray/tests/test_assertions.py:106–116  ·  view source on GitHub ↗

Ensure `check_dim_order=False` works for transposed DataTree

()

Source from the content-addressed store, hash-verified

104
105
106def test_assert_equal_transpose_datatree() -> None:
107 """Ensure `check_dim_order=False` works for transposed DataTree"""
108 ds = xr.Dataset(data_vars={"data": (("x", "y"), [[1, 2]])})
109
110 a = xr.DataTree.from_dict({"node": ds})
111 b = xr.DataTree.from_dict({"node": ds.transpose("y", "x")})
112
113 with pytest.raises(AssertionError):
114 xr.testing.assert_equal(a, b)
115
116 xr.testing.assert_equal(a, b, check_dim_order=False)
117
118
119@pytest.mark.filterwarnings("error")

Callers

nothing calls this directly

Calls 2

transposeMethod · 0.95
from_dictMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…