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

Function test_tree_index_equals

xarray/tests/test_nd_point_index.py:149–166  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

147
148@requires_scipy
149def test_tree_index_equals() -> None:
150 xx1, yy1 = np.meshgrid([1.0, 2.0], [3.0, 4.0])
151 ds1 = xr.Dataset(
152 coords={"xx": (("y", "x"), xx1), "yy": (("y", "x"), yy1)}
153 ).set_xindex(("xx", "yy"), NDPointIndex)
154
155 xx2, yy2 = np.meshgrid([1.0, 2.0], [3.0, 4.0])
156 ds2 = xr.Dataset(
157 coords={"xx": (("y", "x"), xx2), "yy": (("y", "x"), yy2)}
158 ).set_xindex(("xx", "yy"), NDPointIndex)
159
160 xx3, yy3 = np.meshgrid([10.0, 20.0], [30.0, 40.0])
161 ds3 = xr.Dataset(
162 coords={"xx": (("y", "x"), xx3), "yy": (("y", "x"), yy3)}
163 ).set_xindex(("xx", "yy"), NDPointIndex)
164
165 assert ds1.xindexes["xx"].equals(ds2.xindexes["xx"])
166 assert not ds1.xindexes["xx"].equals(ds3.xindexes["xx"])
167
168
169def test_tree_index_rename() -> None:

Callers

nothing calls this directly

Calls 2

set_xindexMethod · 0.45
equalsMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…