Skip to content
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

Open
wants to merge 17 commits into
base: master
Choose a base branch
from

Conversation

Abhishekjsr283204
Copy link
Contributor

@Abhishekjsr283204 Abhishekjsr283204 commented Feb 11, 2024

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

  • series
    • Implemented leading term methods for expint and Si function.
    • Implemented leading term methods for uppergamma and lowergamma function.

@sympy-bot
Copy link

sympy-bot commented Feb 11, 2024

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.
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

<!-- BEGIN RELEASE NOTES -->
* series
  * Implemented leading term methods for expint and Si function.
  * Implemented leading term methods for uppergamma and lowergamma function.
<!-- END RELEASE NOTES -->

@DarkNisa
Copy link
Contributor

So the main problem here is that you haven't written pull request properly
so it doesn't start testing the whole changes, do you need to rewrite it according
the guide that sympy bot attached earlier.

arg0 = arg.subs(x, 0)

if arg0 is S.NaN:
arg0 = arg.limit(x, 0, dir='-' if re(cdir).is_negative else '+')
Copy link
Contributor

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

sympy/functions/special/error_functions.py Show resolved Hide resolved
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)

Copy link
Member

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)

Copy link
Member

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.

@anutosh491
Copy link
Member

Also please fix the code quality. I think you might have to pull the latest changes and rebase on top of it.

author: add Abhishek kumar to .mailmap

ADDED NAME

git commit -m "squash commit"
.mailmap Outdated Show resolved Hide resolved
.mailmap Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants