10000 BUG: Fix multiple modules in F2PY and COMMON handling by charris · Pull Request #27780 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

BUG: Fix multiple modules in F2PY and COMMON handling #27780

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 2 commits into from
Nov 17, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments. 8000
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
BUG: Handle multi-module files and common better
  • Loading branch information
HaoZeke authored and charris committed Nov 17, 2024
commit 690e663a1d0a526bb4b2b08b3ed9d1ee171c97f2
2 changes: 1 addition & 1 deletion numpy/f2py/auxfuncs.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
'isunsigned_long_long', 'isunsigned_long_longarray', 'isunsigned_short',
'isunsigned_shortarray', 'l_and', 'l_not', 'l_or', 'outmess', 'replace',
'show', 'stripcomma', 'throw_error', 'isattr_value', 'getuseblocks',
'process_f2cmap_dict'
'process_f2cmap_dict', 'containscommon'
]


Expand Down
8 changes: 3 additions & 5 deletions numpy/f2py/f90mod_rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,6 @@ def dadd(line, s=doc):

usenames = getuseblocks(pymod)
for m in findf90modules(pymod):
contains_functions_or_subroutines = any(
item for item in m["body"] if item["block"] in ["function", "subroutine"]
)
sargs, fargs, efargs, modobjs, notvars, onlyvars = [], [], [], [], [
m['name']], []
sargsp = []
Expand All @@ -120,8 +117,9 @@ def dadd(line, s=doc):
outmess(f"\t\t\tSkipping {m['name']} since there are no public vars/func in this module...\n")
continue

if m['name'] in usenames and not contains_functions_or_subroutines:
outmess(f"\t\t\tSkipping {m['name']} since it is in 'use'...\n")
# gh-25186
if m['name'] in usenames and containscommon(m):
outmess(f"\t\t\tSkipping {m['name']} since it is in 'use' and contains a common block...\n")
continue
if onlyvars:
outmess('\t\t Variables: %s\n' % (' '.join(onlyvars)))
Expand Down
Loading
0