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

Range can be accepted in Sum #16810

Merged
merged 12 commits into from
May 12, 2019
Merged

Range can be accepted in Sum #16810

merged 12 commits into from
May 12, 2019

Conversation

czgdp1807
Copy link
Member

References to other Issues or PRs

Fixes #16806

Brief description of what is fixed or changed

Read the discussion at the above Issue and see the diff.

Other comments

N/A

Release Notes

  • concrete
    • Range can be passed as limit to Sum

@sympy-bot
Copy link

sympy-bot commented May 11, 2019

Hi, I am the SymPy bot (v147). 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.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. -->
Fixes https://github.com/sympy/sympy/issues/16806

#### Brief description of what is fixed or changed
Read the discussion at the above Issue and see the diff.

#### Other comments
N/A

#### 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 -->
* concrete
  * `Range` can be passed as limit to `Sum`
<!-- END RELEASE NOTES -->

Update

The release notes on the wiki have been updated.

@czgdp1807
Copy link
Member Author

@smichr I have tried to fix it, can you please take a look and tell me whether it is merge-able.

@codecov
Copy link

codecov bot commented May 11, 2019

Codecov Report

Merging #16810 into master will increase coverage by <.001%.
The diff coverage is 90%.

@@              Coverage Diff              @@
##            master    #16810       +/-   ##
=============================================
+ Coverage   73.844%   73.844%   +<.001%     
=============================================
  Files          619       619               
  Lines       159617    159635       +18     
  Branches     37463     37468        +5     
=============================================
+ Hits        117868    117882       +14     
  Misses       36289     36289               
- Partials      5460      5464        +4

@smichr
Copy link
Member

smichr commented May 11, 2019

Looks good. One mod that can be made in future prs is to remove the sympify of the Tuple V flatten result since all Tuple args are Basic.

@smichr
Copy link
Member

smichr commented May 11, 2019

Let's make this canonical, however, by using lo=inf hi=sup and d=abs of step. Range(9,0,-2) should give same symbolic sum of i before doit as that of Range(1,10,2).

@czgdp1807
Copy link
Member Author

Thank you @smichr for making the commits. :-)

@smichr
Copy link
Member

smichr commented May 12, 2019

Hmm. That code is a little contorted. It should now work if you pass an Idx with Range. I'm not sure what should happen if lo and hi are not given with Idx, however, so am raising an error.

@czgdp1807
Copy link
Member Author

Sure, we can add a TODO task for that case in the code.

@smichr
Copy link
Member

smichr commented May 12, 2019

One more time...

@smichr
Copy link
Member

smichr commented May 12, 2019

Do you have any popcorn? ;-)

@czgdp1807
Copy link
Member Author

Up for a movie then? 😉

@czgdp1807
Copy link
Member Author

@smichr Tests passed. Is there anything else to change?

@smichr smichr merged commit 0d6198b into sympy:master May 12, 2019
@smichr
Copy link
Member

smichr commented May 12, 2019

No, LOL!

@czgdp1807 czgdp1807 deleted the addon_sum_api branch May 12, 2019 14:00
@czgdp1807 czgdp1807 added the GSoC label Jun 23, 2019
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.

summation doesn't accepts Range as limits
4 participants