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

Method test_align

xarray/tests/test_coordinates.py:193–207  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

191 assert source_ndarray(v0.data) is not source_ndarray(v1.data)
192
193 def test_align(self) -> None:
194 coords = Coordinates(coords={"x": [0, 1, 2]})
195
196 left = coords
197
198 # test Coordinates._reindex_callback
199 right = coords.to_dataset().isel(x=[0, 1]).coords
200 left2, right2 = align(left, right, join="inner")
201 assert_identical(left2, right2)
202
203 # test Coordinates._overwrite_indexes
204 right.update({"x": ("x", [4, 5, 6])})
205 left2, right2 = align(left, right, join="override")
206 assert_identical(left2, left)
207 assert_identical(left2, right2)
208
209 def test_dataset_from_coords_with_multidim_var_same_name(self):
210 # regression test for GH #8883

Callers

nothing calls this directly

Calls 6

to_datasetMethod · 0.95
CoordinatesClass · 0.90
alignFunction · 0.90
assert_identicalFunction · 0.90
iselMethod · 0.45
updateMethod · 0.45

Tested by

no test coverage detected