sympy/sympy

Subversion checkout URL

You can clone with
or
.

1285: summation() documentation#1108

Merged
merged 1 commit into from
+56 −0

5 participants

issue 1285 ::: documentation for summation has been done .. while examples need to be added still ..

doc/src/tutorial.txt
 @@ -256,6 +256,47 @@ This will make things look better when printed. See the :ref:`printing-tutorial` section below. If you have a unicode font installed, you can pass use_unicode=True for a slightly nicer output. +Summation +=========
 scolobb added a note Mar 7, 2012 I think this section should be demoted to a subsection of the Calculus section, because I can see that the subsection about series expansion is already there. Perhaps, this bit of documention should go right after the description of series expansion (which starts at line 382). The developers have the ultimate word, of course. Owner asmeurer added a note Mar 7, 2012 I agree with this. to join this conversation on GitHub. Already have an account? Sign in to comment
doc/src/tutorial.txt
 @@ -256,6 +256,47 @@ This will make things look better when printed. See the :ref:`printing-tutorial` section below. If you have a unicode font installed, you can pass use_unicode=True for a slightly nicer output. +Summation +========= + + Compute the summation of f with respect to symbols. + + The notation for symbols is similar to the notation used in Integral.
 scolobb added a note Mar 7, 2012 I think this line does not belong to the tutorial, at least not this early. Also, it doesn't help a person who wants to get started, IMHO. to join this conversation on GitHub. Already have an account? Sign in to comment
doc/src/tutorial.txt
 ((7 lines not shown)) + Compute the summation of f with respect to symbols. + + The notation for symbols is similar to the notation used in Integral. + summation(f, (i, a, b)) computes the sum of f with respect to i from a to b, + i.e., + + :: + + b + ____ + \ ` + summation(f, (i, a, b)) = ) f + /___, + i = a + + If it cannot compute the sum, it returns an unevaluated Sum object.
 scolobb added a note Mar 7, 2012 I think this sentence should be reformulated to better fit the style of a tutorial. For example: "If it cannot compute the sum, it prints the corresponding summation formula." to join this conversation on GitHub. Already have an account? Sign in to comment
doc/src/tutorial.txt
 @@ -919,5 +960,6 @@ This tutorial is also available in other languages: .. toctree:: :maxdepth: 1 + tutorial.bg.txt + tutorial.cs.txt
 scolobb added a note Mar 7, 2012 These two lines seem to introduce changes that are unrelated to the enhancement you provide, so they should at least belong to a different commit. to join this conversation on GitHub. Already have an account? Sign in to comment
doc/src/tutorial.txt
 ((6 lines not shown)) tutorial.ru.txt -
 scolobb added a note Mar 7, 2012 You should normally try to not produce such empty line modifications. Usually, such things are fixed in separate, catch-all clean-up commits. Owner asmeurer added a note Mar 7, 2012 It's not that big of a deal :) to join this conversation on GitHub. Already have an account? Sign in to comment
doc/src/tutorial.txt
 ((27 lines not shown)) + >>> from sympy import summation, oo, symbols, log + >>> i, n, m = symbols('i n m', integer=True) + + >>> summation(2*i - 1, (i, 1, n)) + n**2 + >>> summation(1/2**i, (i, 0, oo)) + 2 + >>> summation(1/log(n)**n, (n, 2, oo)) + Sum(log(n)**(-n), (n, 2, oo)) + >>> summation(i, (i, 0, n), (n, 0, m)) + m**3/6 + m**2/2 + m/3 + + >>> from sympy.abc import x + >>> from sympy import factorial + >>> summation(x**n/factorial(n), (n, 0, oo)) + exp(x)
 Owner asmeurer added a note Mar 7, 2012 I think this shouldn't be here. papriwalprateek added a note Mar 8, 2012 but i did as said by scolobb .. papriwalprateek added a note Mar 8, 2012 he said to demote the summation documentation to calculus after sub section(series expansion). scolobb added a note Mar 8, 2012 Aaron, why do you think it shouldn't be here? It's a very nice and simple example, IMHO. Prateek, I believe Aaron doesn't refer to the location of the whole section, but rather to the fact that some of the examples shouldn't be included in the tutorial. papriwalprateek added a note Mar 8, 2012 ok u mean examples such as which include factorial,exp() functions .... may be including these functions in this tutorial is not good ... Owner asmeurer added a note Mar 8, 2012 No, I was referring to a line that seems to be gone now. GitHub left my comment for some reason. You can ignore this comment now. to join this conversation on GitHub. Already have an account? Sign in to comment

SymPy Bot Summary: There were test failures.

@papriwalprateek: Please fix the test failures.

Test results html report: http://reviews.sympy.org/report/agZzeW1weTNyDAsSBFRhc2sYveIODA

Interpreter: /usr/bin/python (2.7.1-final-0)
Architecture: Linux (64-bit)
Cache: yes
Test command: setup.py test
master hash: 5135035
branch hash: 6bbc588

Automatic review by SymPy Bot.

please see to Sympy-bot results ...

Owner

You just need to change the example output to give the pretty printed output, since we initialize the pretty printer at the top of the tutorial.

referenced this pull request
Closed

1285 issue: corrected commit #1110

SymPy Bot Summary: All tests have passed.

Test results html report: http://reviews.sympy.org/report/agZzeW1weTNyDAsSBFRhc2sY3oEPDA

Interpreter: /usr/bin/python (2.7.1-final-0)
Architecture: Linux (64-bit)
Cache: yes
Test command: setup.py test
master hash: 5135035
branch hash: 44b32e85057970b2f8abe656af4701f0168ec54f

Automatic review by SymPy Bot.

all tests passed ...

doc/src/tutorial.txt
 @@ -414,6 +414,58 @@ Another simple example:: y 2 3 4 5 y y y y + + +.. index:: summation + +Summation +--------- + +Compute the summation of f with respect to symbols. + + summation(f, (i, a, b)) computes the sum of f with respect to i from a to b, + i.e., + + :: +
 Collaborator smichr added a note Mar 9, 2012 you might want to copy and paste the output from `pprint(Sum(f,(i,a,b)))` to make sure it looks right; what you have below is not right. Notice that the tic on the upper bar is not at the end of the bar. to join this conversation on GitHub. Already have an account? Sign in to comment
doc/src/tutorial.txt
 ((11 lines not shown)) +Compute the summation of f with respect to symbols. + + summation(f, (i, a, b)) computes the sum of f with respect to i from a to b, + i.e., + + :: + + b + ____ + \ ` + summation(f, (i, a, b)) = ) f + /___, + i = a + + If it cannot compute the sum, it prints the corresponding summation formula. + Repeated sums can be computed by introducing additional symbols tuples::
 Collaborator smichr added a note Mar 9, 2012 symbols tuples -> limits papriwalprateek added a note Mar 10, 2012 means? scolobb added a note Mar 10, 2012 I think Chris means that you should say "by introducing additional limits" instead of "by introducing additional symbols tuples". papriwalprateek added a note Mar 10, 2012 ok ... right to join this conversation on GitHub. Already have an account? Sign in to comment
commented on the diff
doc/src/tutorial.txt
 @@ -414,6 +414,58 @@ Another simple example:: y 2 3 4 5 y y y y + + +.. index:: summation + +Summation +---------
 Collaborator smichr added a note Mar 9, 2012 check other examples -- is this suppose to be single or double underlined? papriwalprateek added a note Mar 10, 2012 i think it should be single underlined only as with the other examples given in tutorial.txt .. scolobb added a note Mar 10, 2012 Double underline seems to be for sections, while single underline -- for subsections. This bit about summation is now a subsection of the Calculus section (as far as I remember), so it should be single underlined. to join this conversation on GitHub. Already have an account? Sign in to comment
doc/src/tutorial.txt
 @@ -414,6 +414,58 @@ Another simple example:: y 2 3 4 5 y y y y + + +.. index:: summation + +Summation +--------- + +Compute the summation of f with respect to symbols.
 Collaborator smichr added a note Mar 9, 2012 symbols -> the given summation variable over the given limits (or words to that effect) to join this conversation on GitHub. Already have an account? Sign in to comment
Collaborator

Passes python 2.7 64-bit tests and doctests. Looks good to me.

Collaborator

Following the convention of the preceding documentation, text should be at the left margin and examples prefixed with `>>>` should be indented 4 spaces. (Right now all the text is indented at the same level as the interactive input/output.)

 papriwalprateek `1285 issue : more corrections done` `006f1d9`
Owner

SymPy Bot Summary: There were test failures.

@papriwalprateek: Please fix the test failures.

Test results html report: http://reviews.sympy.org/report/agZzeW1weTNyDAsSBFRhc2sYnewQDA

Interpreter: /usr/local/bin/python2.5 (2.5.0-final-0)
Architecture: Darwin (32-bit)
Cache: yes
Test command: setup.py test
master hash: 92c3c40
branch hash: 006f1d9

Automatic review by SymPy Bot.

Owner

SymPy Bot Summary: All tests have passed.

Test results html report: http://reviews.sympy.org/report/agZzeW1weTNyDAsSBFRhc2sYs-QQDA

Interpreter: /Library/Frameworks/Python.framework/Versions/3.2/bin/python3 (3.2.2-final-0)
Architecture: Darwin (64-bit)
Cache: yes
Test command: setup.py test
master hash: 92c3c40
branch hash: 006f1d9

Automatic review by SymPy Bot.

do i now need to make any furthur changes ..

Collaborator

@asmeurer Please look at the failed tests. I still think there is a problem with your testing machine.

i guess the second sympy bot tests were the correct one ..

Collaborator

Passes doctests and tests on 32- and 64-bit python 2.7.0, +1

i think it can be merged ...

merged commit `fae2274` into sympy:master
Collaborator

Thanks, this is in.