MCPcopy Create free account
hub / github.com/dask/dask / test_time_rolling_methods

Function test_time_rolling_methods

dask/dataframe/tests/test_rolling.py:350–376  ·  view source on GitHub ↗
(method, args, window, check_less_precise)

Source from the content-addressed store, hash-verified

348)
349@pytest.mark.parametrize("window", ["1s", "2s", "3s", pd.offsets.Second(5)])
350def test_time_rolling_methods(method, args, window, check_less_precise):
351 if check_less_precise:
352 check_less_precise = {"atol": 1e-3, "rtol": 1e-3}
353 else:
354 check_less_precise = {}
355
356 # DataFrame
357 if method == "apply":
358 kwargs = {"raw": False}
359 else:
360 kwargs = {}
361 prolling = ts.rolling(window)
362 drolling = dts.rolling(window)
363 assert_eq(
364 getattr(prolling, method)(*args, **kwargs),
365 getattr(drolling, method)(*args, **kwargs),
366 **check_less_precise,
367 )
368
369 # Series
370 prolling = ts.a.rolling(window)
371 drolling = dts.a.rolling(window)
372 assert_eq(
373 getattr(prolling, method)(*args, **kwargs),
374 getattr(drolling, method)(*args, **kwargs),
375 **check_less_precise,
376 )
377
378
379@pytest.mark.parametrize("window", ["1s", "2s", "3s", pd.offsets.Second(5)])

Callers

nothing calls this directly

Calls 2

assert_eqFunction · 0.90
rollingMethod · 0.45

Tested by

no test coverage detected