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

Added test case for series expansion of polynomial/rational expression #19974

Merged
merged 2 commits into from
Aug 17, 2020

Conversation

abhaydhiman
Copy link
Contributor

References to other Issues or PRs

#12791

Brief description of what is fixed or changed

Added a test case for the series expansion of polynomial/rational expression in test_series.py

Other comments

Release Notes

NO ENTRY

@sympy-bot
Copy link

Hi, I am the SymPy bot (v160). I'm here to help you write a release notes entry. Please read the guide on how to write release notes.

  • No release notes entry will be added for this pull request.

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.

<!-- Your title above should be a short description of what
was changed. Do not include the issue number in the title. -->

#### References to other Issues or PRs
<!-- If this pull request fixes an issue, write "Fixes #NNNN" in that exact
format, e.g. "Fixes #1234" (see
https://tinyurl.com/auto-closing for more information). Also, please
write a comment on that issue linking back to this pull request once it is
open. -->
#12791 

#### Brief description of what is fixed or changed
Added a test case for the series expansion of polynomial/rational expression in test_series.py

#### Other comments


#### Release Notes

<!-- Write the release notes for this release below. See
https://github.com/sympy/sympy/wiki/Writing-Release-Notes for more information
on how to write release notes. The bot will check your release notes
automatically to see if they are formatted correctly. -->

<!-- BEGIN RELEASE NOTES -->
NO ENTRY
<!-- END RELEASE NOTES -->

Comment on lines 300 to 301
beta = symbols('beta', reals=True, positive=True)
theta, varphi = symbols('theta varphi', reals=True)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this can be real=True.

/((0.5*cos(theta) - 1)**2*(0.5*cos(theta) - 1.0))) + 0.25*varphi*\
sin(theta)/(0.5*cos(theta) - 1)**2 + O((beta - 0.5)**2, (beta, 0.5))

assert(expr.series(beta, 0.5, 2) == sol)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this can be simply:
assert expr.series(beta, 0.5, 2) == sol (without round brackets).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I'll make the changes suggested by you.

@sachin-4099
Copy link
Contributor

sachin-4099 commented Aug 17, 2020

Moreover, don't simply add the testcase to the end of the file. Please find issue numbers closer to the issue number this PR resolves and add the testcase to that place.

@codecov
Copy link

codecov bot commented Aug 17, 2020

Codecov Report

Merging #19974 into master will increase coverage by 0.016%.
The diff coverage is n/a.

@@              Coverage Diff              @@
##            master    #19974       +/-   ##
=============================================
+ Coverage   75.814%   75.831%   +0.016%     
=============================================
  Files          669       669               
  Lines       173463    173463               
  Branches     40907     40907               
=============================================
+ Hits        131510    131539       +29     
+ Misses       36230     36202       -28     
+ Partials      5723      5722        -1     

@abhaydhiman
Copy link
Contributor Author

So, can I add that in test_issue_12578 this function?

@sachin-4099
Copy link
Contributor

So, can I add that in test_issue_12578 this function?

No, not inside that. But closer to that.

@abhaydhiman
Copy link
Contributor Author

Just below that function. If I am not wrong.

@sachin-4099
Copy link
Contributor

Just below that function. If I am not wrong.

Yeah should be fine.

@sachin-4099
Copy link
Contributor

Looks good. This can be merged @jksuom.

@sachin-4099 sachin-4099 requested a review from jksuom August 17, 2020 09:24
@abhaydhiman
Copy link
Contributor Author

Thanks! for the help @sachin-4099

@jksuom
Copy link
Member

jksuom commented Aug 17, 2020

Thank you, this looks good.

@jksuom jksuom merged commit 551e44d into sympy:master Aug 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants