-
-
Notifications
You must be signed in to change notification settings - Fork 11k
BUG: f2py does not wrap modules that are used by other modules #26156
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
Comments
Thanks for the report and reproducer @ftherrien I can't seem to reproduce this on the latest >>> import test
>>> [x for x in dir(test) if '__' not in x]
['_test_error', 'test', 'utils']
>>> [x for x in dir(test.test) if '__' not in x]
['func']
>>> [x for x in dir(test.utils) if '__' not in x]
['ufunc'] From: ❯ python -c "import numpy as np; print(np.__version__)"
2.1.0.dev0+git20240409.2d2ff25
python3 -m numpy.f2py -c --f90exec=gfortran --fcompiler=gnu95 -m test test.f90 --backend meson I believe this was fixed in #25361 Note that there is a slight misunderstanding in the way the reproducer is run. The Feel free to reopen this if anything isn't clear.. |
@HaoZeke using the latest main does fix it for me. Thanks! For reference for the moment this fix is only available in versions 2+ which are currently pre-released: v2.1.0.dev0 v2.0.0rc1 v2.0.0b1 and can be installed through |
Thanks for the quick verification! It is a bit unfortunate, but there were so many changes to |
Uh oh!
There was an error while loading. Please reload this page.
Describe the issue:
If a module is used by another module it is no longer wrapped and cannot be used in python. This was not the behavior before 1.26.3. In my example below, I want
func
andufunc
to be available in thetest
python module, but they are not. Notice that the compile output below mentionsSkipping utils since it is in 'use'...
I believe that this PR: #25217 is causing the issue. It appears that any module that uses another module is skipped. It was trying to solve the issue described here: #19161, but there are cases like mine were using another module has nothing do with "common blocks".
Reproduce the code example:
test.f90:
Compile:
Running
Python and NumPy Versions:
Numpy 1.26.4
Python 3.10.12
Tested that the behavior is not the same in Numpy 1.26.2
Runtime Environment:
No response
Context for the issue:
This was reported to me here: ftherrien/p2ptrans#34 and makes some of my functions unavailable in python without any error message at compile time.
The text was updated successfully, but these errors were encountered: