-
-
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
Fixed overriding of Real and complex Fields #18312
Conversation
✅ Hi, I am the SymPy bot (v149). 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.6. 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. |
sympy/polys/domains/mpelements.py
Outdated
@@ -45,7 +45,7 @@ def parent(self): | |||
@public | |||
class MPContext(PythonMPContext): | |||
|
|||
def __init__(ctx, prec=53, dps=None, tol=None): | |||
def __init__(ctx, field, prec=53, dps=None, tol=None): |
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.
I would use a flag with default value like real=False
. It should also come after the existing parameters so that calls with positional parameters would not be disturbed.
sympy/polys/domains/mpelements.py
Outdated
ctx.mpf.context = ctx | ||
ctx.mpc.context = ctx | ||
|
||
if field == 'RR': |
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.
It would be more efficient to have a flag like real
. Then this would be if real:
.
6a1a916
to
760b6ab
Compare
There was a flake8 error, not related to this PR, that was fixed only after this was pushed. I have restarted the build. |
This looks good. Can you add a test to show that now |
Thanks, this is ready to go. |
Codecov Report
@@ Coverage Diff @@
## master #18312 +/- ##
===========================================
+ Coverage 74.99% 75.011% +0.02%
===========================================
Files 649 649
Lines 167331 167332 +1
Branches 39412 39413 +1
===========================================
+ Hits 125483 125518 +35
+ Misses 36307 36280 -27
+ Partials 5541 5534 -7 |
References to other Issues or PRs
Fixes #18278
Brief description of what is fixed or changed
Overriding of context created for ComplexField is fixed.
Other comments
Release Notes