-
-
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
Implemented _eval_nseries() for Hyper #18630
Conversation
In reference to Issue sympy#18193 the function was implemented. Example of the working code is as follows: In [1]: from sympy import hyper In [2]: from sympy.abc import x, y In [3]: hyper((1, 2),(1, 2), x)._eval_nseries(x, 7, y) Out[3]: 1 + x + x**2/2 + x**3/6 + x**4/24 + x**5/120 + x**6/720 + O(x**7) In [4]: hyper((1, 2),(3, 4, 5), x)._eval_nseries(x, 7, y) Out[4]: 1 + x/30 + x**2/1200 + x**3/63000 + x**4/4233600 + x**5/355622400 + x**6/36578304000 + O(x**7)
✅ Hi, I am the SymPy bot (v151). 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. |
This will need tests |
Actually the following test is still failing. I committed it anyway as the code is working and I couldn't figure out what was going wrong. |
There a a couple of things that should be changed in the code. In the failing issue, the argument of the function is |
sympy/functions/special/hyper.py
Outdated
bq = self.args[1] | ||
|
||
if x0 != 0: | ||
return super()._eval_nseries(x, n, logx) |
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.
return super()._eval_nseries(x, n, logx) | |
return super()._eval_nseries(self, x, n, logx) |
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'm not sure of this, though. The docs say that if the second argument of super
is omitted, then the method will be unbound but I don't know what will happen if both arguments are omitted. However, there is an example that seems to indicate that the returned method will be bound to self
. Perhaps that should be tested.
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.
Tests seem to show that the method will be bound. So better leave this unchanged.
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 what you are saying is the way it was done in python 2 and in python 3 both the arguments can be left omitted.
Actually, |
Co-Authored-By: Kalevi Suominen <jksuom@gmail.com>
Co-Authored-By: Kalevi Suominen <jksuom@gmail.com>
Co-Authored-By: Kalevi Suominen <jksuom@gmail.com>
After removing
is the test failing due to the difference in second output. As what I understood was that maximum power of |
Simplified expression in test_limits() to make it work with new implementation of _eval_nseries(). Added new tests for _eval_nseries(). And renamed some variables to make readabilty of the code better
Codecov Report
@@ Coverage Diff @@
## master #18630 +/- ##
=============================================
- Coverage 75.322% 67.268% -8.054%
=============================================
Files 640 644 +4
Lines 167174 167831 +657
Branches 39426 39565 +139
=============================================
- Hits 125919 112897 -13022
- Misses 35721 49459 +13738
+ Partials 5534 5475 -59 |
Thanks, this is ready to be merged. |
References to other Issues or PRs
Fixes #18193
Brief description of what is fixed or changed
In reference to Issue #18193 the function was implemented. Example of
the working code is as follows:
In [1]: from sympy import hyper
In [2]: from sympy.abc import x, y
In [3]: hyper((1, 2),(1, 2), x)._eval_nseries(x, 7, y)
Out[3]: 1 + x + x2/2 + x3/6 + x4/24 + x5/120 + x6/720 + O(x7)
In [4]: hyper((1, 2),(3, 4, 5), x)._eval_nseries(x, 7, y)
Out[4]: 1 + x/30 + x2/1200 + x3/63000 + x4/4233600 + x5/355622400 + x6/36578304000 + O(x7)
Other comments
Release Notes