-
-
Notifications
You must be signed in to change notification settings - Fork 10.8k
BUG: numpy 1.22 incorrectly infers dimensions #21362
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
ISTR another report along these lines. @HaoZeke Thoughts? |
Yup, there have been a couple growing pains (#20721, #20709, #20853) from our new dimension solver #19805, but the fixes have been relatively quick to implement since it makes reasoning about the code much easier than before. Will look into this soon. |
This seems to be a non-starter on
Gives:
So it seems to be fixed on master. Will close in a day or so if there are no updates. For reference, original bug as reported on the
Was instead:
If these were cyclic dependencies (as @ketch mentions), then this was fixed by #21256. |
In our experience the bug is not consistent. The function signature produced by f2py is different on different machines. But using numpy 1.18 always fixes it, and we've found no other way to fix it. |
Could you leave a reproducible example? Or a known machine where the incorrect results are produced? There should be no difference in the wrappers based on the underlying system. @ketch. |
I think we all agree on that! Some characteristics of machines with this problem are mentioned here: clawpack/pyclaw#681 (comment) Let me know what else you need to know. |
For what its worth, I experimented with this simplified version of the
I ran
With numpy 1.22.0 - 1.22.3, the signature of the wrapper generated by f2py is
This is the unexpected result that is reported in this issue. With the main development branch ('1.23.0.dev0+1087.g0eaa40db3'), and with all the older versions that I tested (1.19.0, 1.19.5, 1.20.0-1.20.3, 1.21.0-1.21.6), the signature is
This is on a Linux machine, running Python 3.9.7 (miniconda), with all numpy versions except the main development branch installed with pip. So for this platform and Python 3.9.7, it appears that only the 1.22 release series has the issue. |
Okay, I can also confirm that this bug seems to be fixed in the current development version of numpy. |
Closing as fixed in |
Describe the issue:
Using f2py to wrap certain routines in Clawpack, on some systems we get a different calling signature using numpy 1.22 versus earlier versions of numpy. Some specifics are described here: clawpack/pyclaw#681
Some of the input arrays' dimensions involve two variables, so normally f2py requires that those values be passed in. Using 1.22, sometimes f2py sets up the wrapper so that both of those values are inferred, but their inferred values depend on each other. So even if one passes the values in, the routine does not work correctly.
I've found that rolling back to numpy version 1.18.5 fixes this issue. I haven't tested other versions in between.
I wonder if this is related to #20103 or #20696.
Reproduce the code example:
Error message:
No response
NumPy/Python version information:
1.22.3
The text was updated successfully, but these errors were encountered: