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

Function test_polyval

xarray/tests/test_computation.py:2418–2433  ·  view source on GitHub ↗
(
    use_dask: bool,
    x: xr.DataArray | xr.Dataset,
    coeffs: xr.DataArray | xr.Dataset,
    expected: xr.DataArray | xr.Dataset,
)

Source from the content-addressed store, hash-verified

2416 ],
2417)
2418def test_polyval(
2419 use_dask: bool,
2420 x: xr.DataArray | xr.Dataset,
2421 coeffs: xr.DataArray | xr.Dataset,
2422 expected: xr.DataArray | xr.Dataset,
2423) -> None:
2424 if use_dask:
2425 if not has_dask:
2426 pytest.skip("requires dask")
2427 coeffs = coeffs.chunk({"degree": 2})
2428 x = x.chunk({"x": 2})
2429
2430 with raise_if_dask_computes():
2431 actual = xr.polyval(coord=x, coeffs=coeffs)
2432
2433 xr.testing.assert_allclose(actual, expected)
2434
2435
2436@requires_cftime

Callers

nothing calls this directly

Calls 2

raise_if_dask_computesFunction · 0.90
chunkMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…