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

Function PyArray_DescrConverter

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

NUMPY_API * Get typenum from an object -- None goes to NPY_DEFAULT_TYPE * This function takes a Python object representing a type and converts it * to a the correct PyArray_Descr * structure to describe the type. * * Many objects can be used to represent a data-type which in NumPy is * quite a flexible concept. * * This is the central code that converts Python objects to * Type-descriptor

Source from the content-addressed store, hash-verified

1714 * a reference to the input obj.
1715 */
1716NPY_NO_EXPORT int
1717PyArray_DescrConverter(PyObject *obj, PyArray_Descr **at)
1718{
1719 *at = _convert_from_any(obj, 0);
1720 return (*at) ? NPY_SUCCEED : NPY_FAIL;
1721}
1722
1723/** Convert a bytestring specification into a dtype */
1724static PyArray_Descr *

Callers 10

array_descr_setFunction · 0.85
array_viewFunction · 0.85
PyArray_FromInterfaceFunction · 0.85
PyArray_DescrConverter2Function · 0.85
array_result_typeFunction · 0.85
_get_dtypeFunction · 0.85
register_failFunction · 0.85

Calls 1

_convert_from_anyFunction · 0.85

Tested by 2

register_failFunction · 0.68