|
1 | 1 | from numpy cimport int64_t
|
2 | 2 | from cpython cimport PyObject
|
3 | 3 |
|
| 4 | + |
| 5 | +cdef extern from "stdint.h": |
| 6 | + enum: INT64_MIN |
| 7 | + enum: INT32_MIN |
| 8 | + |
| 9 | + |
| 10 | + |
4 | 11 | cdef extern from "datetime.h":
|
5 | 12 |
|
6 | 13 | ctypedef class datetime.date [object PyDateTime_Date]:
|
@@ -128,36 +135,32 @@ cdef extern from "period.h":
|
128 | 135 |
|
129 | 136 | ctypedef int64_t (*freq_conv_func)(int64_t, char, asfreq_info*)
|
130 | 137 |
|
131 |
| - int64_t asfreq(int64_t dtordinal, int freq1, int freq2, char relation) except -1 |
132 |
| - freq_conv_func get_asfreq_func(int fromFreq, int toFreq, int forConvert) |
| 138 | + int64_t asfreq(int64_t dtordinal, int freq1, int freq2, char relation) except INT32_MIN |
| 139 | + freq_conv_func get_asfreq_func(int fromFreq, int toFreq) |
133 | 140 | void get_asfreq_info(int fromFreq, int toFreq, asfreq_info *af_info)
|
134 | 141 |
|
135 | 142 | int64_t get_period_ordinal(int year, int month, int day,
|
136 | 143 | int hour, int minute, int second,
|
137 |
| - int freq) except -1 |
| 144 | + int freq) except INT32_MIN |
138 | 145 |
|
139 |
| - int64_t get_python_ordinal(int64_t period_ordinal, int freq) except -1 |
| 146 | + int64_t get_python_ordinal(int64_t period_ordinal, int freq) except INT32_MIN |
140 | 147 |
|
141 | 148 | char *skts_strftime(int64_t value, int freq, PyObject *args)
|
142 | 149 | char *period_to_string(int64_t value, int freq)
|
143 | 150 | char *period_to_string2(int64_t value, int freq, char *fmt)
|
144 | 151 |
|
145 |
| - int get_date_info(int64_t ordinal, int freq, date_info *dinfo) except -1 |
| 152 | + int get_date_info(int64_t ordinal, int freq, date_info *dinfo) except INT32_MIN |
146 | 153 | double getAbsTime(int, int64_t, int64_t)
|
147 | 154 |
|
148 |
| - int pyear(int64_t ordinal, int freq) except -1 |
149 |
| - int pqyear(int64_t ordinal, int freq) except -1 |
150 |
| - int pquarter(int64_t ordinal, int freq) except -1 |
151 |
| - int pmonth(int64_t ordinal, int freq) except -1 |
152 |
| - int pday(int64_t ordinal, int freq) except -1 |
153 |
| - int pweekday(int64_t ordinal, int freq) except -1 |
154 |
| - int pday_of_week(int64_t ordinal, int freq) except -1 |
155 |
| - int pday_of_year(int64_t ordinal, int freq) except -1 |
156 |
| - int pweek(int64_t ordinal, int freq) except -1 |
157 |
| - int phour(int64_t ordinal, int freq) except -1 |
158 |
| - int pminute(int64_t ordinal, int freq) except -1 |
159 |
| - int psecond(int64_t ordinal, int freq) except -1 |
160 |
| - |
161 |
| -cdef extern from "stdint.h": |
162 |
| - enum: INT64_MIN |
163 |
| - |
| 155 | + int pyear(int64_t ordinal, int freq) except INT32_MIN |
| 156 | + int pqyear(int64_t ordinal, int freq) except INT32_MIN |
| 157 | + int pquarter(int64_t ordinal, int freq) except INT32_MIN |
| 158 | + int pmonth(int64_t ordinal, int freq) except INT32_MIN |
| 159 | + int pday(int64_t ordinal, int freq) except INT32_MIN |
| 160 | + int pweekday(int64_t ordinal, int freq) except INT32_MIN |
| 161 | + int pday_of_week(int64_t ordinal, int freq) except INT32_MIN |
| 162 | + int pday_of_year(int64_t ordinal, int freq) except INT32_MIN |
| 163 | + int pweek(int64_t ordinal, int freq) except INT32_MIN |
| 164 | + int phour(int64_t ordinal, int freq) except INT32_MIN |
| 165 | + int pminute(int64_t ordinal, int freq) except INT32_MIN |
| 166 | + int psecond(int64_t ordinal, int freq) except INT32_MIN |
0 commit comments