| 2525 | } |
| 2526 | |
| 2527 | static PyObject * |
| 2528 | array_compress(PyArrayObject *self, PyObject *args, PyObject *kwds) |
| 2529 | { |
| 2530 | int axis = NPY_MAXDIMS; |
| 2531 | PyObject *condition; |
| 2532 | PyArrayObject *out = NULL; |
| 2533 | static char *kwlist[] = {"condition", "axis", "out", NULL}; |
| 2534 | |
| 2535 | if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|O&O&:compress", kwlist, |
| 2536 | &condition, |
| 2537 | PyArray_AxisConverter, &axis, |
| 2538 | PyArray_OutputConverter, &out)) { |
| 2539 | return NULL; |
| 2540 | } |
| 2541 | |
| 2542 | PyObject *ret = PyArray_Compress(self, condition, axis, out); |
| 2543 | |
| 2544 | /* this matches the unpacking behavior of ufuncs */ |
| 2545 | if (out == NULL) { |
| 2546 | return PyArray_Return((PyArrayObject *)ret); |
| 2547 | } |
| 2548 | else { |
| 2549 | return ret; |
| 2550 | } |
| 2551 | } |
| 2552 | |
| 2553 | |
| 2554 | static PyObject * |
nothing calls this directly
no test coverage detected