Packaging legacy Fortran in Python. Is it OK to use setuptools and numpy.distutils?

落花浮王杯 提交于 2019-12-02 16:06:38

This seems to work but I have questions.

  1. Is it generally good practice to mix setuptools and numpy.distribute?
  2. Does the order I import them matter? Should I always import setuptools first?
  3. Is there an official up-to-date tutorial for packaging extensions to numpy? Perhaps even one with some discussion Fortran extensions?
  1. You should not need to use numpy.distribute anymore.

  2. ^^ Not necessary

  3. Particularly for wrapping fortran code with numpy, there is the popular f2py. However I personally find the necessary code annotations redundant, because good fortran code contains all necessary information.

(warning personal project plug below)

Recently released is the cleaner fmodpy, which automatically generates all necessary wrapper code in an understandable and clean interface. It supports pre-Fortran90, but is best suited for Fortran90 and later. It could be used to generate a clean distribution along with the python interface of code (presuming users have gfortran installed).

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!