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

Function test_py_timedelta_to_float

xarray/tests/test_duck_array_ops.py:1040–1047  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1038
1039
1040def test_py_timedelta_to_float():
1041 assert py_timedelta_to_float(dt.timedelta(days=1), "ns") == 86400 * 1e9
1042 assert py_timedelta_to_float(dt.timedelta(days=1e6), "ps") == 86400 * 1e18
1043 assert py_timedelta_to_float(dt.timedelta(days=1e6), "ns") == 86400 * 1e15
1044 assert py_timedelta_to_float(dt.timedelta(days=1e6), "us") == 86400 * 1e12
1045 assert py_timedelta_to_float(dt.timedelta(days=1e6), "ms") == 86400 * 1e9
1046 assert py_timedelta_to_float(dt.timedelta(days=1e6), "s") == 86400 * 1e6
1047 assert py_timedelta_to_float(dt.timedelta(days=1e6), "D") == 1e6
1048
1049
1050@pytest.mark.parametrize("np_dt_unit", ["D", "h", "m", "s", "ms", "us", "ns"])

Callers

nothing calls this directly

Calls 1

py_timedelta_to_floatFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…