diff options
author | Stefan Behnel <stefan_ml@behnel.de> | 2020-08-01 12:44:47 +0200 |
---|---|---|
committer | Stefan Behnel <stefan_ml@behnel.de> | 2020-08-01 12:44:47 +0200 |
commit | 552e356ff2776d775dbdff61c0a5d7ae217ac588 (patch) | |
tree | d1af75937571e3efd3a0cffb87159d6f62ca59cc | |
parent | c3318bea868ff8ae3df5f19cc46d3f4b78cda77d (diff) | |
download | cython-552e356ff2776d775dbdff61c0a5d7ae217ac588.tar.gz |
Readability improvements in "numpy.pxd".
-rw-r--r-- | Cython/Includes/numpy/__init__.pxd | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/Cython/Includes/numpy/__init__.pxd b/Cython/Includes/numpy/__init__.pxd index 77dfbcdc5..7d8148afb 100644 --- a/Cython/Includes/numpy/__init__.pxd +++ b/Cython/Includes/numpy/__init__.pxd @@ -393,8 +393,8 @@ cdef extern from "numpy/arrayobject.h": npy_intp PyArray_STRIDE(ndarray, size_t) nogil PyObject *PyArray_BASE(ndarray) nogil # returns borrowed reference! - PyArray_Descr *PyArray_DESCR(ndarray) nogil # returns borrowed reference to dtype! - PyArray_Descr *PyArray_DTYPE(ndarray) nogil # returns borrowed reference to dtype! NP 1.7+ alias for descr. + PyArray_Descr *PyArray_DESCR(ndarray) nogil # returns borrowed reference to dtype! + PyArray_Descr *PyArray_DTYPE(ndarray) nogil # returns borrowed reference to dtype! NP 1.7+ alias for descr. int PyArray_FLAGS(ndarray) nogil void PyArray_CLEARFLAGS(ndarray, int flags) nogil # Added in NumPy 1.7 void PyArray_ENABLEFLAGS(ndarray, int flags) nogil # Added in NumPy 1.7 @@ -642,7 +642,7 @@ cdef extern from "numpy/arrayobject.h": object PyArray_Choose (ndarray, object, ndarray, NPY_CLIPMODE) int PyArray_Sort (ndarray, int, NPY_SORTKIND) object PyArray_ArgSort (ndarray, int, NPY_SORTKIND) - object PyArray_SearchSorted (ndarray, object, NPY_SEARCHSIDE, PyObject*) + object PyArray_SearchSorted (ndarray, object, NPY_SEARCHSIDE, PyObject *) object PyArray_ArgMax (ndarray, int, ndarray) object PyArray_ArgMin (ndarray, int, ndarray) object PyArray_Reshape (ndarray, object) @@ -1049,9 +1049,11 @@ cdef inline int import_ufunc() except -1: cdef inline bint is_timedelta64_object(object obj): """ Cython equivalent of `isinstance(obj, np.timedelta64)` + Parameters ---------- obj : object + Returns ------- bool @@ -1062,9 +1064,11 @@ cdef inline bint is_timedelta64_object(object obj): cdef inline bint is_datetime64_object(object obj): """ Cython equivalent of `isinstance(obj, np.datetime64)` + Parameters ---------- obj : object + Returns ------- bool @@ -1075,6 +1079,7 @@ cdef inline bint is_datetime64_object(object obj): cdef inline npy_datetime get_datetime64_value(object obj) nogil: """ returns the int64 value underlying scalar numpy datetime64 object + Note that to interpret this as a datetime, the corresponding unit is also needed. That can be found using `get_datetime64_unit`. """ |