@@ -44,6 +44,12 @@ cdef bint PY2 = version_info[0] == 2
44
44
45
45
cdef int64_t NPY_NAT = util.get_nat()
46
46
47
+ cdef int US_RESO = frequencies.US_RESO
48
+ cdef int MS_RESO = frequencies.MS_RESO
49
+ cdef int S_RESO = frequencies.S_RESO
50
+ cdef int T_RESO = frequencies.T_RESO
51
+ cdef int H_RESO = frequencies.H_RESO
52
+ cdef int D_RESO = frequencies.D_RESO
47
53
48
54
cdef extern from " period_helper.h" :
49
55
ctypedef struct date_info:
@@ -463,7 +469,7 @@ cpdef resolution(ndarray[int64_t] stamps, tz=None):
463
469
cdef:
464
470
Py_ssize_t i, n = len (stamps)
465
471
pandas_datetimestruct dts
466
- int reso = frequencies. D_RESO, curr_reso
472
+ int reso = D_RESO, curr_reso
467
473
468
474
if tz is not None :
469
475
tz = maybe_get_tz(tz)
@@ -482,20 +488,20 @@ cpdef resolution(ndarray[int64_t] stamps, tz=None):
482
488
cdef inline int _reso_stamp(pandas_datetimestruct * dts):
483
489
if dts.us != 0 :
484
490
if dts.us % 1000 == 0 :
485
- return frequencies. MS_RESO
486
- return frequencies. US_RESO
491
+ return MS_RESO
492
+ return US_RESO
487
493
elif dts.sec != 0 :
488
- return frequencies. S_RESO
494
+ return S_RESO
489
495
elif dts.min != 0 :
490
- return frequencies. T_RESO
496
+ return T_RESO
491
497
elif dts.hour != 0 :
492
- return frequencies. H_RESO
493
- return frequencies. D_RESO
498
+ return H_RESO
499
+ return D_RESO
494
500
495
501
cdef _reso_local(ndarray[int64_t] stamps, object tz):
496
502
cdef:
497
503
Py_ssize_t n = len (stamps)
498
- int reso = frequencies. D_RESO, curr_reso
504
+ int reso = D_RESO, curr_reso
499
505
ndarray[int64_t] trans, deltas, pos
500
506
pandas_datetimestruct dts
501
507
0 commit comments