@@ -28,9 +28,9 @@ This file is derived from NumPy 1.7. See NUMPY_LICENSE.txt
28
28
#define PyInt_AsLong PyLong_AsLong
29
29
#endif
30
30
31
- const pandas_datetimestruct _NS_MIN_DTS = {
31
+ const npy_datetimestruct _NS_MIN_DTS = {
32
32
1677 , 9 , 21 , 0 , 12 , 43 , 145225 , 0 , 0 };
33
- const pandas_datetimestruct _NS_MAX_DTS = {
33
+ const npy_datetimestruct _NS_MAX_DTS = {
34
34
2262 , 4 , 11 , 23 , 47 , 16 , 854775 , 807000 , 0 };
35
35
36
36
@@ -62,7 +62,7 @@ int dayofweek(int y, int m, int d) {
62
62
* Adjusts a datetimestruct based on a minutes offset. Assumes
63
63
* the current values are valid.g
64
64
*/
65
- void add_minutes_to_datetimestruct (pandas_datetimestruct * dts , int minutes ) {
65
+ void add_minutes_to_datetimestruct (npy_datetimestruct * dts , int minutes ) {
66
66
int isleap ;
67
67
68
68
/* MINUTES */
@@ -111,7 +111,7 @@ void add_minutes_to_datetimestruct(pandas_datetimestruct *dts, int minutes) {
111
111
/*
112
112
* Calculates the days offset from the 1970 epoch.
113
113
*/
114
- npy_int64 get_datetimestruct_days (const pandas_datetimestruct * dts ) {
114
+ npy_int64 get_datetimestruct_days (const npy_datetimestruct * dts ) {
115
115
int i , month ;
116
116
npy_int64 year , days = 0 ;
117
117
const int * month_lengths ;
@@ -211,7 +211,7 @@ static npy_int64 days_to_yearsdays(npy_int64 *days_) {
211
211
* Adjusts a datetimestruct based on a seconds offset. Assumes
212
212
* the current values are valid.
213
213
*/
214
- NPY_NO_EXPORT void add_seconds_to_datetimestruct (pandas_datetimestruct * dts ,
214
+ NPY_NO_EXPORT void add_seconds_to_datetimestruct (npy_datetimestruct * dts ,
215
215
int seconds ) {
216
216
int minutes ;
217
217
@@ -236,7 +236,7 @@ NPY_NO_EXPORT void add_seconds_to_datetimestruct(pandas_datetimestruct *dts,
236
236
* offset from 1970.
237
237
*/
238
238
static void set_datetimestruct_days (npy_int64 days ,
239
- pandas_datetimestruct * dts ) {
239
+ npy_datetimestruct * dts ) {
240
240
const int * month_lengths ;
241
241
int i ;
242
242
@@ -255,10 +255,10 @@ static void set_datetimestruct_days(npy_int64 days,
255
255
}
256
256
257
257
/*
258
- * Compares two pandas_datetimestruct objects chronologically
258
+ * Compares two npy_datetimestruct objects chronologically
259
259
*/
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 ) {
262
262
if (a -> year > b -> year ) {
263
263
return 1 ;
264
264
} else if (a -> year < b -> year ) {
@@ -319,7 +319,7 @@ int cmp_pandas_datetimestruct(const pandas_datetimestruct *a,
319
319
/*
320
320
*
321
321
* 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)
323
323
* to convert to UTC time.
324
324
*
325
325
* While the C API has PyDate_* and PyDateTime_* functions, the following
@@ -331,12 +331,12 @@ int cmp_pandas_datetimestruct(const pandas_datetimestruct *a,
331
331
* if obj doesn't have the needed date or datetime attributes.
332
332
*/
333
333
int convert_pydatetime_to_datetimestruct (PyObject * obj ,
334
- pandas_datetimestruct * out ) {
334
+ npy_datetimestruct * out ) {
335
335
PyObject * tmp ;
336
336
int isleap ;
337
337
338
338
/* Initialize the output to all zeros */
339
- memset (out , 0 , sizeof (pandas_datetimestruct ));
339
+ memset (out , 0 , sizeof (npy_datetimestruct ));
340
340
out -> month = 1 ;
341
341
out -> day = 1 ;
342
342
@@ -512,16 +512,16 @@ int convert_pydatetime_to_datetimestruct(PyObject *obj,
512
512
return -1 ;
513
513
}
514
514
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 ) {
517
517
npy_datetime result = NPY_DATETIME_NAT ;
518
518
519
519
convert_datetimestruct_to_datetime (fr , d , & result );
520
520
return result ;
521
521
}
522
522
523
523
void pandas_datetime_to_datetimestruct (npy_datetime val , NPY_DATETIMEUNIT fr ,
524
- pandas_datetimestruct * result ) {
524
+ npy_datetimestruct * result ) {
525
525
convert_datetime_to_datetimestruct (fr , val , result );
526
526
}
527
527
@@ -539,7 +539,7 @@ void pandas_timedelta_to_timedeltastruct(npy_timedelta val,
539
539
* Returns 0 on success, -1 on failure.
540
540
*/
541
541
int convert_datetimestruct_to_datetime (NPY_DATETIMEUNIT base ,
542
- const pandas_datetimestruct * dts ,
542
+ const npy_datetimestruct * dts ,
543
543
npy_datetime * out ) {
544
544
npy_datetime ret ;
545
545
@@ -643,11 +643,11 @@ int convert_datetimestruct_to_datetime(NPY_DATETIMEUNIT base,
643
643
*/
644
644
int convert_datetime_to_datetimestruct (NPY_DATETIMEUNIT base ,
645
645
npy_datetime dt ,
646
- pandas_datetimestruct * out ) {
646
+ npy_datetimestruct * out ) {
647
647
npy_int64 perday ;
648
648
649
649
/* Initialize the output to all zeros */
650
- memset (out , 0 , sizeof (pandas_datetimestruct ));
650
+ memset (out , 0 , sizeof (npy_datetimestruct ));
651
651
out -> year = 1970 ;
652
652
out -> month = 1 ;
653
653
out -> day = 1 ;
0 commit comments