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

Method test_align_indexes

xarray/tests/test_dataset.py:2696–2703  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

2694 assert_identical(expected_y2, y2)
2695
2696 def test_align_indexes(self) -> None:
2697 x = Dataset({"foo": DataArray([1, 2, 3], dims="x", coords=[("x", [1, 2, 3])])})
2698 (x2,) = align(x, indexes={"x": [2, 3, 1]})
2699 expected_x2 = Dataset(
2700 {"foo": DataArray([2, 3, 1], dims="x", coords={"x": [2, 3, 1]})}
2701 )
2702
2703 assert_identical(expected_x2, x2)
2704
2705 def test_align_multiple_indexes_common_dim(self) -> None:
2706 a = Dataset(coords={"x": [1, 2], "xb": ("x", [3, 4])}).set_xindex("xb")

Callers

nothing calls this directly

Calls 4

DatasetClass · 0.90
DataArrayClass · 0.90
alignFunction · 0.90
assert_identicalFunction · 0.90

Tested by

no test coverage detected