numpy.f2py.rules (version <module 'numpy.f2py.__version__' from '/usr/lib/python2.6/dist-packages/numpy/f2py/__version__.pyc'>)
index
/usr/lib/python2.6/dist-packages/numpy/f2py/rules.py

Rules for building C/API module with f2py2e.
 
Here is a skeleton of a new wrapper function (13Dec2001):
 
wrapper_function(args)
  declarations
  get_python_arguments, say, `a' and `b'
 
  get_a_from_python
  if (successful) {
 
    get_b_from_python
    if (successful) {
 
      callfortran
      if (succesful) {
 
        put_a_to_python
        if (succesful) {
 
          put_b_to_python
          if (succesful) {
 
            buildvalue = ...
 
          }
 
        }
 
      }
 
    }
    cleanup_b
 
  }
  cleanup_a
 
  return buildvalue

 
Modules
       
numpy.f2py.__version__
numpy.f2py.capi_maps
numpy.f2py.cb_rules
numpy.f2py.cfuncs
numpy.f2py.common_rules
copy
numpy.f2py.f90mod_rules
numpy.f2py.func2subr
os
pprint
re
sys
time
types
numpy.f2py.use_rules

 
Functions
       
buildapi(rout)
buildmodule(m, um)
Return
errmess = write(...)
write(str) -> None.  Write string str to file.
 
Note that due to buffering, flush() or close() may be needed before
the file on disk reflects the data written.

 
Data
        __file__ = '/usr/lib/python2.6/dist-packages/numpy/f2py/rules.pyc'
__name__ = 'numpy.f2py.rules'
__package__ = 'numpy.f2py'
arg_rules = [{'separatorsfor': {'callbacks': '\n', 'cfuncs': '\n', 'cleanupfrompyobj': '\n', 'closepyobjfrom': '\n', 'commonhooks': '\n', 'cppmacros': '\n', 'decl': '\n', 'externroutines': '\n', 'f90modhooks': '\n', 'freemem': '\n', ...}}, {'_depend': '', 'cleanupfrompyobj': '\t/* End of cleaning variable #varname# */', 'frompyobj': ['\t/* Processing variable #varname# */', {<function debugcapi at 0x4fe3410>: '\tfprintf(stderr,"#vardebuginfo#\\n");'}], 'need': {<function isunsigned_long_longarray at 0x4f470c8>: 'unsigned_long_long', <function issigned_long_longarray at 0x4f472a8>: 'long_long', <function islong_long at 0x4fe3a28>: 'long_long', <function isunsigned_char at 0x4fe3aa0>: 'unsigned_char', <function isunsigned_short at 0x4fe3b18>: 'unsigned_short', <function isunsigned at 0x4fe3b90>: 'unsigned', <function isunsigned_long_long at 0x4fe3c08>: 'unsigned_long_long', <function islong_double at 0x4fe3cf8>: 'long_double', <function islong_complex at 0x4fe3d70>: 'complex_long_double', <function isunsigned_chararray at 0x4fe3ed8>: 'unsigned_char', ...}}, {'depend': '', 'docstropt': {<function <lambda> at 0x4f7bed8>: '\t#pydocsign#'}, 'docstrout': {<function isintent_out at 0x4f47d70>: '\t#pydocsignout#'}, 'docstrreq': {<function <lambda> at 0x4f7a050>: '\t#pydocsign#'}, 'latexdocstropt': {<function <lambda> at 0x4f7a140>: [r'\item[]{{}\verb@#pydocsign#@{}}', {<function hasnote at 0x4f48410>: '--- #note#'}]}, 'latexdocstrout': {<function isintent_out at 0x4f47d70>: [r'\item[]{{}\verb@#pydocsignout#@{}}', {<function <lambda> at 0x4f7a320>: '--- #note#', <function <lambda> at 0x4f7a410>: '--- See above.'}]}, 'latexdocstrreq': {<function <lambda> at 0x4f7a230>: [r'\item[]{{}\verb@#pydocsign#@{}}', {<function hasnote at 0x4f48410>: '--- #note#'}]}}, {'_check': <function <lambda> at 0x4f7a5f0>, 'docsign': '#varname#,', 'kwlist': '"#varname#",'}, {'_check': <function <lambda> at 0x4f7a6e0>, 'docsignopt': '#varname#=#showinit#,', 'docsignoptshort': '#varname#,', 'kwlistopt': '"#varname#",'}, {'_check': <function isintent_out at 0x4f47d70>, 'docreturn': '#outvarname#,', 'returnformat': '#varrformat#'}, {'_check': <function isexternal at 0x4f47b90>, 'argformat': {<function isrequired at 0x4f47c08>: 'O'}, 'args_capi': {<function isrequired at 0x4f47c08>: ',&#varname#_capi'}, 'callfortran': {<function <lambda> at 0x4f7a8c0>: '#varname#_cptr,'}, 'decl': ['\tPyObject *#varname#_capi = Py_None;', '\tPyTupleObject *#varname#_xa_capi = NULL;', '\tPyTupleObject *#varname#_args_capi = NULL;', '\tint #varname#_nofargs_capi = 0;', {<function <lambda> at 0x4f7a7d0>: '\t#cbname#_typedef #varname#_cptr;'}], 'docsignxa': {<function isintent_nothide at 0x4f47e60>: '#varname#_extra_args=(),'}, 'docsignxashort': {<function isintent_nothide at 0x4f47e60>: '#varname#_extra_args,'}, 'docstrcbs': '#cbdocstr#', 'docstropt': {<function isintent_nothide at 0x4f47e60>: '\t#varname#_extra_args := () input tuple'}, 'keyformat': {<function isoptional at 0x4f47b18>: 'O'}, ...}, {'_check': <function isexternal at 0x4f47b90>, '_depend': '', 'cleanupfrompyobj': '\t\tCFUNCSMESS("Restoring jmpbuf for `#varname#`.\\...me#_jmpbuf,&#varname#_jmpbuf,sizeof(jmp_buf));\n\t}', 'frompyobj': [{<function <lambda> at 0x4f7a9b0>: 'if(PyCObject_Check(#varname#_capi)) {\n #varname...#_capi);\n} else {\n #varname#_cptr = #cbname#;\n}\n'}, {<function isintent_callback at 0x4f48140>: 'if (#varname#_capi==Py_None) {\n #varname#_capi ...ulename# attribute).\\n");\n return NULL;\n }\n}\n'}, '\t#varname#_nofargs_capi = #cbname#_nofargs;\n\tif ...-back #varname#.")) {\n\t\tjmp_buf #varname#_jmpbuf;', {<function debugcapi at 0x4fe3410>: ['\t\tfprintf(stderr,"debug-capi:Assuming %d argumen...;\n\t\tCFUNCSMESSPY("for #varname#=",#cbname#_capi);', {<function <lambda> at 0x4f7aaa0>: '\t\tfprintf(stderr,"#vardebugshowvalue# (call-back in C).\\n",#cbname#);'}]}, '\t\tCFUNCSMESS("Saving jmpbuf for `#varname#`.\\n")...arname#_jmpbuf,&#cbname#_jmpbuf,sizeof(jmp_buf));'], 'need': ['SWAP', 'create_cb_arglist']}, {'_check': <function <lambda> at 0x4f7ad70>, 'callfortran': {<function isintent_c at 0x4f47ed8>: '#varname#,', <function <lambda> at 0x4f7ab90>: '&#varname#,'}, 'decl': '\t#ctype# #varname# = 0;', 'pyobjfrom': {<function debugcapi at 0x4fe3410>: '\tfprintf(stderr,"#vardebugshowvalue#\\n",#varname#);'}, 'return': {<function isintent_out at 0x4f47d70>: ',#varname#'}}, {'_check': <function <lambda> at 0x4f7af50>, 'need': {<function hasinitvalue at 0x4f48320>: 'math.h'}}, {'_check': <function <lambda> at 0x4f801b8>, 'argformat': {<function isrequired at 0x4f47c08>: 'O'}, 'args_capi': {<function isrequired at 0x4f47c08>: ',&#varname#_capi'}, 'closepyobjfrom': {<function isintent_inout at 0x4f47cf8>: '\t} /*if (f2py_success) of #varname# pyobjfrom*/'}, 'decl': '\tPyObject *#varname#_capi = Py_None;', 'keyformat': {<function isoptional at 0x4f47b18>: 'O'}, 'keys_capi': {<function isoptional at 0x4f47b18>: ',&#varname#_capi'}, 'need': {<function isintent_inout at 0x4f47cf8>: 'try_pyarr_from_#ctype#'}, 'pyobjfrom': {<function isintent_inout at 0x4f47cf8>: '\tf2py_success = try_pyarr_from_#ctype#(#varname#_capi,&#varname#);\n\tif (f2py_success) {'}}, {'_check': <function <lambda> at 0x4f80758>, '_depend': '', 'cleanupfrompyobj': '\t} /*if (f2py_success) of #varname#*/', 'frompyobj': [{<function hasinitvalue at 0x4f48320>: '\tif (#varname#_capi == Py_None) #varname# = #init#; else', '_depend': ''}, {<function <lambda> at 0x4f80398>: '\tif (#varname#_capi != Py_None)', '_depend': ''}, {<function <lambda> at 0x4f80488>: '\t\tf2py_success = #ctype#_from_pyobj(&#varname#,#...t be converted to #ctype#");\n\tif (f2py_success) {'}, {<function islogical at 0x4fe3848>: '\t\t#varname# = (#ctype#)PyObject_IsTrue(#varname#_capi);\n\t\tf2py_success = 1;\n\tif (f2py_success) {'}], 'need': {<function <lambda> at 0x4f80578>: '#ctype#_from_pyobj'}}, {'_check': <function <lambda> at 0x4f80938>, '_depend': '', 'frompyobj': {<function hasinitvalue at 0x4f48320>: '\t#varname# = #init#;'}, 'need': {<function isunsigned_long_longarray at 0x4f470c8>: 'unsigned_long_long', <function issigned_long_longarray at 0x4f472a8>: 'long_long', <function islong_long at 0x4fe3a28>: 'long_long', <function isunsigned_char at 0x4fe3aa0>: 'unsigned_char', <function isunsigned_short at 0x4fe3b18>: 'unsigned_short', <function isunsigned at 0x4fe3b90>: 'unsigned', <function isunsigned_long_long at 0x4fe3c08>: 'unsigned_long_long', <function islong_double at 0x4fe3cf8>: 'long_double', <function islong_complex at 0x4fe3d70>: 'complex_long_double', <function isunsigned_chararray at 0x4fe3ed8>: 'unsigned_char', ...}}, {'_check': <function <lambda> at 0x4f80b18>, '_depend': '', 'frompyobj': {<function debugcapi at 0x4fe3410>: '\tfprintf(stderr,"#vardebugshowvalue#\\n",#varname#);'}}, {'_check': <function iscomplex at 0x4fe37d0>, 'callfortran': {<function isintent_c at 0x4f47ed8>: '#varname#,', <function <lambda> at 0x4f80c08>: '&#varname#,'}, 'decl': '\t#ctype# #varname#;', 'pyobjfrom': {<function debugcapi at 0x4fe3410>: '\tfprintf(stderr,"#vardebugshowvalue#\\n",#varname#.r,#varname#.i);'}, 'return': {<function isintent_out at 0x4f47d70>: ',#varname#_capi'}}, {'_check': <function <lambda> at 0x4f80cf8>, 'argformat': {<function isrequired at 0x4f47c08>: 'O'}, 'args_capi': {<function isrequired at 0x4f47c08>: ',&#varname#_capi'}, 'closepyobjfrom': {<function isintent_inout at 0x4f47cf8>: '\t\t} /*if (f2py_success) of #varname# pyobjfrom*/'}, 'decl': '\tPyObject *#varname#_capi = Py_None;', 'keyformat': {<function isoptional at 0x4f47b18>: 'O'}, 'keys_capi': {<function isoptional at 0x4f47b18>: ',&#varname#_capi'}, 'need': {<function isintent_inout at 0x4f47cf8>: 'try_pyarr_from_#ctype#'}, 'pyobjfrom': {<function isintent_inout at 0x4f47cf8>: '\t\tf2py_success = try_pyarr_from_#ctype#(#varname#_capi,&#varname#);\n\t\tif (f2py_success) {'}}, {'_check': <function <lambda> at 0x4f7f050>, '_depend': '', 'cleanupfrompyobj': '\t} /*if (f2py_success) of #varname# frompyobj*/', 'frompyobj': [{<function hasinitvalue at 0x4f48320>: '\tif (#varname#_capi==Py_None) {#varname#.r = #init.r#, #varname#.i = #init.i#;} else'}, {<function <lambda> at 0x4f80ed8>: '\tif (#varname#_capi != Py_None)'}, '\t\tf2py_success = #ctype#_from_pyobj(&#varname#,#...t be converted to #ctype#");\n\tif (f2py_success) {'], 'need': ['#ctype#_from_pyobj']}, {'_check': <function <lambda> at 0x4f7f140>, 'decl': {<function isintent_out at 0x4f47d70>: '\tPyObject *#varname#_capi = Py_None;'}}, {'_check': <function <lambda> at 0x4f7f230>, '_depend': '', 'frompyobj': {<function hasinitvalue at 0x4f48320>: '\t#varname#.r = #init.r#, #varname#.i = #init.i#;'}}, {'_check': <function iscomplex at 0x4fe37d0>, 'need': ['pyobj_from_#ctype#1'], 'pyobjfrom': {<function isintent_out at 0x4f47d70>: '\t#varname#_capi = pyobj_from_#ctype#1(#varname#);'}}, ...]
aux_rules = [{'separatorsfor': {'callbacks': '\n', 'cfuncs': '\n', 'cleanupfrompyobj': '\n', 'closepyobjfrom': '\n', 'commonhooks': '\n', 'cppmacros': '\n', 'decl': '\n', 'externroutines': '\n', 'f90modhooks': '\n', 'freemem': '\n', ...}}, {'cleanupfrompyobj': '\t/* End of cleaning variable #varname# */', 'frompyobj': ['\t/* Processing auxiliary variable #varname# */', {<function debugcapi at 0x4fe3410>: '\tfprintf(stderr,"#vardebuginfo#\\n");'}], 'need': {<function isunsigned_long_longarray at 0x4f470c8>: 'unsigned_long_long', <function issigned_long_longarray at 0x4f472a8>: 'long_long', <function islong_long at 0x4fe3a28>: 'long_long', <function isunsigned_char at 0x4fe3aa0>: 'unsigned_char', <function isunsigned_short at 0x4fe3b18>: 'unsigned_short', <function isunsigned at 0x4fe3b90>: 'unsigned', <function isunsigned_long_long at 0x4fe3c08>: 'unsigned_long_long', <function islong_double at 0x4fe3cf8>: 'long_double', <function islong_complex at 0x4fe3d70>: 'complex_long_double', <function isunsigned_chararray at 0x4fe3ed8>: 'unsigned_char', ...}}, {'_check': <function <lambda> at 0x4f7b848>, 'decl': '\t#ctype# #varname# = 0;', 'frompyobj': {<function hasinitvalue at 0x4f48320>: '\t#varname# = #init#;'}, 'need': {<function hasinitvalue at 0x4f48320>: 'math.h'}}, {'_check': <function <lambda> at 0x4f7ba28>, 'docreturn': '#outvarname#,', 'docstrout': '\t#pydocsignout#', 'return': ',#varname#', 'returnformat': '#varrformat#'}, {'_check': <function iscomplex at 0x4fe37d0>, 'decl': '\t#ctype# #varname#;', 'frompyobj': {<function hasinitvalue at 0x4f48320>: '\t#varname#.r = #init.r#, #varname#.i = #init.i#;'}}, {'_check': <function isstring at 0x4fe3500>, 'decl': ['\t#ctype# #varname# = NULL;', '\tint slen(#varname#);'], 'need': ['len..']}, {'_check': <function isarray at 0x4fe36e0>, 'decl': ['\t#ctype# *#varname# = NULL;', '\tnpy_intp #varname#_Dims[#rank#] = {#rank*[-1]#};', '\tconst int #varname#_Rank = #rank#;'], 'need': ['len..', {<function hasinitvalue at 0x4f48320>: 'forcomb'}, {<function hasinitvalue at 0x4f48320>: 'CFUNCSMESS'}]}, {'_check': <function <lambda> at 0x4f7bc08>}, {'_check': <function <lambda> at 0x4f7bde8>}, {'_check': <function isint1array at 0x4fe3e60>, '_depend': '', 'need': '#ctype#'}, {'_check': <function isunsigned_chararray at 0x4fe3ed8>, '_depend': '', 'need': '#ctype#'}, {'_check': <function isunsigned_shortarray at 0x4fe3f50>, '_depend': '', 'need': '#ctype#'}, {'_check': <function isunsigned_long_longarray at 0x4f470c8>, '_depend': '', 'need': '#ctype#'}, {'_check': <function iscomplexarray at 0x4fe3de8>, '_depend': '', 'need': '#ctype#'}, {'_check': <function isstringarray at 0x4fe35f0>, 'callfortranappend': {<function isarrayofstrings at 0x4fe3668>: 'flen(#varname#),'}, 'need': 'string'}]
c2buildvalue_map = {'char': 'b', 'complex_double': 'N', 'complex_float': 'N', 'complex_long_double': 'N', 'double': 'd', 'float': 'f', 'int': 'i', 'long': 'l', 'long_long': 'L', 'short': 'h', ...}
c2capi_map = {'char': 'PyArray_BYTE', 'complex_double': 'PyArray_CDOUBLE', 'complex_float': 'PyArray_CFLOAT', 'complex_long_double': 'PyArray_CDOUBLE', 'double': 'PyArray_DOUBLE', 'float': 'PyArray_FLOAT', 'int': 'PyArray_INT', 'long': 'PyArray_LONG', 'long_double': 'PyArray_LONGDOUBLE', 'long_long': 'PyArray_LONGLONG', ...}
c2py_map = {'char': 'int', 'complex_double': 'complex', 'complex_float': 'complex', 'complex_long_double': 'complex', 'double': 'float', 'float': 'float', 'int': 'int', 'long': 'int', 'long_double': 'float', 'long_long': 'long', ...}
c2pycode_map = {'char': 'b', 'complex_double': 'D', 'complex_float': 'F', 'complex_long_double': 'G', 'double': 'd', 'float': 'f', 'int': 'i', 'long': 'l', 'long_double': 'g', 'long_long': 'q', ...}
cformat_map = {'char': '%d', 'complex_double': '(%g,%g)', 'complex_float': '(%g,%g)', 'complex_long_double': '(%Lg,%Lg)', 'double': '%g', 'float': '%g', 'int': '%d', 'long': '%ld', 'long_double': '%Lg', 'long_long': '%ld', ...}
check_rules = [{'frompyobj': {<function debugcapi at 0x4fe3410>: '\tfprintf(stderr,"debug-capi:Checking `#check#\'\\n");'}, 'need': 'len..'}, {'_break': '', '_check': <function <lambda> at 0x4eec2a8>, 'cleanupfrompyobj': '\t} /*CHECKSCALAR(#check#)*/', 'frompyobj': '\tCHECKSCALAR(#check#,"#check#","#nth# #varname#","#varshowvalue#",#varname#) {', 'need': 'CHECKSCALAR'}, {'_break': '', '_check': <function isstring at 0x4fe3500>, 'cleanupfrompyobj': '\t} /*CHECKSTRING(#check#)*/', 'frompyobj': '\tCHECKSTRING(#check#,"#check#","#nth# #varname#","#varshowvalue#",#varname#) {', 'need': 'CHECKSTRING'}, {'_break': '', '_check': <function isarray at 0x4fe36e0>, 'cleanupfrompyobj': '\t} /*CHECKARRAY(#check#)*/', 'frompyobj': '\tCHECKARRAY(#check#,"#check#","#nth# #varname#") {', 'need': 'CHECKARRAY'}, {'cleanupfrompyobj': '\t} /*CHECKGENERIC(#check#)*/', 'frompyobj': '\tCHECKGENERIC(#check#,"#check#","#nth# #varname#") {', 'need': 'CHECKGENERIC'}]
debugoptions = []
defmod_rules = [{'body': '/*eof body*/', 'externroutines': '/*eof externroutines*/', 'initcommonhooks': '/*eof initcommonhooks*/', 'initf2pywraphooks': '/*eof initf2pywraphooks*/', 'initf90modhooks': '/*eof initf90modhooks*/', 'latexdoc': '', 'method': '/*eof method*/', 'modnote': {<function hasnote at 0x4f48410>: '#note#', <function <lambda> at 0x4f731b8>: ''}, 'restdoc': '', 'routine_defs': '/*eof routine_defs*/'}]
depargs = []
f2cmap_all = {'byte': {'': 'char'}, 'character': {'': 'string'}, 'complex': {'': 'complex_float', '16': 'complex_double', '24': 'complex_long_double', '32': 'complex_long_double', '8': 'complex_float'}, 'complexkind': {'': 'complex_float', '12': 'complex_long_double', '16': 'complex_long_double', '4': 'complex_float', '8': 'complex_double'}, 'double complex': {'': 'complex_double'}, 'double precision': {'': 'double'}, 'integer': {'': 'int', '-1': 'unsigned_char', '-2': 'unsigned_short', '-4': 'unsigned', '-8': 'unsigned_long_long', '1': 'signed_char', '2': 'short', '4': 'int', '8': 'long_long'}, 'logical': {'': 'int', '1': 'char', '2': 'short', '4': 'int', '8': 'long_long'}, 'real': {'': 'float', '12': 'long_double', '16': 'long_double', '4': 'float', '8': 'double'}}
f2py_version = '2'
isintent_dict = {<function isoptional at 0x4f47b18>: 'OPTIONAL', <function isintent_in at 0x4f47c80>: 'INTENT_IN', <function isintent_inout at 0x4f47cf8>: 'INTENT_INOUT', <function isintent_out at 0x4f47d70>: 'INTENT_OUT', <function isintent_hide at 0x4f47de8>: 'INTENT_HIDE', <function isintent_c at 0x4f47ed8>: 'INTENT_C', <function isintent_cache at 0x4f47f50>: 'INTENT_CACHE', <function isintent_inplace at 0x4f481b8>: 'INTENT_INPLACE'}
k = 'initf90modhooks'
lcb2_map = {}
lcb_map = {}
module_rules = {'latexdoc': ['\\section{Module \\texttt{#texmodulename#}}\n', '#modnote#\n', '#latexdoc#'], 'modulebody': '/* File: #modulename#module.c\n * This file is au...lename#");\n#endif\n\n}\n#ifdef __cplusplus\n}\n#endif\n', 'restdoc': ['Module #modulename#\n================================================================================', '\n#restdoc#'], 'separatorsfor': {'latexdoc': '\n\n', 'restdoc': '\n\n'}}
options = {}
rout_rules = [{'argformat': '', 'args_capi': '', 'callfortran': '', 'callfortranappend': '', 'callfortranroutine': '/*callfortranroutine*/', 'cleanupfrompyobj': ['/*end of cleanupfrompyobj*/'], 'closepyobjfrom': ['/*end of closepyobjfrom*/'], 'decl': '/*decl*/', 'docreturn': '', 'docsign': '', ...}, {'_check': <function <lambda> at 0x4f73398>, 'apiname': 'f2py_rout_#modulename#_#name#', 'decl': '', 'pyname': '#modulename#.#name#'}, {'_check': <function ismoduleroutine at 0x4f47410>, 'apiname': 'f2py_rout_#modulename#_#f90modulename#_#name#', 'decl': '', 'pyname': '#modulename#.#f90modulename#.#name#'}, {'_check': <function issubroutine at 0x4f475f0>, 'callfortranroutine': [{<function debugcapi at 0x4fe3410>: ['\tfprintf(stderr,"debug-capi:Fortran subroutine `#fortranname#(#callfortran#)\'\\n");']}, {<function hasexternals at 0x4f479b0>: '\t\tif (#setjmpbuf#) {\n\t\t\tf2py_success = 0;\n\t\t} else {'}, {<function isthreadsafe at 0x4f47a28>: '\t\t\tPy_BEGIN_ALLOW_THREADS'}, {<function hascallstatement at 0x4f486e0>: '\t\t\t\t#callstatement#;\n\t\t\t\t/*(*f2py_func)(#callfortran#);*/'}, {<function <lambda> at 0x4f746e0>: '\t\t\t\t(*f2py_func)(#callfortran#);'}, {<function isthreadsafe at 0x4f47a28>: '\t\t\tPy_END_ALLOW_THREADS'}, {<function hasexternals at 0x4f479b0>: '\t\t}'}], 'declfortranroutine': {<function ismoduleroutine at 0x4f47410>: '', <function isdummyroutine at 0x4f48aa0>: '', <function <lambda> at 0x4f73758>: 'extern void #F_FUNC#(#fortranname#,#FORTRANNAME#)(#callprotoargument#);', <function <lambda> at 0x4f73a28>: 'extern void #fortranname#(#callprotoargument#);'}, 'functype': 'void', 'need': {<function <lambda> at 0x4f74500>: 'F_FUNC'}, 'routine_def': {<function <lambda> at 0x4f73c08>: '\t{"#name#",-1,{{-1}},0,(char *)#F_FUNC#(#fortran...NNAME#),(f2py_init_func)#apiname#,doc_#apiname#},', <function <lambda> at 0x4f73ed8>: '\t{"#name#",-1,{{-1}},0,(char *)#fortranname#,(f2py_init_func)#apiname#,doc_#apiname#},', <function <lambda> at 0x4f74140>: '\t{"#name#",-1,{{-1}},0,NULL,(f2py_init_func)#apiname#,doc_#apiname#},'}}, {'_check': <function isfunction_wrap at 0x4f47578>, 'callfortranroutine': [{<function debugcapi at 0x4fe3410>: ['\tfprintf(stderr,"debug-capi:Fortran subroutine `f2pywrap#name_lower#(#callfortran#)\'\\n");']}, {<function hasexternals at 0x4f479b0>: '\tif (#setjmpbuf#) {\n\t\tf2py_success = 0;\n\t} else {'}, {<function isthreadsafe at 0x4f47a28>: '\tPy_BEGIN_ALLOW_THREADS'}, {<function <lambda> at 0x4f780c8>: '\t(*f2py_func)(#callfortran#);'}, {<function hascallstatement at 0x4f486e0>: '\t#callstatement#;\n\t/*(*f2py_func)(#callfortran#);*/'}, {<function isthreadsafe at 0x4f47a28>: '\tPy_END_ALLOW_THREADS'}, {<function hasexternals at 0x4f479b0>: '\t}'}], 'declfortranroutine': {<function isdummyroutine at 0x4f48aa0>: '', <function <lambda> at 0x4f748c0>: 'extern void #F_WRAPPEDFUNC#(#name_lower#,#NAME#)(#callprotoargument#);'}, 'functype': 'void', 'initf2pywraphook': {<function <lambda> at 0x4f74c80>: '\n {\n extern #ctype# #F_FUNC#(#name_lower...)#F_FUNC#(#name_lower#,#NAME#),NULL));\n }\n '}, 'need': {<function <lambda> at 0x4f74e60>: ['F_WRAPPEDFUNC', 'F_FUNC']}, 'routine_def': {<function isdummyroutine at 0x4f48aa0>: '\t{"#name#",-1,{{-1}},0,NULL,(f2py_init_func)#apiname#,doc_#apiname#},', <function <lambda> at 0x4f74aa0>: '\t{"#name#",-1,{{-1}},0,(char *)#F_WRAPPEDFUNC#(#...#NAME#),(f2py_init_func)#apiname#,doc_#apiname#},'}}, {'_check': <function <lambda> at 0x4f78668>, 'callfortranroutine': [{<function <lambda> at 0x4f782a8>: '#ifdef USESCOMPAQFORTRAN\n\tfprintf(stderr,"debug-...#ctype# #fortranname#(#callfortran#)\\n");\n#endif\n'}, {<function <lambda> at 0x4f78488>: '\tfprintf(stderr,"debug-capi:Fortran function #ctype# #fortranname#(#callfortran#)\\n");\n'}], 'docreturn': {<function <lambda> at 0x4f781b8>: '#rname#,'}, 'docstrout': '\t#pydocsignout#', 'functype': '#ctype#', 'latexdocstrout': [r'\item[]{{}\verb@#pydocsignout#@{}}', {<function hasresultnote at 0x4f48488>: '--- #resultnote#'}]}, {'_check': <function <lambda> at 0x4f7b0c8>, 'callfortranroutine': [{<function hasexternals at 0x4f479b0>: '\tif (#setjmpbuf#) {\n\t\tf2py_success = 0;\n\t} else {'}, {<function isthreadsafe at 0x4f47a28>: '\tPy_BEGIN_ALLOW_THREADS'}, {<function hascallstatement at 0x4f486e0>: '\t#callstatement#;\n/*\t#name#_return_value = (*f2py_func)(#callfortran#);*/\n'}, {<function <lambda> at 0x4f766e0>: '\t#name#_return_value = (*f2py_func)(#callfortran#);'}, {<function isthreadsafe at 0x4f47a28>: '\tPy_END_ALLOW_THREADS'}, {<function hasexternals at 0x4f479b0>: '\t}'}, {<function <lambda> at 0x4f767d0>: '\tfprintf(stderr,"#routdebugshowvalue#\\n",#name#_return_value.r,#name#_return_value.i);'}, {<function <lambda> at 0x4f769b0>: '\tfprintf(stderr,"#routdebugshowvalue#\\n",#name#_return_value);'}], 'decl': [{<function iscomplexfunction_warn at 0x4f478c0>: '\t#ctype# #name#_return_value={0,0};', <function <lambda> at 0x4f76500>: '\t#ctype# #name#_return_value=0;'}, {<function iscomplexfunction at 0x4f47848>: '\tPyObject *#name#_return_value_capi = Py_None;'}], 'declfortranroutine': {<function isdummyroutine at 0x4f48aa0>: '', <function <lambda> at 0x4f78a28>: 'extern #ctype# #F_FUNC#(#fortranname#,#FORTRANNAME#)(#callprotoargument#);', <function <lambda> at 0x4f78cf8>: 'extern #ctype# #fortranname#(#callprotoargument#);'}, 'need': [{<function <lambda> at 0x4f76aa0>: 'F_FUNC'}, {<function iscomplexfunction at 0x4f47848>: 'pyobj_from_#ctype#1'}, {<function islong_longfunction at 0x4f47758>: 'long_long'}, {<function islong_doublefunction at 0x4f477d0>: 'long_double'}], 'pyobjfrom': {<function iscomplexfunction at 0x4f47848>: '\t#name#_return_value_capi = pyobj_from_#ctype#1(#name#_return_value);'}, 'return': {<function iscomplexfunction at 0x4f47848>: ',#name#_return_value_capi', <function <lambda> at 0x4f76d70>: ',#name#_return_value'}, 'returnformat': {<function <lambda> at 0x4f76b90>: '#rformat#'}, 'routine_def': {<function isdummyroutine at 0x4f48aa0>: '\t{"#name#",-1,{{-1}},0,NULL,(f2py_init_func)#apiname#,doc_#apiname#},', <function <lambda> at 0x4f76140>: '\t{"#name#",-1,{{-1}},0,(char *)#F_FUNC#(#fortran...NNAME#),(f2py_init_func)#apiname#,doc_#apiname#},', <function <lambda> at 0x4f76410>: '\t{"#name#",-1,{{-1}},0,(char *)#fortranname#,(f2py_init_func)#apiname#,doc_#apiname#},'}}, {'_check': <function <lambda> at 0x4f7b668>, 'callfortran': '#name#_return_value,#name#_return_value_len,', 'callfortranroutine': ['\t#name#_return_value_len = #rlength#;', '\tif ((#name#_return_value = (string)malloc(sizeof(char)*(#name#_return_value_len+1))) == NULL) {', '\t\tPyErr_SetString(PyExc_MemoryError, "out of memory");', '\t\tf2py_success = 0;', '\t} else {', "\t\t(#name#_return_value)[#name#_return_value_len] = '\\0';", '\t}', '\tif (f2py_success) {', {<function hasexternals at 0x4f479b0>: '\t\tif (#setjmpbuf#) {\n\t\t\tf2py_success = 0;\n\t\t} else {'}, {<function isthreadsafe at 0x4f47a28>: '\t\tPy_BEGIN_ALLOW_THREADS'}, '#ifdef USESCOMPAQFORTRAN\n\t\t(*f2py_func)(#callcom...n#);\n#else\n\t\t(*f2py_func)(#callfortran#);\n#endif\n', {<function isthreadsafe at 0x4f47a28>: '\t\tPy_END_ALLOW_THREADS'}, {<function hasexternals at 0x4f479b0>: '\t\t}'}, {<function debugcapi at 0x4fe3410>: '\t\tfprintf(stderr,"#routdebugshowvalue#\\n",#name#_return_value_len,#name#_return_value);'}, '\t} /* if (f2py_success) after (string)malloc */'], 'decl': ['\t#ctype# #name#_return_value = NULL;', '\tint #name#_return_value_len = 0;'], 'declfortranroutine': 'extern void #F_FUNC#(#fortranname#,#FORTRANNAME#)(#callprotoargument#);', 'freemem': '\tSTRINGFREE(#name#_return_value);', 'need': ['F_FUNC', '#ctype#', 'STRINGFREE'], 'return': ',#name#_return_value', 'returnformat': '#rformat#', 'routine_def': {<function <lambda> at 0x4f7b2a8>: '\t{"#name#",-1,{{-1}},0,(char *)#F_FUNC#(#fortran...NNAME#),(f2py_init_func)#apiname#,doc_#apiname#},', <function <lambda> at 0x4f7b488>: '\t{"#name#",-1,{{-1}},0,(char *)#fortranname#,(f2py_init_func)#apiname#,doc_#apiname#},'}}, {'_check': <function debugcapi at 0x4fe3410>, 'routdebugenter': '\tfprintf(stderr,"debug-capi:Python C/API function #modulename#.#name#(#docsignature#)\\n");', 'routdebugfailure': '\tfprintf(stderr,"debug-capi:Python C/API function #modulename#.#name#: failure.\\n");', 'routdebugleave': '\tfprintf(stderr,"debug-capi:Python C/API function #modulename#.#name#: successful.\\n");'}]
routine_rules = {'body': '\n#begintitle#\nstatic char doc_#apiname#[] = "\\\nF...();\n#endif\n\treturn capi_buildvalue;\n}\n#endtitle#\n', 'cppmacros': {<function debugcapi at 0x4fe3410>: '#define DEBUGCFUNCS'}, 'doc': '#docreturn##name#(#docsignature#)', 'docs': '"\t#docreturn##name#(#docsignature#)\\n"\n', 'docshort': '#docreturn##name#(#docsignatureshort#)', 'externroutines': '#declfortranroutine#', 'initf2pywraphooks': '#initf2pywraphook#', 'latexdoc': ['\\subsection{Wrapper function \\texttt{#texname#}}\n', '\n\\noindent{{}\\verb@#docreturn##name#@{}}\\texttt{...signatureshort#)}\n#routnote#\n\n#latexdocstrsigns#\n'], 'need': ['arrayobject.h', 'CFUNCSMESS', 'MINMAX'], 'restdoc': ['Wrapped function ``#name#``\n--------------------...-------------------------------------------------'], ...}
sepdict = {'callbacks': '\n', 'cfuncs': '\n', 'cleanupfrompyobj': '\n', 'closepyobjfrom': '\n', 'commonhooks': '\n', 'cppmacros': '\n', 'decl': '\n', 'externroutines': '\n', 'f90modhooks': '\n', 'freemem': '\n', ...}
stnd = {0: 'th', 1: 'st', 2: 'nd', 3: 'rd', 4: 'th', 5: 'th', 6: 'th', 7: 'th', 8: 'th', 9: 'th'}
typedef_need_dict = {<function isunsigned_long_longarray at 0x4f470c8>: 'unsigned_long_long', <function issigned_long_longarray at 0x4f472a8>: 'long_long', <function islong_long at 0x4fe3a28>: 'long_long', <function isunsigned_char at 0x4fe3aa0>: 'unsigned_char', <function isunsigned_short at 0x4fe3b18>: 'unsigned_short', <function isunsigned at 0x4fe3b90>: 'unsigned', <function isunsigned_long_long at 0x4fe3c08>: 'unsigned_long_long', <function islong_double at 0x4fe3cf8>: 'long_double', <function islong_complex at 0x4fe3d70>: 'complex_long_double', <function isunsigned_chararray at 0x4fe3ed8>: 'unsigned_char', ...}
using_newcore = True
wrapfuncs = 1