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
Updated assumptions: Now complex and !finite infers infinite. #16592
Conversation
✅ Hi, I am the SymPy bot (v147). I'm here to help you write a release notes entry. Please read the guide on how to write release notes. Your release notes are in good order. Here is what the release notes will look like:
This will be added to https://github.com/sympy/sympy/wiki/Release-Notes-for-1.5. Note: This comment will be updated with the latest check if you edit the pull request. You need to reload the page to see it. Click here to see the pull request description that was parsed.
Update The release notes on the wiki have been updated. |
Codecov Report
@@ Coverage Diff @@
## master #16592 +/- ##
=============================================
+ Coverage 73.805% 73.833% +0.027%
=============================================
Files 619 619
Lines 159230 159230
Branches 37370 37370
=============================================
+ Hits 117521 117565 +44
+ Misses 36273 36236 -37
+ Partials 5436 5429 -7 |
Please add a test. |
I'm not that well versed with the assumption system, will this also mean that the same thing hold for e.g. (Wouldn't it be enough to add an assumption as |
HI @oscargus we can't take |
OK! Yeah, now I noted that it is only in one direction, so infinite -> !finite, not the other way around. I'm just thinking that maybe one should focus on the practical effect in the release note. Now, if you specify any property of the number (complex, imaginary, real, rational, integer) and either finite or infinite, it will inherit the other finite/infinite property. This is clearly not how it should be formulated though... But more the practical consequence than the code change. This also means that specifying e.g. real means that it cannot take on NaN by definition and that is really the only difference between that and not specifying anything. It leads to the question: what does this really say about
|
Now I see, |
I guess I originally wanted to add We should decide once and for all however exactly which predicates should contain infinity. |
@@ -1062,3 +1062,10 @@ def test_issue_16313(): | |||
assert (l*x).is_real is False | |||
assert (l*x*x).is_real is None # since x*x can be a real number | |||
assert (-x).is_positive is False | |||
|
|||
def test_issue_16579(): |
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.
Maybe add a comment here that complex may not imply infinite in the future.
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.
Okay, I would add comment.
@jksuom is it good to be merged? |
I would remove this explanation from the release notes. Maybe it, or part of it, could go in the comments above. Otherwise I think this is good to be merged. |
Thanks. |
References to other Issues or PRs
Fixes #16579
Brief description of what is fixed or changed
A complex value can either be
finite
orinfinite
. Therefore,complex and not finite
should mean the value isinfinite
. Currently, SymPy doesn't account for this.With this PR,
Other comments
Release Notes
complex -> finite | infinite
in_assume_rules
in assumptions.py.