| 1286 | } |
| 1287 | |
| 1288 | static PyObject * |
| 1289 | npyiter_remove_axis(NewNpyArrayIterObject *self, PyObject *args) |
| 1290 | { |
| 1291 | int axis = 0; |
| 1292 | |
| 1293 | if (self->iter == NULL) { |
| 1294 | PyErr_SetString(PyExc_ValueError, |
| 1295 | "Iterator is invalid"); |
| 1296 | return NULL; |
| 1297 | } |
| 1298 | |
| 1299 | if (!PyArg_ParseTuple(args, "i:remove_axis", &axis)) { |
| 1300 | return NULL; |
| 1301 | } |
| 1302 | |
| 1303 | if (NpyIter_RemoveAxis(self->iter, axis) != NPY_SUCCEED) { |
| 1304 | return NULL; |
| 1305 | } |
| 1306 | /* RemoveAxis invalidates cached values */ |
| 1307 | if (npyiter_cache_values(self) < 0) { |
| 1308 | return NULL; |
| 1309 | } |
| 1310 | /* RemoveAxis also resets the iterator */ |
| 1311 | if (NpyIter_GetIterSize(self->iter) == 0) { |
| 1312 | self->started = 1; |
| 1313 | self->finished = 1; |
| 1314 | } |
| 1315 | else { |
| 1316 | self->started = 0; |
| 1317 | self->finished = 0; |
| 1318 | } |
| 1319 | |
| 1320 | Py_RETURN_NONE; |
| 1321 | } |
| 1322 | |
| 1323 | static PyObject * |
| 1324 | npyiter_remove_multi_index( |
nothing calls this directly
no test coverage detected