-
-
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
Relational: bool(Relational) should raise #2350
Conversation
Conflicts: sympy/core/relational.py
Nice. There are test failures, but once we get them all ironed out, let's get this in. |
SymPy Bot Summary: 🔴 Failed after merging jrioux/relational (b6ea43b) into master (e5dbc80). |
SymPy Bot Summary: ✅ Passed after merging jrioux/relational (abf77e5) into master (c18f063). |
I guess this behavior should be explicitly tested somewhere as well. |
SymPy Bot Summary: ✅ Passed after merging jrioux/relational (4c85b3f) into master (7291221). |
+1. |
There is some stuff in the Greater docstring about chained inequalities that needs to be updated. |
What would you like to see changed? Everything in that docstring still applies, doesn't it? |
I saw at least one part that indicated that relational evaluate to booleans (the numbered list). |
+1 from me. |
This is just waiting on that fix to the docstring. |
SymPy Bot Summary: ✅ Passed after merging jrioux/relational (9138eb7) into master (3a92446). |
Relational: bool(Relational) should raise Continuation of #1646. See issue 2832.
Awesome. Thanks for doing this. Can you update the release notes for the next release? |
I should have reviewed this more closely. Several of the |
@@ -374,7 +374,7 @@ def spde(a, b, c, n, DE): | |||
pow_a = 0 | |||
|
|||
while True: | |||
if n < 0: | |||
if (n < 0) is True: |
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.
Do you mean this change?
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.
Yes. n
should always be an integer here. I've no doubt this same issue is the case in many other places as well. I would say to not use is True
unless the tests specifically demonstrate the symbolic arguments are possible.
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.
That's exactly what I did. I did not automatically change (a > b)
into (a > b) is True
, but I did so when it would fix a failing test, and the logic of the code seemed to work this way.
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.
This also means that lines that were not covered by tests (or only covered by slow tests) could still raise the symbolic
error.
If you do mean the above change, changing it back will get a test failure in |
Ah OK, I stand corrected then. That test can probably be removed. I was trying to be clever and show that it could handle some general case mentioned in Bronstein's book, but it obviously isn't designed to work that way. |
Continuation of #1646. See issue 2832.