Thanks to visit codestin.com
Credit goes to github.com

Skip to content

ENH: argparse f2py #20056

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions numpy/f2py/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,16 @@
"""Fortran to Python Interface Generator.

"""
__all__ = ['run_main', 'compile', 'get_include']
__all__ = ['main', 'compile', 'get_include']

import sys
import subprocess
import os

from . import f2py2e
from . import f2pyarg
from . import diagnose

run_main = f2py2e.run_main
main = f2py2e.main
main = f2pyarg.main


def compile(source,
Expand Down Expand Up @@ -102,7 +101,7 @@ def compile(source,

c = [sys.executable,
'-c',
'import numpy.f2py as f2py2e;f2py2e.main()'] + args
'import numpy.f2py as f2pyarg;f2pyarg.main()'] + args
try:
cp = subprocess.run(c, stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
Expand Down
2 changes: 1 addition & 1 deletion numpy/f2py/__main__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# See:
# https://web.archive.org/web/20140822061353/http://cens.ioc.ee/projects/f2py2e
from numpy.f2py.f2py2e import main
from numpy.f2py.f2pyarg import main

main()
14 changes: 7 additions & 7 deletions numpy/f2py/diagnose.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ def run():
has_newnumpy = 0

try:
from numpy.f2py import f2py2e
has_f2py2e = 1
from numpy.f2py import f2pyarg
has_f2pyarg = 1
except ImportError:
print('Failed to import f2py2e:', sys.exc_info()[1])
has_f2py2e = 0
print('Failed to import f2pyarg:', sys.exc_info()[1])
has_f2pyarg = 0

try:
import numpy.distutils
Expand All @@ -60,10 +60,10 @@ def run():
print('error:', msg)
print('------')

if has_f2py2e:
if has_f2pyarg:
try:
print('Found f2py2e version %r in %s' %
(f2py2e.__version__.version, f2py2e.__file__))
print('Found f2pyarg version %r in %s' %
(f2pyarg.__version__.version, f2pyarg.__file__))
except Exception as msg:
print('error:', msg)
print('------')
Expand Down
Loading