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

Function _convert_from_field_dict

numpy/core/src/multiarray/descriptor.c:1023–1037  ·  view source on GitHub ↗

* a dictionary specifying a data-type * must have at least two and up to four * keys These must all be sequences of the same length. * * can also have an additional key called "metadata" which can be any dictionary * * "names" --- field names * "formats" --- the data-type descriptors for the field. * * Optional: * * "offsets" --- integers indicating the offset into the * record of the

Source from the content-addressed store, hash-verified

1021 * then it will be checked for conformity and used directly.
1022 */
1023static PyArray_Descr *
1024_convert_from_field_dict(PyObject *obj, int align)
1025{
1026 PyObject *_numpy_internal;
1027 PyArray_Descr *res;
1028
1029 _numpy_internal = PyImport_ImportModule("numpy.core._internal");
1030 if (_numpy_internal == NULL) {
1031 return NULL;
1032 }
1033 res = (PyArray_Descr *)PyObject_CallMethod(_numpy_internal,
1034 "_usefields", "Oi", obj, align);
1035 Py_DECREF(_numpy_internal);
1036 return res;
1037}
1038
1039/*
1040 * Creates a struct dtype object from a Python dictionary.

Callers 1

_convert_from_dictFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected