Permalink
Browse files

c_datearray

* Add shortcuts asarray/asndarray/...
* Renamed init/update_datetime_descr to init/update_descr_metadata
* Add date information methods
* Add tovalues/toordubals/tolist methods
* Add start_date/end_date methods
* Add fill_missing_dates method
* Add convert method
  • Loading branch information...
1 parent e12677f commit 9937aa30ee393d847607ad27fd42c08aebe97417 @pierregm pierregm committed Aug 7, 2010
@@ -6,7 +6,9 @@
typedef struct {
- int has_dups, has_missing, is_chrono;
+ int has_dups;
+ int has_missing;
+ int is_chrono;
} ts_timestatus;
typedef struct {
@@ -33,6 +33,49 @@ PyObject *set_callback_DateTimeFromString(PyObject *, PyObject *);
PyObject * PyDateTime_FromFreqAndValue(npy_int64, ts_metadata *);
+
+#include "c_convert.h"
+PyObject *_loop_get_year(npy_int64, int, conversion_function,
+ ts_metadata *, ts_datetimestruct *);
+PyObject *_loop_get_qyear(npy_int64, int, conversion_function,
+ ts_metadata *, ts_datetimestruct *);
+PyObject *_loop_get_qyear_from_qtr(npy_int64, int, conversion_function,
+ ts_metadata *, ts_datetimestruct *);
+PyObject *_loop_get_quarter(npy_int64, int, conversion_function,
+ ts_metadata *, ts_datetimestruct *);
+PyObject *_loop_get_quarter_from_qtr(npy_int64, int, conversion_function,
+ ts_metadata *, ts_datetimestruct *);
+PyObject *_loop_get_month(npy_int64, int, conversion_function,
+ ts_metadata *, ts_datetimestruct *);
+PyObject *_loop_get_day(npy_int64, int, conversion_function,
+ ts_metadata *, ts_datetimestruct *);
+PyObject *_loop_get_day_of_week(npy_int64, int, conversion_function,
+ ts_metadata *, ts_datetimestruct *);
+PyObject *_loop_get_day_of_year(npy_int64, int, conversion_function,
+ ts_metadata *, ts_datetimestruct *);
+PyObject *_loop_get_week(npy_int64, int, conversion_function,
+ ts_metadata *, ts_datetimestruct *);
+PyObject *_loop_get_hour(npy_int64, int, conversion_function,
+ ts_metadata *, ts_datetimestruct *);
+PyObject *_loop_get_minute(npy_int64, int, conversion_function,
+ ts_metadata *, ts_datetimestruct *);
+PyObject *_loop_get_second(npy_int64, int, conversion_function,
+ ts_metadata *, ts_datetimestruct *);
+PyObject *_loop_get_ordinal(npy_int64, int, conversion_function,
+ ts_metadata *, ts_datetimestruct *);
+PyObject *_loop_get_datetime(npy_int64, int, conversion_function, ts_metadata *,
+ ts_datetimestruct *);
+
+
+
+int __skip_periods_year(int);
+int __skip_periods_quarter(int);
+int __skip_periods_month(int);
+int __skip_periods_day(int);
+int __skip_periods_week(int);
+int __skip_periods_hour(int);
+int __skip_periods_minute(int);
+
void import_c_dates(PyObject *);
#endif
@@ -578,7 +578,8 @@ _days_from_years(npy_int64 indate, ts_metadata *meta)
final_adj = -1;
}
absdate = days_from_ymd(year, month, 1);
- if (absdate == INT_ERR_CODE) return INT_ERR_CODE;
+ if (absdate == INT_ERR_CODE)
+ return INT_ERR_CODE;
return absdate + final_adj;
}
Oops, something went wrong.

0 comments on commit 9937aa3

Please sign in to comment.