U C^B @sdZddlmZmZmZdddgZddlZddlZddlZddl Z ddl m Z dd l m Z dd l mZe jZe jZdddZddlmZeeZ[dS)z(Fortran to Python Interface Generator. )divisionabsolute_importprint_functionrun_maincompile f2py_testingN)f2py2e)r)diagnoseuntitledT.fc CsNddl}ddl}|dkr4|j|d\}} t|n|} t|tsLt|d}zt| d}| |W5QRXdd||j g} t|t j j rtj dk} |j|| d }| |tjdd g| } zt| } WnJtjk r}z|j}d } W5d}~XYn*tk rd }d } YnXd}| } |r0t| W5|dkrHt| X|S) a Build extension module from a Fortran 77 source string with f2py. Parameters ---------- source : str or bytes Fortran source of module / subroutine to compile .. versionchanged:: 1.16.0 Accept str as well as bytes modulename : str, optional The name of the compiled python module extra_args : str or list, optional Additional parameters passed to f2py .. versionchanged:: 1.16.0 A list of args may also be provided. verbose : bool, optional Print f2py output to screen source_fn : str, optional Name of the file where the fortran source is written. The default is to use a temporary file with the extension provided by the `extension` parameter extension : {'.f', '.f90'}, optional Filename extension if `source_fn` is not provided. The extension tells which fortran standard is used. The default is `.f`, which implies F77 standard. .. versionadded:: 1.11.0 Returns ------- result : int 0 on success Examples -------- .. include:: compile_session.dat :literal: rN)suffixzutf-8wz-cz-mposix)rz)import numpy.f2py as f2py2e;f2py2e.main()r )tempfileshlexmkstemposclose isinstancestrremoveopenwritenamenpcompat basestringsplitextendsys executable subprocess check_outputCalledProcessError returncodeOSErrordecodeprint)source modulename extra_argsverboseZ source_fn extensionrrffnameargsZis_posixcoutputexcstatusr76/tmp/pip-install-6_kvzl1k/numpy/numpy/f2py/__init__.pyrsJ2          ) PytestTester)r r TNr )__doc__ __future__rrr__all__r"r$rZnumpyrr r rr rmainrZnumpy._pytesttesterr9__name__testr7r7r7r8s(     a