-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
UnboundLocalError in nonlinsolve #22413
Comments
@oscargus , (x,0) doesn't satisfy the second equation. |
OK! Then my simple fix didn't work... (I was not sure how to interpret the results...) |
The problem is that sympy/sympy/solvers/solveset.py Lines 363 to 378 in 700a4a1
Just adding a check for sympy/sympy/solvers/solveset.py Lines 326 to 327 in 700a4a1
is what I tried and it returns the incorrect result. So something more clever should be returned by an additional if-statement at the end of the first piece of code. |
I'm tempted to believe that the correct way to get away with the error is to change 326 to:
and that the incorrect result comes from elsewhere (I seem to recall that One should maybe add a corresponding fast exit for |
@oscargus , if |
It will since it returns |
I created a PR that avoids the error, but returns the incorrect solution. So this remains to be fixed in the issue. (I am quite sure that I have not introduced the incorrect result by fixing the error.) |
raises
UnboundLocalError: local variable 'exp_invs' referenced before assignment
.The text was updated successfully, but these errors were encountered: