HOME


sh-3ll 1.0
DIR:/usr/local/lib64/python3.6/site-packages/numpy/f2py/__pycache__/
Upload File :
Current File : //usr/local/lib64/python3.6/site-packages/numpy/f2py/__pycache__/__init__.cpython-36.pyc
3

���h��@szdZdddgZddlZddlZddlZddlmZddlmZdd	lmZej	Z	ej
Z
ddd�Zddlm
Z
e
e�Z[
dS)z(Fortran to Python Interface Generator.

�run_main�compile�f2py_testing�N�)�f2py2e)r)�diagnose�untitled�T�.fcCsJddl}ddl}|dkr4|j|d�\}}	tj|�n|}	t|t�sLt|d�}z�t|	d��}|j|�WdQRXdd||j	g}
t|t�r�tj	dk}|j
||d	�}|
j|�tj
dd
g|
}ytj|�}
WnJtjk
r�}z|j}d}
WYdd}~Xn*tk
�rd}d}
YnXd}|
j�}
|�r,t|
�Wd|dk�rDtj|	�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-8�wz-cz-m�posix)r
z)import numpy.f2py as f2py2e;f2py2e.main()r	�)�tempfile�shlex�mkstemp�os�close�
isinstance�str�open�write�name�split�extend�sys�
executable�
subprocess�check_output�CalledProcessError�
returncode�OSError�decode�print�remove)�source�
modulename�
extra_args�verboseZ	source_fn�	extensionrr�f�fname�argsZis_posix�c�output�exc�status�r1�4/tmp/pip-build-5_djhm0z/numpy/numpy/f2py/__init__.pyrsD2







)�PytestTester)rr	TNr
)�__doc__�__all__rrrr	rrrr�mainrZnumpy._pytesttesterr3�__name__�testr1r1r1r2�<module>s"

\