numpy 2.0.0
|
#include <Python.h>
#include <datetime.h>
#include <time.h>
#include <numpy/ndarrayobject.h>
#include "npy_config.h"
#include "numpy/npy_3kcompat.h"
#include "_datetime.h"
#define _DAYS_PER_MONTH 30.436875 |
#define _DAYS_PER_YEAR 365.2425 |
#define _MULTIARRAYMODULE |
#define NPY_FR_ERR -1 |
#define NPY_NO_PREFIX |
#define Py_AssertWithArg | ( | x, | |
errortype, | |||
errorstr, | |||
a1 | |||
) | {if (!(x)) {PyErr_Format(errortype,errorstr,a1);goto onError;}} |
#define PY_SSIZE_T_CLEAN |
#define secs_from_hms | ( | hour, | |
min, | |||
sec, | |||
multiplier | |||
) |
(\ ((hour)*3600 + (min)*60 + (sec)) * (npy_int64)(multiplier)\ )
static int day_of_week | ( | npy_longlong | absdate | ) | [static] |
static npy_longlong days_from_ymd | ( | int | year, |
int | month, | ||
int | day | ||
) | [static] |
static ymdstruct days_to_ymdstruct | ( | npy_datetime | dlong | ) | [static] |
Referenced by PyArray_TimedeltaStructToTimedelta().
static int is_leapyear | ( | long | year | ) | [static] |
NPY_NO_EXPORT npy_datetime PyArray_DatetimeStructToDatetime | ( | NPY_DATETIMEUNIT | fr, |
npy_datetimestruct * | d | ||
) |
<blockquote> Structure is assumed to be already normalized</blockquote>
<
NPY_NO_EXPORT void PyArray_DatetimeToDatetimeStruct | ( | npy_datetime | val, |
NPY_DATETIMEUNIT | fr, | ||
npy_datetimestruct * | result | ||
) |
NPY_NO_EXPORT npy_datetime PyArray_TimedeltaStructToTimedelta | ( | NPY_DATETIMEUNIT | fr, |
npy_timedeltastruct * | d | ||
) |
References ymdstruct::day, days_to_ymdstruct(), hmsstruct::hour, hmsstruct::min, ymdstruct::month, NPY_FR_B, NPY_FR_D, NPY_FR_h, NPY_FR_m, NPY_FR_M, NPY_FR_s, NPY_FR_W, NPY_FR_Y, hmsstruct::sec, seconds_to_hmsstruct(), and ymdstruct::year.
NPY_NO_EXPORT void PyArray_TimedeltaToTimedeltaStruct | ( | npy_timedelta | val, |
NPY_DATETIMEUNIT | fr, | ||
npy_timedeltastruct * | result | ||
) |
static hmsstruct seconds_to_hmsstruct | ( | npy_longlong | dlong | ) | [static] |
Referenced by PyArray_TimedeltaStructToTimedelta().
static npy_longlong year_offset | ( | npy_longlong | year | ) | [static] |
int days_in_month[2][12] [static] |
{ { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }, { 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 } }
int month_offset[2][13] [static] |
{ { 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365 }, { 0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366 } }