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

Function PyArrayMethod_FromSpec

numpy/core/src/multiarray/array_method.c:393–404  ·  view source on GitHub ↗

* Public version of `PyArrayMethod_FromSpec_int` (see below). * * TODO: Error paths will probably need to be improved before a release into * the non-experimental public API. */

Source from the content-addressed store, hash-verified

391 * the non-experimental public API.
392 */
393NPY_NO_EXPORT PyObject *
394PyArrayMethod_FromSpec(PyArrayMethod_Spec *spec)
395{
396 for (int i = 0; i < spec->nin + spec->nout; i++) {
397 if (!PyObject_TypeCheck(spec->dtypes[i], &PyArrayDTypeMeta_Type)) {
398 PyErr_SetString(PyExc_RuntimeError,
399 "ArrayMethod spec contained a non DType.");
400 return NULL;
401 }
402 }
403 return (PyObject *)PyArrayMethod_FromSpec_int(spec, 0);
404}
405
406
407/**

Callers 1

PyUFunc_AddLoopFromSpecFunction · 0.85

Calls 1

Tested by

no test coverage detected