timedeltas.pxd 966 B

12345678910111213141516171819202122232425262728
  1. from cpython.datetime cimport timedelta
  2. from numpy cimport int64_t
  3. from .np_datetime cimport NPY_DATETIMEUNIT
  4. # Exposed for tslib, not intended for outside use.
  5. cpdef int64_t delta_to_nanoseconds(
  6. delta, NPY_DATETIMEUNIT reso=*, bint round_ok=*
  7. ) except? -1
  8. cdef convert_to_timedelta64(object ts, str unit)
  9. cdef bint is_any_td_scalar(object obj)
  10. cdef class _Timedelta(timedelta):
  11. cdef readonly:
  12. int64_t _value # nanoseconds
  13. bint _is_populated # are my components populated
  14. int64_t _d, _h, _m, _s, _ms, _us, _ns
  15. NPY_DATETIMEUNIT _creso
  16. cpdef timedelta to_pytimedelta(_Timedelta self)
  17. cdef bint _has_ns(self)
  18. cdef bint _is_in_pytimedelta_bounds(self)
  19. cdef _ensure_components(_Timedelta self)
  20. cdef bint _compare_mismatched_resos(self, _Timedelta other, op)
  21. cdef _Timedelta _as_creso(self, NPY_DATETIMEUNIT reso, bint round_ok=*)
  22. cpdef _maybe_cast_to_matching_resos(self, _Timedelta other)