![]() | Idea: if callback formula is a string, we could embed it in a Fortran function and call Fortran instead of Python |
![]() | F2PY has a module for ``inline'' Fortran code specification and building
source = """ real*8 function fcb(x, y) real*8 x, y fcb = %s return end """ % fstr import f2py2e f2py_args = "--fcompiler='Gnu' --build-dir tmp2 etc..." f2py2e.compile(source, modulename='callback', extra_args=f2py_args, verbose=True, source_fn='sourcecodefile.f') import callback <work with the new extension module> |