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

Method test_multiindex_level_as_coord

xarray/tests/test_plot.py:254–268  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

252 da.plot(y="f") # type: ignore[call-arg]
253
254 def test_multiindex_level_as_coord(self) -> None:
255 da = xr.DataArray(
256 np.arange(5),
257 dims="x",
258 coords=dict(a=("x", np.arange(5)), b=("x", np.arange(5, 10))),
259 )
260 da = da.set_index(x=["a", "b"])
261
262 for x in ["a", "b"]:
263 h = da.plot(x=x)[0] # type: ignore[call-arg]
264 assert_array_equal(h.get_xdata(), da[x].values)
265
266 for y in ["a", "b"]:
267 h = da.plot(y=y)[0] # type: ignore[call-arg]
268 assert_array_equal(h.get_ydata(), da[y].values)
269
270 # Test for bug in GH issue #2725
271 def test_infer_line_data(self) -> None:

Callers

nothing calls this directly

Calls 3

set_indexMethod · 0.95
arangeMethod · 0.80
plotMethod · 0.80

Tested by

no test coverage detected