-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Making the module holonomic usable #11330
Conversation
@@ -278,6 +278,10 @@ def unify(K0, K1, symbols=None): | |||
else: | |||
cls = K1.__class__ | |||
|
|||
from sympy.polys.domains.old_polynomialring import GlobalPolynomialRing |
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 wonder if for speed reasons, you should rather be importing this at the top of the module? I think importing each time can be slow.
I think that this looks great. Any objections @jksuom ? |
assert p == sqrt(x) | ||
p = expr_to_holonomic(sqrt(1 + x**2)).to_expr() | ||
assert p == sqrt(1+x**2) | ||
p = expr_to_holonomic((2*x**2 + 1)**(2/3)).to_expr() |
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 think you should use S(2)/3
here, otherwise you get a floating point number. Floating point numbers can be handled differently, either now or in the future, so the test could fail, but S(2)/3
should always work and be robust.
I agree that floating point numbers should be avoided in the tests unless they are the very subject of the test.. I think this is ready to be merged after that is fixed. |
Importing
Seems like |
That seems a good solution (if no other circular imports appear). |
But importing |
I also think that must be done so. This is not the only case where importing in the class seems to be necessary. |
I think this is ready. Merging. |
RR
domain. Fixes HolonomicFunction converts floats to rationals #11325 .