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

Function test_ffill_bfill_dask

xarray/tests/test_missing.py:471–505  ·  view source on GitHub ↗
(method)

Source from the content-addressed store, hash-verified

469@requires_dask
470@pytest.mark.parametrize("method", ["ffill", "bfill"])
471def test_ffill_bfill_dask(method):
472 da, _ = make_interpolate_example_data((40, 40), 0.5)
473 da = da.chunk({"x": 5})
474
475 dask_method = getattr(da, method)
476 numpy_method = getattr(da.compute(), method)
477 # unchunked axis
478 with raise_if_dask_computes():
479 actual = dask_method("time")
480 expected = numpy_method("time")
481 assert_equal(actual, expected)
482
483 # chunked axis
484 with raise_if_dask_computes():
485 actual = dask_method("x")
486 expected = numpy_method("x")
487 assert_equal(actual, expected)
488
489 # with limit
490 with raise_if_dask_computes():
491 actual = dask_method("time", limit=3)
492 expected = numpy_method("time", limit=3)
493 assert_equal(actual, expected)
494
495 # limit < axis size
496 with raise_if_dask_computes():
497 actual = dask_method("x", limit=2)
498 expected = numpy_method("x", limit=2)
499 assert_equal(actual, expected)
500
501 # limit > axis size
502 with raise_if_dask_computes():
503 actual = dask_method("x", limit=41)
504 expected = numpy_method("x", limit=41)
505 assert_equal(actual, expected)
506
507
508@requires_bottleneck

Callers

nothing calls this directly

Calls 5

raise_if_dask_computesFunction · 0.90
assert_equalFunction · 0.90
chunkMethod · 0.45
computeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…