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: Make f2py respect kind specifications for real parameters #8299

Merged
merged 1 commit into from
Nov 27, 2016

Conversation

zerothi
Copy link
Contributor

@zerothi zerothi commented Nov 23, 2016

Fortran sources with parameters having kind-specifiers
where not correctly intercepted in the crackfortran.py
source. I.e.

subroutine foo()
real(8), parameter :: Pi = 3.141592635_8
end subroutine

The reason was a restrictive check for only integer specifiers
which did not split real's into the correct number.

Furthermore, several tests has been added which tests the different
kind specifiers and their use in codes, also all of them together.

@charris charris changed the title bug: fixed kind specifications for parameters BUG: Make f2py respect kind specifications for real parameters Nov 23, 2016
@charris charris added this to the 1.12.0 release milestone Nov 23, 2016
@charris
Copy link
Member

charris commented Nov 23, 2016

LGTM modulo some small nits.

@zerothi
Copy link
Contributor Author

zerothi commented Nov 23, 2016

I add the comment here again because the referenced section is "outdated".

I am sorry that this commit is now much more complex... Could you please review the changes made regarding the complex case.

I realize that it still does not correctly evaluate the complex numbers. But providing a complete parser for the complex numbers is a bit difficult (and besides, all this fixes are warnings).

@charris
Copy link
Member

charris commented Nov 23, 2016

How about you just make this about the real case and deal with the complex case in another PR? I'm happy to put the simple case in 1.12.0, but more complicated things might need to wait. I'm curious about the warnings, are you saying that this isn't needed except to avoid warnings?

@zerothi
Copy link
Contributor Author

zerothi commented Nov 24, 2016

Ok, I will then probably not make the PR for the complex case, my current fix only partly solves the problem. I will comment in this PR what needs to be done.

As for the warning, without this PR the compilation of the fortran code will produce this:

get_parameters: got "unexpected EOF while parsing (<string>, line 1)" on '0.529177_sp'

while with the PR the above message is not present.

@charris
Copy link
Member

charris commented Nov 26, 2016

Could you squash the commits into one? Use git rebase -i HEAD~4 and follow directions. The bug part of the first commit message can also be capitalized as part of the process.

@zerothi
Copy link
Contributor Author

zerothi commented Nov 26, 2016

Ok, done! :)

Fortran sources with parameters having kind-specifiers
where not correctly intercepted in the crackfortran.py
source.
The reason was a restrictive check for only integer specifiers
which did not split real's into the correct number.

Furthermore, several tests has been added which tests the different
kind specifiers and their use in codes, also all of them together.

Signed-off-by: Nick Papior <nickpapior@gmail.com>
@zerothi
Copy link
Contributor Author

zerothi commented Nov 27, 2016

@charris done. Thanks.

@charris
Copy link
Member

charris commented Nov 27, 2016

Looks good, thanks @zerothi .

@charris charris merged commit a4dca24 into numpy:master Nov 27, 2016
@charris charris removed this from the 1.12.0 release milestone Nov 27, 2016
@zerothi zerothi deleted the f2py-parameter branch December 15, 2017 08:52
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.

None yet

3 participants