BUG: f2py: better handle filtering of public/private subroutines#27049
BUG: f2py: better handle filtering of public/private subroutines#27049HaoZeke merged 2 commits intonumpy:mainfrom
Conversation
HaoZeke
left a comment
There was a problem hiding this comment.
I have two minor comments, and beyond that I think it would be nice to have a separate test for the no public subroutine or variable case, otherwise, this looks great.
numpy/f2py/f90mod_rules.py
Outdated
| if len(var) == 1 and 'attrspec' in var and var['attrspec'][0] in ('public', 'private'): | ||
| is_not_var = True |
There was a problem hiding this comment.
I wonder if this entire check could be extracted into a functional form in auxfuncs.py instead. Similar to the existing:
def isprivate(var):
return 'attrspec' in var and 'private' in var['attrspec']This is a bit nitpicky and mostly for consistency with the rest of the F2PY code, the form here also works.
There was a problem hiding this comment.
Also, what about the protected access property? (not sure how / if this is handled in F2PY now actually).
There was a problem hiding this comment.
As far as I can see, the protected property is correctly handled, i.e., using it produced no errors for me. However, I'm not familiar enough with it to tell if I missed anything here.
|
It this the last PR that needs to be merged for a 2.1.0 release candidate? (as of the 2.1.0 milestone) |
Not for the rc, and maybe not for the final either if it isn't resolved. |
Don't mistake public/private declarations of F90 subroutines for variables when the corresponding subroutines are filtered by use of only:. Also, handle modules with no public variables or subroutines, caused by the filtering. Closes numpygh-26920.
|
Sorry for the late reply, summer vacation got in the way. I modified the pull request to include:
Please let me know if I should change anything else. |
|
LGTM, in it goes, thanks for working on this @m-weigand ! |
This should fix gh-26920 and add a corresponding test case.
I am unsure about some formalities and would appreciate some feedback: