-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
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 some series methods for gamma and error functions #26214
base: master
Are you sure you want to change the base?
Conversation
✅ Hi, I am the SymPy bot. 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.13. Click here to see the pull request description that was parsed.
|
So the main problem here is that you haven't written pull request properly |
arg0 = arg.subs(x, 0) | ||
|
||
if arg0 is S.NaN: | ||
arg0 = arg.limit(x, 0, dir='-' if re(cdir).is_negative else '+') |
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.
some thoughts over the code:
arg0 = arg.limit(x, 0, dir='-' if re(cdir).is_negative else '+')
maybe it's better to move dir calculation to temp variable to make it more readable
def _eval_rewrite_as_expint(self, s, x, **kwargs): | ||
from sympy.functions.special.error_functions import expint | ||
if s.is_integer and s.is_nonpositive: | ||
return self | ||
return self.rewrite(uppergamma).rewrite(expint) | ||
|
||
def _eval_as_leading_term(self, x, logx=None, cdir=0): | ||
return self.rewrite(uppergamma)._eval_as_leading_term(x, logx=logx, cdir=cdir) | ||
|
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.
Add tests for this.
def _eval_as_leading_term(self, x, logx=None, cdir=0): | ||
from sympy.functions.special.error_functions import expint | ||
return self.rewrite(expint)._eval_as_leading_term(x, logx=logx, cdir=cdir) | ||
|
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.
Add tests for this too.
Also please fix the code quality. I think you might have to pull the latest changes and rebase on top of it. |
71bafb3
to
7294cbe
Compare
References to other Issues or PRs
Brief description of what is fixed or changed
While implementing the leading term for expint(nu, z) function, we don't have to take care of cases where nu < 1, and as the already implemented _eval_nseries method shows we essentially only need to focus on cases where nu >=1.
Because expint(nu, z) when nu < 1 will be rewritten in the forms of exponentials.
Other comments