@@ -554,34 +554,34 @@ cdef class DayOffset(_Offset):
554
554
self .t += (4 - self .dow) * us_in_day
555
555
self .dow = 4
556
556
557
- cdef ndarray[int64_t] _generate_range(_Offset offset, Py_ssize_t periods):
558
- """
559
- Generate timestamps according to offset.
560
- """
561
- cdef:
562
- Py_ssize_t i
563
- ndarray[int64_t] dtindex
564
-
565
- dtindex = np.empty(periods, np.int64)
566
- for i in range (periods):
567
- dtindex[i] = offset._ts()
568
- offset.next()
569
- return dtindex
570
-
571
- cdef int64_t _count_range(_Offset offset, object end):
572
- """
573
- Count timestamps in range according to offset up to (and including)
574
- end time.
575
- """
576
- cdef:
577
- Py_ssize_t i= 0
578
- _TSObject e
579
-
580
- e = convert_to_tsobject(end)
581
- while offset._ts() <= e.value:
582
- i += 1
583
- offset.next()
584
- return i
557
+ # cdef ndarray[int64_t] _generate_range(_Offset offset, Py_ssize_t periods):
558
+ # """
559
+ # Generate timestamps according to offset.
560
+ # """
561
+ # cdef:
562
+ # Py_ssize_t i
563
+ # ndarray[int64_t] dtindex
564
+
565
+ # dtindex = np.empty(periods, np.int64)
566
+ # for i in range(periods):
567
+ # dtindex[i] = offset._ts()
568
+ # offset.next()
569
+ # return dtindex
570
+
571
+ # cdef int64_t _count_range(_Offset offset, object end):
572
+ # """
573
+ # Count timestamps in range according to offset up to (and including)
574
+ # end time.
575
+ # """
576
+ # cdef:
577
+ # Py_ssize_t i=0
578
+ # _TSObject e
579
+
580
+ # e = convert_to_tsobject(end)
581
+ # while offset._ts() <= e.value:
582
+ # i += 1
583
+ # offset.next()
584
+ # return i
585
585
586
586
# Conversion routines
587
587
# ------------------------------------------------------------------------------
@@ -1023,6 +1023,18 @@ cpdef int64_t skts_ordinal_to_dt64(long skts_ordinal, int base, long mult):
1023
1023
def skts_ordinal_to_string (long value , int base , long mult ):
1024
1024
return < object > interval_to_string(remove_mult(value, mult), base)
1025
1025
1026
+ def skts_strftime (long value , int freq , long mult , object fmt ):
1027
+ cdef:
1028
+ PyObject * ptr
1029
+
1030
+ value = remove_mult(value, mult)
1031
+ ptr = interval_to_string2(value, freq, < char * > fmt)
1032
+
1033
+ if ptr == NULL :
1034
+ raise ValueError (" Could not create string with fmt '%s '" % fmt)
1035
+
1036
+ return < object > ptr
1037
+
1026
1038
# interval accessors
1027
1039
1028
1040
ctypedef int (* accessor)(long ordinal, int base) except - 1
0 commit comments