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

Method test_assign_all_multiindex_coords

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

Source from the content-addressed store, hash-verified

5105 assert len(updated.coords) == 1
5106
5107 def test_assign_all_multiindex_coords(self) -> None:
5108 data = create_test_multiindex()
5109 actual = data.assign(x=range(4), level_1=range(4), level_2=range(4))
5110 # no error but multi-index dropped in favor of single indexes for each level
5111 assert (
5112 actual.xindexes["x"]
5113 is not actual.xindexes["level_1"]
5114 is not actual.xindexes["level_2"]
5115 )
5116
5117 def test_assign_coords_custom_index_side_effect(self) -> None:
5118 # test that assigning new coordinates do not reset other dimension coord indexes

Callers

nothing calls this directly

Calls 2

create_test_multiindexFunction · 0.85
assignMethod · 0.45

Tested by

no test coverage detected