File: //home/arjun/.local/lib/python3.10/site-packages/numpy/f2py/__pycache__/f2py2e.cpython-310.pyc
o
���gEl � @ s~ d Z ddlZddlZddlZddlZddlmZ ddlmZ ddl Z ddl
Z
ddlmZ ddlm
Z
ddlmZ dd lmZ dd
lmZ ddlmZ ddlmZ dd
lmZ ddlmZ ejZejZejjZejZejZejdkZde� de� d�Z dd� Z!dd� Z"dd� Z#dd� Z$dd� Z%d2dd�Z&dd � Z'G d!d"� d"e j(�Z)d#d$� Z*d%d&� Z+d'd(� Z,d)d*� Z-d+d,� Z.d3d.d/�Z/d0d1� Z0dS )4ae
f2py2e - Fortran to Python C/API generator. 2nd Edition.
See __usage__ below.
Copyright 1999 -- 2011 Pearu Peterson all rights reserved.
Copyright 2011 -- present NumPy Developers.
Permission to use, modify, and distribute this software is given under the
terms of the NumPy License.
NO WARRANTY IS EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
� N)�Path)� dropwhile� )�crackfortran)�rules)�cb_rules)�auxfuncs)�cfuncs)�f90mod_rules)�__version__)� capi_maps)�f2py_build_generator)� � a� Usage:
1) To construct extension module sources:
f2py [<options>] <fortran files> [[[only:]||[skip:]] \
<fortran functions> ] \
[: <fortran files> ...]
2) To compile fortran files and build extension modules:
f2py -c [<options>, <build_flib options>, <extra options>] <fortran files>
3) To generate signature files:
f2py -h <filename.pyf> ...< same options as in (1) >
Description: This program generates a Python C/API file (<modulename>module.c)
that contains wrappers for given fortran functions so that they
can be called from Python. With the -c option the corresponding
extension modules are built.
Options:
-h <filename> Write signatures of the fortran routines to file <filename>
and exit. You can then edit <filename> and use it instead
of <fortran files>. If <filename>==stdout then the
signatures are printed to stdout.
<fortran functions> Names of fortran routines for which Python C/API
functions will be generated. Default is all that are found
in <fortran files>.
<fortran files> Paths to fortran/signature files that will be scanned for
<fortran functions> in order to determine their signatures.
skip: Ignore fortran functions that follow until `:'.
only: Use only fortran functions that follow until `:'.
: Get back to <fortran files> mode.
-m <modulename> Name of the module; f2py generates a Python/C API
file <modulename>module.c or extension module <modulename>.
Default is 'untitled'.
'-include<header>' Writes additional headers in the C wrapper, can be passed
multiple times, generates #include <header> each time.
--[no-]lower Do [not] lower the cases in <fortran files>. By default,
--lower is assumed with -h key, and --no-lower without -h key.
--build-dir <dirname> All f2py generated files are created in <dirname>.
Default is tempfile.mkdtemp().
--overwrite-signature Overwrite existing signature file.
--[no-]latex-doc Create (or not) <modulename>module.tex.
Default is --no-latex-doc.
--short-latex Create 'incomplete' LaTeX document (without commands
\documentclass, \tableofcontents, and \begin{document},
\end{document}).
--[no-]rest-doc Create (or not) <modulename>module.rst.
Default is --no-rest-doc.
--debug-capi Create C/API code that reports the state of the wrappers
during runtime. Useful for debugging.
--[no-]wrap-functions Create Fortran subroutine wrappers to Fortran 77
functions. --wrap-functions is default because it ensures
maximum portability/compiler independence.
--include-paths <path1>:<path2>:... Search include files from the given
directories.
--help-link [..] List system resources found by system_info.py. See also
--link-<resource> switch below. [..] is optional list
of resources names. E.g. try 'f2py --help-link lapack_opt'.
--f2cmap <filename> Load Fortran-to-Python KIND specification from the given
file. Default: .f2py_f2cmap in current directory.
--quiet Run quietly.
--verbose Run with extra verbosity.
--skip-empty-wrappers Only generate wrapper files when needed.
-v Print f2py version ID and exit.
build backend options (only effective with -c)
[NO_MESON] is used to indicate an option not meant to be used
with the meson backend or above Python 3.12:
--fcompiler= Specify Fortran compiler type by vendor [NO_MESON]
--compiler= Specify distutils C compiler type [NO_MESON]
--help-fcompiler List available Fortran compilers and exit [NO_MESON]
--f77exec= Specify the path to F77 compiler [NO_MESON]
--f90exec= Specify the path to F90 compiler [NO_MESON]
--f77flags= Specify F77 compiler flags
--f90flags= Specify F90 compiler flags
--opt= Specify optimization flags [NO_MESON]
--arch= Specify architecture specific optimization flags [NO_MESON]
--noopt Compile without optimization [NO_MESON]
--noarch Compile without arch-dependent optimization [NO_MESON]
--debug Compile with debugging information
--dep <dependency>
Specify a meson dependency for the module. This may
be passed multiple times for multiple dependencies.
Dependencies are stored in a list for further processing.
Example: --dep lapack --dep scalapack
This will identify "lapack" and "scalapack" as dependencies
and remove them from argv, leaving a dependencies list
containing ["lapack", "scalapack"].
--backend <backend_type>
Specify the build backend for the compilation process.
The supported backends are 'meson' and 'distutils'.
If not specified, defaults to 'distutils'. On
Python 3.12 or higher, the default is 'meson'.
Extra options (only effective with -c):
--link-<resource> Link extension module with <resource> as defined
by numpy.distutils/system_info.py. E.g. to link
with optimized LAPACK libraries (vecLib on MacOSX,
ATLAS elsewhere), use --link-lapack_opt.
See also --help-link switch. [NO_MESON]
-L/path/to/lib/ -l<libname>
-D<define> -U<name>
-I/path/to/include/
<filename>.o <filename>.so <filename>.a
Using the following macros may be required with non-gcc Fortran
compilers:
-DPREPEND_FORTRAN -DNO_APPEND_FORTRAN -DUPPERCASE_FORTRAN
-DUNDERSCORE_G77
When using -DF2PY_REPORT_ATEXIT, a performance report of F2PY
interface is printed out at exit (platforms: Linux).
When using -DF2PY_REPORT_ON_ARRAY_COPY=<int>, a message is
sent to stderr whenever F2PY interface makes a copy of an
array. Integer <int> sets the threshold for array sizes when
a message should be shown.
Version: z
numpy Version: z�
License: NumPy license (see LICENSE.txt in the NumPy source code)
Copyright 1999 -- 2011 Pearu Peterson all rights reserved.
Copyright 2011 -- present NumPy Developers.
https://numpy.org/doc/stable/f2py/index.html
c C s� g g g g f\}}}}d\}}}}} }
}}d}
d}d}d}d}d}d}t | �\}} d\}}|d d d�}| D �]�}|d kr<q4|d
krCd}q4|dkrJd}q4|dkrQd}q4|d d
� dkrc|�|d
d � � q4|dkrjd}q4|dkrqd} q4|dkrxd}q4|dkrd}
q4|dkr�|
d7 }
q4|dkr�d}q4|dkr�d}q4|dkr�d}q4|dkr�d}q4|dkr�d}q4|dkr�d}q4|dkr�d|d<