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

Method test_get_index

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

Source from the content-addressed store, hash-verified

781 np.asarray(ds)
782
783 def test_get_index(self) -> None:
784 ds = Dataset({"foo": (("x", "y"), np.zeros((2, 3)))}, coords={"x": ["a", "b"]})
785 assert ds.get_index("x").equals(pd.Index(["a", "b"]))
786 assert ds.get_index("y").equals(pd.Index([0, 1, 2]))
787 with pytest.raises(KeyError):
788 ds.get_index("z")
789
790 def test_attr_access(self) -> None:
791 ds = Dataset(

Callers

nothing calls this directly

Calls 3

DatasetClass · 0.90
get_indexMethod · 0.80
equalsMethod · 0.45

Tested by

no test coverage detected