Coder Social home page Coder Social logo

Comments (7)

mgaitan avatar mgaitan commented on August 13, 2024

Hey @vallism, you are right, thanks for the report.

This bug was introduced after #8 . Before that, instead to run the command f2py via a subprocess call, we directly called the f2py.main() function.

I'm not sure if the better idea is to undo that change and handle the Window's problem it fixes with a different approach, or make the call to the proper f2py script depending the python version.

For the latter, I'm not sure if append the python version would be enough. For example, in my computer (w/ubuntu) I have these:

tin@morochita:~/lab/fortran_magic$ f2py<tab>
f2py     f2py2.7  f2py3.4  

but is this common to any system/os?

from fortran_magic.

vallis avatar vallis commented on August 13, 2024

This may be a question for the numpy.f2py developers. I looked in their github, and there's no mention of f2py3, so I suspect that it may be something that packagers add.

On my anaconda Python 2.7 + 3.4 installation on OS X, I have f2py under the main /bin directory, and f2py3 under the python 3 sub-environment. On my homebrew Python 2.7 + 3.4 installation, I have only f2py2.7 in /usr/local/bin; the pip-installed numpy creates f2py for both Python 2.7 and 3, but with the wrong hash-bang... Basically, it's all over the place.

Perhaps you could do the awkward thing, and call f2py.main on anything else than windows. Another solution, less transparent to the user but still OK IMHO, would be to allow selecting the f2py executable in the iPython magic.

from fortran_magic.

mgaitan avatar mgaitan commented on August 13, 2024

Maybe the great numpy's maintainers @charris or @juliantaylor can help us: Is there a multiplatform python2/3 compatible way to run f2py programatically (i.e from Python) ?

from fortran_magic.

juliantaylor avatar juliantaylor commented on August 13, 2024

should just be numpy.f2py.compile

the f2py binary is just a wrapper around numpy.f2py functions so you should be able to do everything from python

from fortran_magic.

juliantaylor avatar juliantaylor commented on August 13, 2024

no idea why it originally doesn't work for windows directly from python. that would be interesting to figure out but i have no windows.
otherwise maybe one can use the python -m thing (pep338), with python being sys.executable, though I have no idea if that invocation method works with f2py, but that should be fixable if not

from fortran_magic.

juliantaylor avatar juliantaylor commented on August 13, 2024

too bad doesn't work, but added numpy/numpy#5565

from fortran_magic.

astrojuanlu avatar astrojuanlu commented on August 13, 2024

I just checked and replacing the f2py call with python -m numpy.f2py works, but it requires NumPy 1.10 (see numpy/numpy@29c019a). Since it seems to be the simplest solution, @mgaitan would you accept a pull request with this change and tag a new release?

from fortran_magic.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.