8000 ENH: Add ``__f2py_numpy_version__`` attribute to Fortran modules. by sturlamolden · Pull Request #16594 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

ENH: Add __f2py_numpy_version__ attribute to Fortran modules. #16594

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

Merged
merged 1 commit into from
Jun 18, 2020

Conversation

sturlamolden
Copy link
Contributor

The Fortran module now reports the version of NumPy associated with the f2py used for compilation. Closes gh-16525.

@sturlamolden sturlamolden changed the title add __f2py_numpy_version__ attribute ENH: Add __f2py_numpy_version__ attribute to Fortran modules. Jun 13, 2020
@sturlamolden
Copy link
Contributor Author
sturlamolden commented Jun 13, 2020

The purpose of this PR is to gracefully handle situations like this:

scipy/scipy#9658
#16513
scipy/scipy#12319

If we know the version of NumPy used for compilation (not the imported one) users of f2py (e.g. SciPy) can gracefully turn off workarounds for known f2py bugs, if we know the workaround to otherwise be detrimental. Not having the attribute __f2py_numpy_version__ is also informative because we then know the f2py version to be one that came prior to inclusion of this PR.

@sturlamolden
Copy link
Contributor Author

Ping @pv

Copy link
Member
@pv pv left a comment

Choose a reason for hiding this comment

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

Copy link
Member
@mattip mattip left a comment

Choose a reason for hiding this comment

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

LGTM. @pv any last comments?

@sturlamolden sturlamolden force-pushed the f2py-version-fix2 branch 2 times, most recently from c7a2cf9 to e574f1e Compare June 17, 2020 04:41
@sturlamolden
Copy link
Contributor Author

Finally it is green again 😅

@seberg
Copy link
Member
seberg commented Jun 18, 2020

Seems like everyone was happy with this decision, and the code looks good to me as well. Thanks @sturlamolden.

@seberg seberg merged commit a69ce06 into numpy:master Jun 18, 2020
@charris charris mentioned this pull request Oct 10, 2020
20 tasks
@charris charris changed the title ENH: Add __f2py_numpy_version__ attribute to Fortran modules. ENH: Add __f2py_numpy_version__ attribute to Fortran modules. Oct 20, 2020
charris added a commit to charris/numpy that referenced this pull request Nov 22, 2020
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 does not correctly report the f2py version in the docstrings of compiled extension modules
5 participants
0