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

Method test_constructor_custom_index

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

Source from the content-addressed store, hash-verified

675 Dataset(coords={"x": midx})
676
677 def test_constructor_custom_index(self) -> None:
678 class CustomIndex(Index): ...
679
680 coords = Coordinates(
681 coords={"x": ("x", [1, 2, 3])}, indexes={"x": CustomIndex()}
682 )
683 ds = Dataset(coords=coords)
684 assert isinstance(ds.xindexes["x"], CustomIndex)
685
686 # test coordinate variables copied
687 assert ds.variables["x"] is not coords.variables["x"]
688
689 @pytest.mark.filterwarnings("ignore:return type")
690 def test_properties(self) -> None:

Callers

nothing calls this directly

Calls 3

CoordinatesClass · 0.90
DatasetClass · 0.90
CustomIndexClass · 0.70

Tested by

no test coverage detected