diff options
Diffstat (limited to 'doc/source')
-rw-r--r-- | doc/source/reference/arrays.maskna.rst | 2 | ||||
-rw-r--r-- | doc/source/reference/c-api.array.rst | 24 | ||||
-rw-r--r-- | doc/source/reference/c-api.maskna.rst | 6 |
3 files changed, 28 insertions, 4 deletions
diff --git a/doc/source/reference/arrays.maskna.rst b/doc/source/reference/arrays.maskna.rst index 29b38f131..2faabde83 100644 --- a/doc/source/reference/arrays.maskna.rst +++ b/doc/source/reference/arrays.maskna.rst @@ -58,7 +58,7 @@ as defined in the IEEE 754 floating point arithmetic specification. Most computations whose input is NA will output NA as well, a property known as propagation. Some operations, however, always produce the same result no matter what the value of the NA is. The clearest -example of this is with the logical operands *and* and *or*. Since both +example of this is with the logical operations *and* and *or*. Since both np.logical_or(True, True) and np.logical_or(False, True) are True, all possible boolean values on the left hand side produce the same answer. This means that np.logical_or(np.NA, True) can produce diff --git a/doc/source/reference/c-api.array.rst b/doc/source/reference/c-api.array.rst index eab2779a4..46a215a12 100644 --- a/doc/source/reference/c-api.array.rst +++ b/doc/source/reference/c-api.array.rst @@ -2752,6 +2752,19 @@ to. . No matter what is returned, you must DECREF the object returned by this routine in *address* when you are done with it. + If the input is an array with NA support, this will either raise + an error if it contains any NAs, or will make a copy of the array + without NA support if it does not contain any NAs. Use the function + :cfunc:`PyArray_AllowNAConverter` to support NA-arrays directly + and more efficiently. + +.. cfunction:: int PyArray_AllowConverter(PyObject* obj, PyObject** address) + + This is the same as :cfunc:`PyArray_Converter`, but allows arrays + with NA support to pass through untouched. This function was created + so that the existing converter could raise errors appropriately + for functions which have not been updated with NA support + .. cfunction:: int PyArray_OutputConverter(PyObject* obj, PyArrayObject** address) This is a default converter for output arrays given to @@ -2760,6 +2773,17 @@ to. *obj*) is TRUE then it is returned in *\*address* without incrementing its reference count. + If the output is an array with NA support, this will raise an error. + Use the function :cfunc:`PyArray_OutputAllowNAConverter` to support + NA-arrays directly. + +.. cfunction:: int PyArray_OutputAllowNAConverter(PyObject* obj, PyArrayObject** address) + + This is the same as :cfunc:`PyArray_OutputConverter`, but allows arrays + with NA support to pass through. This function was created + so that the existing output converter could raise errors appropriately + for functions which have not been updated with NA support + .. cfunction:: int PyArray_IntpConverter(PyObject* obj, PyArray_Dims* seq) Convert any Python sequence, *obj*, smaller than :cdata:`NPY_MAXDIMS` diff --git a/doc/source/reference/c-api.maskna.rst b/doc/source/reference/c-api.maskna.rst index 374998141..6abb624eb 100644 --- a/doc/source/reference/c-api.maskna.rst +++ b/doc/source/reference/c-api.maskna.rst @@ -308,9 +308,9 @@ consisting of:: static char *kwlist[] = {"a", "b", "out", NULL}; if (!PyArg_ParseTupleAndKeywords(args, kwds, "O&O&|O&", kwlist, - &PyArray_Converter, &a, - &PyArray_Converter, &b, - &PyArray_OutputConverter, &out)) { + &PyArray_AllowNAConverter, &a, + &PyArray_AllowNAConverter, &b, + &PyArray_OutputAllowNAConverter, &out)) { return NULL; } |