MCPcopy Create free account
hub / github.com/pydata/xarray / test_polyfit_polyval_integration

Function test_polyfit_polyval_integration

xarray/tests/test_computation.py:2515–2527  ·  view source on GitHub ↗
(
    use_dask: bool, x: xr.DataArray, y: xr.DataArray
)

Source from the content-addressed store, hash-verified

2513 ],
2514)
2515def test_polyfit_polyval_integration(
2516 use_dask: bool, x: xr.DataArray, y: xr.DataArray
2517) -> None:
2518 y.coords["x"] = x
2519 if use_dask:
2520 if not has_dask:
2521 pytest.skip("requires dask")
2522 y = y.chunk({"x": 2})
2523
2524 fit = y.polyfit(dim="x", deg=2)
2525 evaluated = xr.polyval(y.x, fit.polyfit_coefficients)
2526 expected = y.transpose(*evaluated.dims)
2527 xr.testing.assert_allclose(evaluated.variable, expected.variable)
2528
2529
2530@pytest.mark.parametrize("use_dask", [False, True])

Callers

nothing calls this directly

Calls 3

chunkMethod · 0.45
polyfitMethod · 0.45
transposeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…