Skip to content

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

Merged
seberg merged 3 commits intonumpy:masterfrom
mattip:issue-14625
Dec 9, 2019
Merged

BUG: add endfunction, endsubroutine to valid fortran end words#15035
seberg merged 3 commits intonumpy:masterfrom
mattip:issue-14625

Conversation

@mattip
Copy link
Copy Markdown
Member

@mattip mattip commented Dec 3, 2019

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

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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

heh, fixing

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Member

seberg commented Dec 3, 2019

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

@melissawm
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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