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

Function _array_descr_walk

numpy/core/src/multiarray/hashdescr.c:232–255  ·  view source on GitHub ↗

* 'Root' function to walk into a dtype. May be called recursively */

Source from the content-addressed store, hash-verified

230 * 'Root' function to walk into a dtype. May be called recursively
231 */
232static int _array_descr_walk(PyArray_Descr* descr, PyObject *l)
233{
234 int st;
235
236 if (_is_array_descr_builtin(descr)) {
237 return _array_descr_builtin(descr, l);
238 }
239 else {
240 if(descr->fields != NULL && descr->fields != Py_None) {
241 st = _array_descr_walk_fields(descr->names, descr->fields, l);
242 if (st) {
243 return -1;
244 }
245 }
246 if(PyDataType_HASSUBARRAY(descr)) {
247 st = _array_descr_walk_subarray(descr->subarray, l);
248 if (st) {
249 return -1;
250 }
251 }
252 }
253
254 return 0;
255}
256
257/*
258 * Return 0 if successful

Callers 3

_array_descr_walk_fieldsFunction · 0.85
_PyArray_DescrHashImpFunction · 0.85

Calls 4

_is_array_descr_builtinFunction · 0.85
_array_descr_builtinFunction · 0.85
_array_descr_walk_fieldsFunction · 0.85

Tested by

no test coverage detected