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

Method test_align_conflicting_indexes

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

Source from the content-addressed store, hash-verified

2716 align(a, c)
2717
2718 def test_align_conflicting_indexes(self) -> None:
2719 class CustomIndex(PandasIndex): ...
2720
2721 a = Dataset(coords={"xb": ("x", [3, 4])}).set_xindex("xb")
2722 b = Dataset(coords={"xb": ("x", [3])}).set_xindex("xb", CustomIndex)
2723
2724 with pytest.raises(AlignmentError, match=r"cannot align.*conflicting indexes"):
2725 align(a, b)
2726
2727 def test_align_non_unique(self) -> None:
2728 x = Dataset({"foo": ("x", [3, 4, 5]), "x": [0, 0, 1]})

Callers

nothing calls this directly

Calls 3

DatasetClass · 0.90
alignFunction · 0.90
set_xindexMethod · 0.45

Tested by

no test coverage detected