Go to the source code of this file.
Function Documentation
Sorts the the array of dates provided in place and removes NaT, duplicates and any date which is already excluded on account of the weekmask.
Returns the number of dates left after removing weekmask-excluded dates.
Sort the dates
Sweep throught the array, eliminating unnecessary values
Skip any NaT or duplicate
Get the day of the week (1970-01-05 is Monday)
If the holiday falls on a possible business day, then keep it.
Adjust the end of the holidays array
NPY_NO_EXPORT int PyArray_HolidaysConverter |
( |
PyObject * |
dates_in, |
|
|
npy_holidayslist * |
holidays |
|
) |
| |
Converts a Python input into a non-normalized list of holidays.
- IMPORTANT: This function can't do the normalization, because it doesn't
- know the weekmask. You must call 'normalize_holiday_list' on the result before using it.
Make 'dates' into an array
Use the datetime dtype with generic units so it fills it in
This steals the datetime_dtype reference
Allocate the memory for the dates
Cast the data into a raw date array
NPY_NO_EXPORT int PyArray_WeekMaskConverter |
( |
PyObject * |
weekmask_in, |
|
|
npy_bool * |
weekmask |
|
) |
| |
Converts a Python input into a 7-element weekmask, where 0 means weekend and 1 means business day.
Make obj into an ASCII string if it is UNICODE
accept unicode input
Length 7 is a string like "1111100"
Length divisible by 3 is a string like "Mon" or "MonWedFri"
Something like [1,1,1,1,1,0,0]
References PyArray_Check, PyArray_NDIM, PyBytes_AsStringAndSize, and PyBytes_Check.
Variable Documentation