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

Method test_to_index_variable_copy

xarray/tests/test_variable.py:2721–2728  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

2719 super().test_coarsen_2d() # type: ignore[misc]
2720
2721 def test_to_index_variable_copy(self) -> None:
2722 # to_index_variable should return a copy
2723 # https://github.com/pydata/xarray/issues/6931
2724 a = IndexVariable("x", ["a"])
2725 b = a.to_index_variable()
2726 assert a is not b
2727 b.dims = ("y",)
2728 assert a.dims == ("x",)
2729
2730
2731class TestAsCompatibleData(Generic[T_DuckArray]):

Callers

nothing calls this directly

Calls 2

to_index_variableMethod · 0.95
IndexVariableClass · 0.90

Tested by

no test coverage detected