1cdef extern from "_complexstuff.h": 2 # numpy/npy_math.h doesn't have correct extern "C" declarations, 3 # so we must include a wrapped version first 4 pass 5 6cdef extern from "numpy/npy_math.h": 7 double NPY_NAN 8 9cimport numpy as np 10from numpy cimport ( 11 npy_float, npy_double, npy_longdouble, 12 npy_cfloat, npy_cdouble, npy_clongdouble, 13 npy_int, npy_long, 14 NPY_FLOAT, NPY_DOUBLE, NPY_LONGDOUBLE, 15 NPY_CFLOAT, NPY_CDOUBLE, NPY_CLONGDOUBLE, 16 NPY_INT, NPY_LONG) 17 18ctypedef double complex double_complex 19 20cdef extern from "numpy/ufuncobject.h": 21 int PyUFunc_getfperr() nogil 22 23cdef public int wrap_PyUFunc_getfperr() nogil: 24 """ 25 Call PyUFunc_getfperr in a context where PyUFunc_API array is initialized; 26 this avoids messing with the UNIQUE_SYMBOL #defines 27 """ 28 return PyUFunc_getfperr() 29 30cimport libc 31 32from . cimport sf_error 33 34np.import_array() 35np.import_ufunc() 36 37cdef void _set_action(sf_error.sf_error_t code, 38 sf_error.sf_action_t action) nogil: 39 sf_error.set_action(code, action) 40