-
Notifications
You must be signed in to change notification settings - Fork 68
Fix tests to accomodate scipy 1.16.0 changes #234
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
Seems this test fails here in CI
|
Oh, it seems that there is a tutorials failure too under Python 3.13, where it would be using scipy 1.16.0, in a cell that uses COBYLA()
but at least the unit tests seem to be ok now :) |
I updated the 05_qaoa notebook so that the SamplingVQE cell produces the same output for scipy 1.16.0 as 1.15.3 and does not fail under 1.16.0 like it did - I added an explicit initial point. Hmmm... now it failed under 3.9. I know I tried different values, to both get it to work and get the same result it had before, and I was sure I ran it under 1.15.3 as well.... Yes it does work locally with 1.15.3, I re-checked now, but I am on Python 3.12 and Windows for an env so maybe there is something to that. Will try something different that hopefully works in CI too! I removed the initial_point as I found a seed that works for both (i.e. underlying random initial point it will create). Hopefully this is good here in CI - locally for me with scipy 1.15.,3 and 1.16.0 it is but with the former I am still using Python 3.12 not 3.9. Update seems that it is :) |
Pull Request Test Coverage Report for Build 15929192104Details
💛 - Coveralls |
Summary
Fixes #233
Fixes nightly CI failures that arose when scipy 1.16.0 was released recently
Details and comments
In scipy 1.16.0 the COBYLA implementation was changed
https://docs.scipy.org/doc/scipy/reference/optimize.minimize-cobyla.html
and this seems to have affected a few CI tests here that failed
What I did, in the main, was to adjust tests, say the initial point or some other parameter to have them pass in 1.16 as well as pre that e.g 1.15.3
AssertionError: np.int64(6) != 2
seems to be that setting maxiter=2 no longer resulted in 2 functional evals but 6! Setting it to 8 seemed to have it stop at 8 functional evalstest_cobyla
test in test_optimizers, I will note that under 1.16.0 it seems to take far longer to run. I tried adjust the tol values given and maxiter to get something that would run/pass faster but to no avail.It passed locally for me under 3.12 using either 1.15.3 or 1.16.0 - lets see here in CI. I looked in scipy github but did not see any issues that might be relevant. I guess with an implementation switch only time will tell how this works out for the CI tests here.