-
-
Notifications
You must be signed in to change notification settings - Fork 10.9k
BUG: f2py generated signature file and automatic arrays #21892
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 detailed issue and for tracking down a potential source @benbovy! The usage is valid, expressions of EDIT: Details on automatic shape arrays, since |
FWIW with master
Which also compiles and works. Closing as fixed in |
👍 Great thanks! |
@HaoZeke Is this is fixed in 1.23 also? |
Unfortunately not, in
Which compiles but will error out on usage.
|
Hmm. There have been major changes in f2py since 1.23.x. Is there a simple fix that could be backported? I suppose we could just copy the whole f2py directory back, but I'd be uncomfortable doing that. |
Here is a list of the 21 changed files:
|
* Rebuild for python312 * MNT: Re-rendered with conda-build 3.26.1, conda-smithy 3.26.2, and conda-forge-pinning 2023.09.26.15.03.47 * numpy version constraints See numpy/numpy#21892 * try numpy >=1.24 for build only * try different numpy pinning * fix numpy pinning? * bump version v2.8.4 --------- Co-authored-by: Benoit Bovy <benbovy@gmail.com>
Describe the issue:
Let's consider the following subroutine in a
test.f90
file that declares an automatic array from two variables(*):It used to work with numpy 1.22.0 or earlier, despite the
Warning: cross-dependence between variables "ny" and "nx"
and the weird shape checks as shown in the generatedtest.pyf
signature file below:However, with numpy 1.22.1 or later, it generates a
test.pyf
with "swapped" nx / ny:Which causes the following recursion error when trying to generate the Python extension from the signature file:
The difference between the two generated signature files seems to be a result of #20721.
(*) Do you think the issue here could be considered as a regression? Or is the example here wrong and we should not declare dimensions of automatic arrays from two or more variables? Not sure about this as I'm not a Fortran expert and haven't found much info about this practice, although I'd be surprised that compilers let us do it if it wasn't valid.
Reproduce the code example:
# see f90 / pyf source above
Error message:
No response
NumPy/Python version information:
Numpy 1.22.0 / 1.22.1
Python 3.9
The text was updated successfully, but these errors were encountered: