numpy 1.9.1

  • g6_316253
    了解作者
  • 3.8MB
    文件大小
  • 1
    文件格式
  • 0
    收藏次数
  • VIP专享
    资源类型
  • 0
    下载次数
  • 2022-04-12 10:33
    上传日期
python numpy 1.9.1.tar.gz安装包,给需要的朋友
numpy-1.9.1.tar.gz
内容介绍
.. -*- rest -*- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ F2PY: Fortran to Python interface generator ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :Author: Pearu Peterson <pearu@cens.ioc.ee> :License: NumPy License :Web-site: http://cens.ioc.ee/projects/f2py2e/ :Discussions to: `f2py-users mailing list`_ :Documentation: `User's Guide`__, FAQ__ :Platforms: All :Date: $Date: 2005/01/30 18:54:53 $ .. _f2py-users mailing list: http://cens.ioc.ee/mailman/listinfo/f2py-users/ __ usersguide/index.html __ FAQ.html .. Contents:: ============== Introduction ============== The purpose of the F2PY --*Fortran to Python interface generator*-- project is to provide connection between Python_ and Fortran languages. F2PY is a Python extension tool for creating Python C/API modules from (handwritten or F2PY generated) signature files (or directly from Fortran sources). The generated extension modules facilitate: * Calling Fortran 77/90/95, Fortran 90/95 module, and C functions from Python. * Accessing Fortran 77 ``COMMON`` blocks and Fortran 90/95 module data (including allocatable arrays) from Python. * Calling Python functions from Fortran or C (call-backs). * Automatically handling the difference in the data storage order of multi-dimensional Fortran and Numerical Python (i.e. C) arrays. In addition, F2PY can build the generated extension modules to shared libraries with one command. F2PY uses the ``numpy_distutils`` module from SciPy_ that supports number of major Fortran compilers. .. (see `COMPILERS.txt`_ for more information). F2PY generated extension modules depend on NumPy_ package that provides fast multi-dimensional array language facility to Python. --------------- Main features --------------- Here follows a more detailed list of F2PY features: * F2PY scans real Fortran codes to produce the so-called signature files (.pyf files). The signature files contain all the information (function names, arguments and their types, etc.) that is needed to construct Python bindings to Fortran (or C) functions. The syntax of signature files is borrowed from the Fortran 90/95 language specification and has some F2PY specific extensions. The signature files can be modified to dictate how Fortran (or C) programs are called from Python: + F2PY solves dependencies between arguments (this is relevant for the order of initializing variables in extension modules). + Arguments can be specified to be optional or hidden that simplifies calling Fortran programs from Python considerably. + In principle, one can design any Python signature for a given Fortran function, e.g. change the order arguments, introduce auxiliary arguments, hide the arguments, process the arguments before passing to Fortran, return arguments as output of F2PY generated functions, etc. * F2PY automatically generates __doc__ strings (and optionally LaTeX documentation) for extension modules. * F2PY generated functions accept arbitrary (but sensible) Python objects as arguments. The F2PY interface automatically takes care of type-casting and handling of non-contiguous arrays. * The following Fortran constructs are recognized by F2PY: + All basic Fortran types:: integer[ | *1 | *2 | *4 | *8 ], logical[ | *1 | *2 | *4 | *8 ] integer*([ -1 | -2 | -4 | -8 ]) character[ | *(*) | *1 | *2 | *3 | ... ] real[ | *4 | *8 | *16 ], double precision complex[ | *8 | *16 | *32 ] Negative ``integer`` kinds are used to wrap unsigned integers. + Multi-dimensional arrays of all basic types with the following dimension specifications:: <dim> | <start>:<end> | * | : + Attributes and statements:: intent([ in | inout | out | hide | in,out | inout,out | c | copy | cache | callback | inplace | aux ]) dimension(<dimspec>) common, parameter allocatable optional, required, external depend([<names>]) check([<C-booleanexpr>]) note(<LaTeX text>) usercode, callstatement, callprotoargument, threadsafe, fortranname pymethoddef entry * Because there are only little (and easily handleable) differences between calling C and Fortran functions from F2PY generated extension modules, then F2PY is also well suited for wrapping C libraries to Python. * Practice has shown that F2PY generated interfaces (to C or Fortran functions) are less error prone and even more efficient than handwritten extension modules. The F2PY generated interfaces are easy to maintain and any future optimization of F2PY generated interfaces transparently apply to extension modules by just regenerating them with the latest version of F2PY. * `F2PY Users Guide and Reference Manual`_ =============== Prerequisites =============== F2PY requires the following software installed: * Python_ (versions 1.5.2 or later; 2.1 and up are recommended). You must have python-dev package installed. * NumPy_ (versions 13 or later; 20.x, 21.x, 22.x, 23.x are recommended) * Numarray_ (version 0.9 and up), optional, partial support. * Scipy_distutils (version 0.2.2 and up are recommended) from SciPy_ project. Get it from Scipy CVS or download it below. Python 1.x users also need distutils_. Of course, to build extension modules, you'll need also working C and/or Fortran compilers installed. ========== Download ========== You can download the sources for the latest F2PY and numpy_distutils releases as: * `2.x`__/`F2PY-2-latest.tar.gz`__ * `2.x`__/`numpy_distutils-latest.tar.gz`__ Windows users might be interested in Win32 installer for F2PY and Scipy_distutils (these installers are built using Python 2.3): * `2.x`__/`F2PY-2-latest.win32.exe`__ * `2.x`__/`numpy_distutils-latest.win32.exe`__ Older releases are also available in the directories `rel-0.x`__, `rel-1.x`__, `rel-2.x`__, `rel-3.x`__, `rel-4.x`__, `rel-5.x`__, if you need them. .. __: 2.x/ .. __: 2.x/F2PY-2-latest.tar.gz .. __: 2.x/ .. __: 2.x/numpy_distutils-latest.tar.gz .. __: 2.x/ .. __: 2.x/F2PY-2-latest.win32.exe .. __: 2.x/ .. __: 2.x/numpy_distutils-latest.win32.exe .. __: rel-0.x .. __: rel-1.x .. __: rel-2.x .. __: rel-3.x .. __: rel-4.x .. __: rel-5.x Development version of F2PY from CVS is available as `f2py2e.tar.gz`__. __ http://cens.ioc.ee/cgi-bin/viewcvs.cgi/python/f2py2e/f2py2e.tar.gz?tarball=1 Debian Sid users can simply install ``python-f2py`` package. ============== Installation ============== Unpack the source file, change to directrory ``F2PY-?-???/`` and run (you may need to become a root):: python setup.py install The F2PY installation installs a Python package ``f2py2e`` to your Python ``site-packages`` directory and a script ``f2py`` to your Python executable path. See also Installation__ section in `F2PY FAQ`_. .. __: FAQ.html#installation Similarly, to install ``numpy_distutils``, unpack its tar-ball and run:: python setup.py install ======= Usage ======= To check if F2PY is installed correctly, run :: f2py without any arguments. This should print out the usage information of the ``f2py`` program. Next, try out the following three steps: 1) Create a Fortran file `hello.f`__ that contains:: C File hello.f subroutine foo (a) integer a print*, "Hello from Fortran!" print*, "a=",a end __ hello.f 2) Run :: f2py -c -m hello hello.f This will build an extension module ``hello.so`` (or ``hello.sl``, or ``hello.pyd``, etc. depending on your platform) into the current directory. 3) Now in Python try:: >>> import hello >>> print hello.__doc__ >>> print hello.foo.__doc__ >>> hello.foo(4) Hello from Fortran! a= 4 >>> If the above works, then you can try out more thorough `F2PY unit tests`__ and read the `F2PY Users Guide and Reference Manual`_. __ FAQ.html#q-how-to-test-if-f2py-is-working-correctly =============== Docume
评论
    相关推荐
    • Python
      Python Boto3代码
    • Python
      python程序
    • Python
      Python
    • python
      Python,就在这里。
    • Python
      Python-
    • Python
      完整的python 其中包含用于学习python的代码,注释和微型项目。
    • Python
      项目Python
    • Python
      Pythonpython3中使用乌龟库的简单pong游戏 贡献 拉请求是欢迎的! :) 执照
    • Python
      Python Dit是Mijn储存库van Python
    • python
      Python 基本的python编程