MCPcopy Create free account
hub / github.com/numpy/numpy / is_any_numpy_timedelta

Function is_any_numpy_timedelta

numpy/core/src/multiarray/datetime.c:3083–3105  ·  view source on GitHub ↗

* Returns true if the object is something that is best considered * a Datetime, false otherwise. */

Source from the content-addressed store, hash-verified

3081 * a Datetime, false otherwise.
3082 */
3083static NPY_GCC_NONNULL(1) npy_bool
3084is_any_numpy_datetime(PyObject *obj)
3085{
3086 return (PyArray_IsScalar(obj, Datetime) ||
3087 (PyArray_Check(obj) && (
3088 PyArray_DESCR((PyArrayObject *)obj)->type_num ==
3089 NPY_DATETIME)) ||
3090 PyDate_Check(obj) ||
3091 PyDateTime_Check(obj));
3092}
3093
3094/*
3095 * Returns true if the object is something that is best considered
3096 * a Timedelta, false otherwise.
3097 */
3098static npy_bool
3099is_any_numpy_timedelta(PyObject *obj)
3100{
3101 return (PyArray_IsScalar(obj, Timedelta) ||
3102 (PyArray_Check(obj) && (
3103 PyArray_DESCR((PyArrayObject *)obj)->type_num == NPY_TIMEDELTA)) ||
3104 PyDelta_Check(obj));
3105}
3106
3107/*
3108 * Returns true if the object is something that is best considered

Callers 2

datetime_arangeFunction · 0.85

Calls 1

PyArray_DESCRFunction · 0.85

Tested by

no test coverage detected