diff --git a/interfaces/cython/cantera/func1.pxd b/interfaces/cython/cantera/func1.pxd index e8747632c6..eaf11e190a 100644 --- a/interfaces/cython/cantera/func1.pxd +++ b/interfaces/cython/cantera/func1.pxd @@ -6,13 +6,20 @@ from .ctcxx cimport * +cdef extern from "cantera/numerics/Func1.h": + cdef cppclass CxxFunc1 "Cantera::Func1": + double eval(double) except +translate_exception + + cdef cppclass CxxTabulated1 "Cantera::Tabulated1" (CxxFunc1): + CxxTabulated1(int, double*, double*, string) except +translate_exception + double eval(double) except +translate_exception + cdef extern from "cantera/cython/funcWrapper.h": ctypedef double (*callback_wrapper)(double, void*, void**) except? 0.0 cdef int translate_exception() - cdef cppclass CxxFunc1 "Func1Py": - CxxFunc1(callback_wrapper, void*) - double eval(double) except +translate_exception + cdef cppclass CxxFunc1Py "Func1Py" (CxxFunc1): + CxxFunc1Py(callback_wrapper, void*) cdef cppclass PyFuncInfo: PyFuncInfo() @@ -24,12 +31,6 @@ cdef extern from "cantera/cython/funcWrapper.h": void setExceptionValue(PyObject*) -cdef extern from "cantera/numerics/Func1.h": - cdef cppclass CxxTabulated1 "Cantera::Tabulated1": - CxxTabulated1(int, double*, double*, string) except +translate_exception - double eval(double) except +translate_exception - - cdef class Func1: cdef shared_ptr[CxxFunc1] _func cdef CxxFunc1* func diff --git a/interfaces/cython/cantera/func1.pyx b/interfaces/cython/cantera/func1.pyx index 71148294c4..51f0a9b6de 100644 --- a/interfaces/cython/cantera/func1.pyx +++ b/interfaces/cython/cantera/func1.pyx @@ -90,7 +90,7 @@ cdef class Func1: cpdef void _set_callback(self, c) except *: self.callable = c - self._func.reset(new CxxFunc1(func_callback, self)) + self._func.reset(new CxxFunc1Py(func_callback, self)) self.func = self._func.get() def __call__(self, t):