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

Function npyiter_shape_get

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

Source from the content-addressed store, hash-verified

1519};
1520
1521static PyObject *
1522npyiter_shape_get(NewNpyArrayIterObject *self, void *NPY_UNUSED(ignored))
1523{
1524 npy_intp ndim, shape[NPY_MAXDIMS];
1525
1526 if (self->iter == NULL || self->finished) {
1527 PyErr_SetString(PyExc_ValueError,
1528 "Iterator is past the end");
1529 return NULL;
1530 }
1531
1532 if (NpyIter_GetShape(self->iter, shape) == NPY_SUCCEED) {
1533 ndim = NpyIter_GetNDim(self->iter);
1534 return PyArray_IntTupleFromIntp(ndim, shape);
1535 }
1536
1537 return NULL;
1538}
1539
1540static PyObject *
1541npyiter_multi_index_get(NewNpyArrayIterObject *self, void *NPY_UNUSED(ignored))

Callers

nothing calls this directly

Calls 3

NpyIter_GetShapeFunction · 0.85
NpyIter_GetNDimFunction · 0.85
PyArray_IntTupleFromIntpFunction · 0.85

Tested by

no test coverage detected