MCPcopy
hub / github.com/pydata/xarray / test_assert_valid_xy

Function test_assert_valid_xy

xarray/tests/test_plot.py:3447–3459  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

3445
3446@requires_matplotlib
3447def test_assert_valid_xy() -> None:
3448 ds = xr.tutorial.scatter_example_dataset()
3449 darray = ds.A
3450
3451 # x is valid and should not error:
3452 _assert_valid_xy(darray=darray, xy="x", name="x")
3453
3454 # None should be valid as well even though it isn't in the valid list:
3455 _assert_valid_xy(darray=darray, xy=None, name="x")
3456
3457 # A hashable that is not valid should error:
3458 with pytest.raises(ValueError, match="x must be one of"):
3459 _assert_valid_xy(darray=darray, xy="error_now", name="x")
3460
3461
3462@requires_matplotlib

Callers

nothing calls this directly

Calls 1

_assert_valid_xyFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…