Skip to content
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

BUG: add endfunction, endsubroutine to valid fortran end words #15035

Merged
merged 3 commits into from
Dec 9, 2019

Conversation

mattip
Copy link
Member

@mattip mattip commented Dec 3, 2019

Test, fix for missing end words in fortran subroutines and functions.
Fixes gh-14625

@@ -542,7 +542,7 @@
'ARRSIZE'] = '#define ARRSIZE(dims,rank) (_PyArray_multiply_list(dims,rank))'
cppmacros['OLDPYNUM'] = """\
#ifdef OLDPYNUM
#error You need to install NumPy version 13 or higher. See https://scipy.org/install.html
#error You need to install NumPy version 0.13 or higher. See https://scipy.org/install.html
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was left over from a comment on gh-14231


def test_module(self):
k = np.array([1, 2, 3], dtype = np.float)
w = np.array([1, 2, 3], dtype = np.float)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's not make #6103 worse ;)

Suggested change
w = np.array([1, 2, 3], dtype = np.float)
w = np.array([1, 2, 3], dtype=float)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

heh, fixing

k = np.array([1, 2, 3], dtype = np.float)
w = np.array([1, 2, 3], dtype = np.float)
k = np.array([1, 2, 3], dtype = np.float64)
w = np.array([1, 2, 3], dtype = np.float64)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PEP8 says no spaces around = here, as in my suggested change

Copy link
Member

@eric-wieser eric-wieser left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not fortran expert so can't sign off on the validity of the fortran syntax we're parsing, but the changes to the python look fine.

@seberg
Copy link
Member

seberg commented Dec 3, 2019

@melissawm maybe you can give a hand at reviewing this?

@melissawm
Copy link
Member

Sure, just give me a few days since I'm a bit busy at work right now, if that's ok!

@mattip mattip requested a review from melissawm December 9, 2019 15:20
Copy link
Member

@melissawm melissawm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

@seberg seberg merged commit c010145 into numpy:master Dec 9, 2019
@seberg
Copy link
Member

seberg commented Dec 9, 2019

Thanks everyone for the review!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: f2py endfunction and endsubroutine parsing
4 participants