-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
/
Copy pathconversion.pxd
59 lines (46 loc) · 1.7 KB
/
conversion.pxd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
from cpython.datetime cimport (
datetime,
tzinfo,
)
from numpy cimport (
int32_t,
int64_t,
ndarray,
)
from pandas._libs.tslibs.np_datetime cimport (
NPY_DATETIMEUNIT,
npy_datetimestruct,
)
from pandas._libs.tslibs.timestamps cimport _Timestamp
from pandas._libs.tslibs.timezones cimport tz_compare
cdef class _TSObject:
cdef readonly:
npy_datetimestruct dts # npy_datetimestruct
int64_t value # numpy dt64
tzinfo tzinfo
bint fold
NPY_DATETIMEUNIT creso
cdef int64_t ensure_reso(
self, NPY_DATETIMEUNIT creso, val=*, bint round_ok=*
) except? -1
cdef _TSObject convert_to_tsobject(object ts, tzinfo tz, str unit,
bint dayfirst, bint yearfirst,
int32_t nanos=*)
cdef _TSObject convert_datetime_to_tsobject(datetime ts, tzinfo tz,
int32_t nanos=*,
NPY_DATETIMEUNIT reso=*)
cdef _TSObject convert_str_to_tsobject(str ts, tzinfo tz,
bint dayfirst=*,
bint yearfirst=*)
cdef int64_t get_datetime64_nanos(object val, NPY_DATETIMEUNIT reso) except? -1
cpdef datetime localize_pydatetime(datetime dt, tzinfo tz)
cdef int64_t cast_from_unit(object ts, str unit, NPY_DATETIMEUNIT out_reso=*) except? -1
cdef (int64_t, int) precision_from_unit(
NPY_DATETIMEUNIT in_reso, NPY_DATETIMEUNIT out_reso=*
)
cdef maybe_localize_tso(_TSObject obj, tzinfo tz, NPY_DATETIMEUNIT reso)
cdef int64_t parse_pydatetime(
datetime val,
npy_datetimestruct *dts,
NPY_DATETIMEUNIT creso,
) except? -1