-
-
Notifications
You must be signed in to change notification settings - Fork 10.8k
BUG,ENH: Fix negative bounds for F2PY #21256
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
Conversation
Does this work with SciPy? |
Yup, in so far as there are no examples of the original issue showing up in SciPy and the change in behavior is only triggered for the case when:
I also ran |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, @HaoZeke for this!
I have a suggestion for detecting the cyclic dependence using coeffs_and_deps
data only that targets the original issue more precisly.
Co-authored-by: Pearu Peterson <pearu.peterson@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a few minor nits but otherwise looks good!
Co-authored-by: Pearu Peterson <pearu.peterson@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Let's put this in - thanks @HaoZeke ! |
Co-authored-by: Pearu Peterson <pearu.peterson@gmail.com>
Co-authored-by: Pearu Peterson <pearu.peterson@gmail.com>
Closes #20853.
Some alternatives were suggested in the issue, namely disabling all checks, which is still an option but seems sub-optimal.
However, there are some implementation notes which are important.
This PR changes the behaviour of the python caller, which is now responsible for being the right size. That is:
After compiling
f2py -m blah blah.f90
, this can be called with:Essentially, the caller is now responsible in this scenario for ensuring that the size of the array passed in is correct, and this means for the most part that the slice should be calculated as above.