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

Method test_merge_multiindex_level

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

Source from the content-addressed store, hash-verified

5148 assert "y" not in actual.xindexes
5149
5150 def test_merge_multiindex_level(self) -> None:
5151 data = create_test_multiindex()
5152
5153 other = Dataset({"level_1": ("x", [0, 1])})
5154 with pytest.raises(ValueError, match=r".*conflicting dimension sizes.*"):
5155 data.merge(other)
5156
5157 other = Dataset({"level_1": ("x", range(4))})
5158 with pytest.raises(
5159 ValueError, match=r"unable to determine.*coordinates or not.*"
5160 ):
5161 data.merge(other)
5162
5163 # `other` Dataset coordinates are ignored (bug or feature?)
5164 other = Dataset(coords={"level_1": ("x", range(4))})
5165 assert_identical(data.merge(other), data)
5166
5167 def test_setitem_original_non_unique_index(self) -> None:
5168 # regression test for GH943

Callers

nothing calls this directly

Calls 4

DatasetClass · 0.90
assert_identicalFunction · 0.90
create_test_multiindexFunction · 0.85
mergeMethod · 0.45

Tested by

no test coverage detected