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

Use S.Zero for refine. #17700

Merged
merged 1 commit into from
Oct 5, 2019
Merged

Conversation

sylee957
Copy link
Member

@sylee957 sylee957 commented Oct 5, 2019

References to other Issues or PRs

Brief description of what is fixed or changed

I had found some other mistakes for refining re and im because of the type issues, while reviewing #17696
refine does not sanitizes the output types, so it can be a gotcha that some authors can make.

Other comments

Release Notes

  • assumptions
    • Fixed refine(re(x), Q.imaginary(x)) giving python zero instead of sympy zero.
    • Fixed refine(im(x), Q.real(x)) giving python zero instead of sympy zero.

@sympy-bot
Copy link

sympy-bot commented Oct 5, 2019

Hi, I am the SymPy bot (v149). 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:

  • assumptions
    • Fixed refine(re(x), Q.imaginary(x)) giving python zero instead of sympy zero. (#17700 by @sylee957)

    • Fixed refine(im(x), Q.real(x)) giving python zero instead of sympy zero. (#17700 by @sylee957)

This will be added to https://github.com/sympy/sympy/wiki/Release-Notes-for-1.5.

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://github.com/blog/1506-closing-issues-via-pull-requests . Please also
write a comment on that issue linking back to this pull request once it is
open. -->


#### Brief description of what is fixed or changed

I had found some other mistakes for refining `re` and `im` because of the type issues, while reviewing #17696 
`refine` does not sanitizes the output types, so it can be a gotcha that some authors can make.

#### 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 -->
- assumptions
  - Fixed `refine(re(x), Q.imaginary(x))` giving python zero instead of sympy zero.
  - Fixed `refine(im(x), Q.real(x))` giving python zero instead of sympy zero.
<!-- END RELEASE NOTES -->

Update

The release notes on the wiki have been updated.

@codecov
Copy link

codecov bot commented Oct 5, 2019

Codecov Report

Merging #17700 into master will increase coverage by 0.024%.
The diff coverage is 100%.

@@              Coverage Diff              @@
##            master    #17700       +/-   ##
=============================================
+ Coverage   74.679%   74.703%   +0.024%     
=============================================
  Files          634       634               
  Lines       165737    165737               
  Branches     38979     38979               
=============================================
+ Hits        123771    123811       +40     
+ Misses       36484     36437       -47     
- Partials      5482      5489        +7

@oscarbenjamin
Copy link
Collaborator

Looks good

@oscarbenjamin oscarbenjamin merged commit e2a7640 into sympy:master Oct 5, 2019
@sylee957 sylee957 deleted the fix_refine_type branch December 10, 2019 13:59
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.

3 participants