| 109 | |
| 110 | |
| 111 | static PyObject * |
| 112 | array_take(PyArrayObject *self, |
| 113 | PyObject *const *args, Py_ssize_t len_args, PyObject *kwnames) |
| 114 | { |
| 115 | int dimension = NPY_MAXDIMS; |
| 116 | PyObject *indices; |
| 117 | PyArrayObject *out = NULL; |
| 118 | NPY_CLIPMODE mode = NPY_RAISE; |
| 119 | NPY_PREPARE_ARGPARSER; |
| 120 | |
| 121 | if (npy_parse_arguments("take", args, len_args, kwnames, |
| 122 | "indices", NULL, &indices, |
| 123 | "|axis", &PyArray_AxisConverter, &dimension, |
| 124 | "|out", &PyArray_OutputConverter, &out, |
| 125 | "|mode", &PyArray_ClipmodeConverter, &mode, |
| 126 | NULL, NULL, NULL) < 0) { |
| 127 | return NULL; |
| 128 | } |
| 129 | |
| 130 | PyObject *ret = PyArray_TakeFrom(self, indices, dimension, out, mode); |
| 131 | |
| 132 | /* this matches the unpacking behavior of ufuncs */ |
| 133 | if (out == NULL) { |
| 134 | return PyArray_Return((PyArrayObject *)ret); |
| 135 | } |
| 136 | else { |
| 137 | return ret; |
| 138 | } |
| 139 | } |
| 140 | |
| 141 | static PyObject * |
| 142 | array_fill(PyArrayObject *self, PyObject *args) |
nothing calls this directly
no test coverage detected