| 208 | } |
| 209 | |
| 210 | static PyObject * |
| 211 | array_squeeze(PyArrayObject *self, |
| 212 | PyObject *const *args, Py_ssize_t len_args, PyObject *kwnames) |
| 213 | { |
| 214 | PyObject *axis_in = NULL; |
| 215 | npy_bool axis_flags[NPY_MAXDIMS]; |
| 216 | NPY_PREPARE_ARGPARSER; |
| 217 | |
| 218 | if (npy_parse_arguments("squeeze", args, len_args, kwnames, |
| 219 | "|axis", NULL, &axis_in, |
| 220 | NULL, NULL, NULL) < 0) { |
| 221 | return NULL; |
| 222 | } |
| 223 | |
| 224 | if (axis_in == NULL || axis_in == Py_None) { |
| 225 | return PyArray_Squeeze(self); |
| 226 | } |
| 227 | else { |
| 228 | if (PyArray_ConvertMultiAxis(axis_in, PyArray_NDIM(self), |
| 229 | axis_flags) != NPY_SUCCEED) { |
| 230 | return NULL; |
| 231 | } |
| 232 | |
| 233 | return PyArray_SqueezeSelected(self, axis_flags); |
| 234 | } |
| 235 | } |
| 236 | |
| 237 | static PyObject * |
| 238 | array_view(PyArrayObject *self, |
nothing calls this directly
no test coverage detected