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

Function test_timedelta_to_numeric

xarray/tests/test_duck_array_ops.py:1084–1089  ·  view source on GitHub ↗
(td, time_unit: PDDatetimeUnitOptions)

Source from the content-addressed store, hash-verified

1082 "td", [dt.timedelta(days=1), np.timedelta64(1, "D"), pd.Timedelta(1, "D"), "1 day"]
1083)
1084def test_timedelta_to_numeric(td, time_unit: PDDatetimeUnitOptions):
1085 # Scalar input
1086 out = timedelta_to_numeric(td, time_unit)
1087 expected = _NS_PER_TIME_DELTA["D"] / _NS_PER_TIME_DELTA[time_unit]
1088 np.testing.assert_allclose(out, expected)
1089 assert isinstance(out, float)
1090
1091
1092@pytest.mark.parametrize("use_dask", [True, False])

Callers

nothing calls this directly

Calls 1

timedelta_to_numericFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…