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

Function delta_checker

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

* handler function for PyDelta values * which may also be in a 0 dimensional * NumPy array */

Source from the content-addressed store, hash-verified

3664 * NumPy array
3665 */
3666static int
3667delta_checker(PyArray_DatetimeMetaData *meta)
3668{
3669 PyArray_DatetimeMetaData tmp_meta;
3670
3671 tmp_meta.base = NPY_FR_us;
3672 tmp_meta.num = 1;
3673
3674 /* Combine it with 'meta' */
3675 if (compute_datetime_metadata_greatest_common_divisor(
3676 meta, &tmp_meta, meta, 0, 0) < 0) {
3677 return -1;
3678 }
3679 return 0;
3680}
3681
3682/*
3683 * Recursively determines the metadata for an NPY_TIMEDELTA dtype.

Callers 1

Tested by

no test coverage detected