MCPcopy Create free account
hub / github.com/numpy/numpy / npyiter_remove_multi_index

Function npyiter_remove_multi_index

numpy/core/src/multiarray/nditer_pywrap.c:1323–1347  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1321}
1322
1323static PyObject *
1324npyiter_remove_multi_index(
1325 NewNpyArrayIterObject *self, PyObject *NPY_UNUSED(args))
1326{
1327 if (self->iter == NULL) {
1328 PyErr_SetString(PyExc_ValueError,
1329 "Iterator is invalid");
1330 return NULL;
1331 }
1332
1333 NpyIter_RemoveMultiIndex(self->iter);
1334 /* RemoveMultiIndex invalidates cached values */
1335 npyiter_cache_values(self);
1336 /* RemoveMultiIndex also resets the iterator */
1337 if (NpyIter_GetIterSize(self->iter) == 0) {
1338 self->started = 1;
1339 self->finished = 1;
1340 }
1341 else {
1342 self->started = 0;
1343 self->finished = 0;
1344 }
1345
1346 Py_RETURN_NONE;
1347}
1348
1349static PyObject *
1350npyiter_enable_external_loop(

Callers

nothing calls this directly

Calls 3

NpyIter_RemoveMultiIndexFunction · 0.85
npyiter_cache_valuesFunction · 0.85
NpyIter_GetIterSizeFunction · 0.85

Tested by

no test coverage detected