@@ -28,9 +28,9 @@ This file is derived from NumPy 1.7. See NUMPY_LICENSE.txt
2828#define PyInt_AsLong PyLong_AsLong
2929#endif
3030
31- const pandas_datetimestruct _NS_MIN_DTS = {
31+ const npy_datetimestruct _NS_MIN_DTS = {
3232 1677 , 9 , 21 , 0 , 12 , 43 , 145225 , 0 , 0 };
33- const pandas_datetimestruct _NS_MAX_DTS = {
33+ const npy_datetimestruct _NS_MAX_DTS = {
3434 2262 , 4 , 11 , 23 , 47 , 16 , 854775 , 807000 , 0 };
3535
3636
@@ -62,7 +62,7 @@ int dayofweek(int y, int m, int d) {
6262 * Adjusts a datetimestruct based on a minutes offset. Assumes
6363 * the current values are valid.g
6464 */
65- void add_minutes_to_datetimestruct (pandas_datetimestruct * dts , int minutes ) {
65+ void add_minutes_to_datetimestruct (npy_datetimestruct * dts , int minutes ) {
6666 int isleap ;
6767
6868 /* MINUTES */
@@ -111,7 +111,7 @@ void add_minutes_to_datetimestruct(pandas_datetimestruct *dts, int minutes) {
111111/*
112112 * Calculates the days offset from the 1970 epoch.
113113 */
114- npy_int64 get_datetimestruct_days (const pandas_datetimestruct * dts ) {
114+ npy_int64 get_datetimestruct_days (const npy_datetimestruct * dts ) {
115115 int i , month ;
116116 npy_int64 year , days = 0 ;
117117 const int * month_lengths ;
@@ -211,7 +211,7 @@ static npy_int64 days_to_yearsdays(npy_int64 *days_) {
211211 * Adjusts a datetimestruct based on a seconds offset. Assumes
212212 * the current values are valid.
213213 */
214- NPY_NO_EXPORT void add_seconds_to_datetimestruct (pandas_datetimestruct * dts ,
214+ NPY_NO_EXPORT void add_seconds_to_datetimestruct (npy_datetimestruct * dts ,
215215 int seconds ) {
216216 int minutes ;
217217
@@ -236,7 +236,7 @@ NPY_NO_EXPORT void add_seconds_to_datetimestruct(pandas_datetimestruct *dts,
236236 * offset from 1970.
237237 */
238238static void set_datetimestruct_days (npy_int64 days ,
239- pandas_datetimestruct * dts ) {
239+ npy_datetimestruct * dts ) {
240240 const int * month_lengths ;
241241 int i ;
242242
@@ -255,10 +255,10 @@ static void set_datetimestruct_days(npy_int64 days,
255255}
256256
257257/*
258- * Compares two pandas_datetimestruct objects chronologically
258+ * Compares two npy_datetimestruct objects chronologically
259259 */
260- int cmp_pandas_datetimestruct (const pandas_datetimestruct * a ,
261- const pandas_datetimestruct * b ) {
260+ int cmp_npy_datetimestruct (const npy_datetimestruct * a ,
261+ const npy_datetimestruct * b ) {
262262 if (a -> year > b -> year ) {
263263 return 1 ;
264264 } else if (a -> year < b -> year ) {
@@ -319,7 +319,7 @@ int cmp_pandas_datetimestruct(const pandas_datetimestruct *a,
319319/*
320320 *
321321 * Tests for and converts a Python datetime.datetime or datetime.date
322- * object into a NumPy pandas_datetimestruct . Uses tzinfo (if present)
322+ * object into a NumPy npy_datetimestruct . Uses tzinfo (if present)
323323 * to convert to UTC time.
324324 *
325325 * While the C API has PyDate_* and PyDateTime_* functions, the following
@@ -331,12 +331,12 @@ int cmp_pandas_datetimestruct(const pandas_datetimestruct *a,
331331 * if obj doesn't have the needed date or datetime attributes.
332332 */
333333int convert_pydatetime_to_datetimestruct (PyObject * obj ,
334- pandas_datetimestruct * out ) {
334+ npy_datetimestruct * out ) {
335335 PyObject * tmp ;
336336 int isleap ;
337337
338338 /* Initialize the output to all zeros */
339- memset (out , 0 , sizeof (pandas_datetimestruct ));
339+ memset (out , 0 , sizeof (npy_datetimestruct ));
340340 out -> month = 1 ;
341341 out -> day = 1 ;
342342
@@ -512,16 +512,16 @@ int convert_pydatetime_to_datetimestruct(PyObject *obj,
512512 return -1 ;
513513}
514514
515- npy_datetime pandas_datetimestruct_to_datetime (NPY_DATETIMEUNIT fr ,
516- pandas_datetimestruct * d ) {
515+ npy_datetime npy_datetimestruct_to_datetime (NPY_DATETIMEUNIT fr ,
516+ npy_datetimestruct * d ) {
517517 npy_datetime result = NPY_DATETIME_NAT ;
518518
519519 convert_datetimestruct_to_datetime (fr , d , & result );
520520 return result ;
521521}
522522
523523void pandas_datetime_to_datetimestruct (npy_datetime val , NPY_DATETIMEUNIT fr ,
524- pandas_datetimestruct * result ) {
524+ npy_datetimestruct * result ) {
525525 convert_datetime_to_datetimestruct (fr , val , result );
526526}
527527
@@ -539,7 +539,7 @@ void pandas_timedelta_to_timedeltastruct(npy_timedelta val,
539539 * Returns 0 on success, -1 on failure.
540540 */
541541int convert_datetimestruct_to_datetime (NPY_DATETIMEUNIT base ,
542- const pandas_datetimestruct * dts ,
542+ const npy_datetimestruct * dts ,
543543 npy_datetime * out ) {
544544 npy_datetime ret ;
545545
@@ -643,11 +643,11 @@ int convert_datetimestruct_to_datetime(NPY_DATETIMEUNIT base,
643643 */
644644int convert_datetime_to_datetimestruct (NPY_DATETIMEUNIT base ,
645645 npy_datetime dt ,
646- pandas_datetimestruct * out ) {
646+ npy_datetimestruct * out ) {
647647 npy_int64 perday ;
648648
649649 /* Initialize the output to all zeros */
650- memset (out , 0 , sizeof (pandas_datetimestruct ));
650+ memset (out , 0 , sizeof (npy_datetimestruct ));
651651 out -> year = 1970 ;
652652 out -> month = 1 ;
653653 out -> day = 1 ;
0 commit comments