* 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
| 1021 | * then it will be checked for conformity and used directly. |
| 1022 | */ |
| 1023 | static 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. |
no outgoing calls
no test coverage detected