-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
BUG: integrate: Make arrays passed to odeint user functions read-only. #20803
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
The failed Windows job is not related to this PR. It looks like some sort of CI infrastructure issue:
|
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 Warren. This change makes sense in an ideal world. I suspect however that this is a breaking change when users supply a function written in Cython (xref gh-20196).
To get around that, it may be needed to call the function once with a read-only array, catch ValueError/TypeError, and avoid using read-only arrays from then on if an error got caught.
@rgommers, do you have an example of how this could cause a problem? Clearing the WRITEABLE bit dynamically has nothing to do with |
You'd think that yes, based on how things should work - but tell that to Cython. The example in gh-17172 does what you say here, and it was failing for a very basic |
Heh, I even commented in gh-17172 (a mind like a steel sieve). OK, I'm not going to pursue this further. If |
Agreed, and even then it's a stretch perhaps. At a minimum we first need to fix all our own Cython code to work with read-only arrays, and properly test that. |
Closes gh-16170.