| 2314 | } |
| 2315 | |
| 2316 | static PyObject * |
| 2317 | array_count_nonzero(PyObject *NPY_UNUSED(self), PyObject *const *args, Py_ssize_t len_args) |
| 2318 | { |
| 2319 | PyArrayObject *array; |
| 2320 | npy_intp count; |
| 2321 | |
| 2322 | NPY_PREPARE_ARGPARSER; |
| 2323 | if (npy_parse_arguments("count_nonzero", args, len_args, NULL, |
| 2324 | "", PyArray_Converter, &array, |
| 2325 | NULL, NULL, NULL) < 0) { |
| 2326 | return NULL; |
| 2327 | } |
| 2328 | |
| 2329 | count = PyArray_CountNonzero(array); |
| 2330 | |
| 2331 | Py_DECREF(array); |
| 2332 | |
| 2333 | if (count == -1) { |
| 2334 | return NULL; |
| 2335 | } |
| 2336 | return PyLong_FromSsize_t(count); |
| 2337 | } |
| 2338 | |
| 2339 | static PyObject * |
| 2340 | array_fromstring(PyObject *NPY_UNUSED(ignored), PyObject *args, PyObject *keywds) |
nothing calls this directly
no test coverage detected