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
solveset with piecewise: issue 19718 #19986
Conversation
✅ Hi, I am the SymPy bot (v160). 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.7. 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 #19986 +/- ##
=============================================
+ Coverage 75.825% 75.882% +0.057%
=============================================
Files 669 669
Lines 173475 173566 +91
Branches 40911 40970 +59
=============================================
+ Hits 131539 131707 +168
+ Misses 36210 36130 -80
- Partials 5726 5729 +3 |
from sympy.logic.boolalg import BooleanTrue | ||
|
||
if isinstance(f, BooleanTrue): | ||
return domain |
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 line isn't covered by the tests according to this report. Can you please add some tests covering this line?
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 something like this?
f = BooleanTrue()
assert solveset(f, x, domain=Interval(-3, 10)) == Interval(-3, 10)
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. This should work.
@smichr Is this good to go? |
Looks good. Thanks! |
References to other Issues or PRs
Fixes #19718
Brief description of what is fixed or changed
Solveset
withinequality
andPiecewise
does not work properly.Indeed it is
_solveset
which returns a wrong result when an argument is aBooleanTrue
.Now, when the argument is a
BooleanTrue
, it returns the domain.A test is added.
Other comments
Release Notes