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

Function test_polyval_degree_dim_checks

xarray/tests/test_computation.py:2472–2478  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2470
2471
2472def test_polyval_degree_dim_checks() -> None:
2473 x = xr.DataArray([1, 2, 3], dims="x")
2474 coeffs = xr.DataArray([2, 3, 4], dims="degree", coords={"degree": [0, 1, 2]})
2475 with pytest.raises(ValueError):
2476 xr.polyval(x, coeffs.drop_vars("degree"))
2477 with pytest.raises(ValueError):
2478 xr.polyval(x, coeffs.assign_coords(degree=coeffs.degree.astype(float)))
2479
2480
2481@pytest.mark.parametrize(

Callers

nothing calls this directly

Calls 3

drop_varsMethod · 0.95
assign_coordsMethod · 0.45
astypeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…