Skip to content
This repository
Browse code

Strip trailing whitespaces all over SymPy

except:

- thirdparty packages
- pprint tests, where they are needed
  • Loading branch information...
commit 54183704523f5f8b0276d4bd0f04bf57468d274d 1 parent adc0d84
Kirill Smelkov authored

Showing 101 changed files with 519 additions and 527 deletions. Show diff stats Hide diff stats

  1. +2 2 README
  2. +1 1  TODO
  3. +1 1  bin/generate_test_list.py
  4. +4 4 bin/test_isolated
  5. +1 1  bin/test_pure
  6. +1 1  bin/test_pure_plotting
  7. +2 2 data/TeXmacs/bin/tm_sympy
  8. +1 1  doc/Makefile
  9. +1 1  doc/api/index.txt
  10. +1 1  doc/generate_reference.py
  11. +2 2 doc/man/isympy.xml
  12. +1 1  doc/src/aboutus.txt
  13. +33 33 doc/src/guide.txt
  14. +1 1  doc/src/index.txt
  15. +1 1  doc/src/modules.txt
  16. +3 3 doc/src/outreach.txt
  17. +14 14 doc/src/sympy-patches-tutorial.txt
  18. +35 35 doc/src/tutorial.txt
  19. +3 3 examples/all
  20. +1 1  examples/fem_test.py
  21. +2 2 examples/print_pretty.py
  22. +2 2 examples/print_pygame.py
  23. +8 8 examples/relativity.py
  24. +3 3 examples/t.py
  25. +2 2 examples/tensors.py
  26. +5 5 sympy/core/add.py
  27. +6 6 sympy/core/assumptions.py
  28. +6 6 sympy/core/basic.py
  29. +16 16 sympy/core/decimal_math.py
  30. +12 12 sympy/core/function.py
  31. +1 1  sympy/core/interval.py
  32. +2 2 sympy/core/methods.py
  33. +3 3 sympy/core/operations.py
  34. +2 2 sympy/core/sympify.py
  35. +2 2 sympy/core/tests/test_arit.py
  36. +2 2 sympy/core/tests/test_eval_power.py
  37. +4 4 sympy/core/tests/test_functions.py
  38. +3 3 sympy/core/tests/test_str.py
  39. +2 2 sympy/functions/elementary/complexes.py
  40. +4 4 sympy/functions/elementary/exponential.py
  41. +3 3 sympy/functions/elementary/tests/test_complexes.py
  42. +4 4 sympy/functions/elementary/trigonometric.py
  43. +2 2 sympy/functions/special/polynomials.py
  44. +1 1  sympy/functions/special/tests/test_polynomials.py
  45. +3 3 sympy/geometry/ellipse.py
  46. +1 1  sympy/geometry/tests/test_geometry.py
  47. +5 5 sympy/integrals/trigonometry.py
  48. +1 1  sympy/ntheory/primetest.py
  49. +1 1  sympy/ntheory/residue.py
  50. +0 8 sympy/ntheory/tests/test_ntheory.py
  51. +1 1  sympy/numerics/functions2.py
  52. +1 1  sympy/numerics/quad.py
  53. +12 12 sympy/parsing/mathematica.py
  54. +1 1  sympy/parsing/maxima.py
  55. +2 2 sympy/parsing/tests/test_maxima.py
  56. +1 1  sympy/physics/tests/test_matrices.py
  57. +37 37 sympy/plotting/plot.py
  58. +2 2 sympy/plotting/plot_axes.py
  59. +1 1  sympy/plotting/plot_camera.py
  60. +15 15 sympy/plotting/plot_controller.py
  61. +1 1  sympy/plotting/plot_interval.py
  62. +6 6 sympy/plotting/plot_mode.py
  63. +2 2 sympy/plotting/plot_mode_base.py
  64. +2 2 sympy/plotting/plot_modes.py
  65. +1 1  sympy/plotting/plot_rotation.py
  66. +4 4 sympy/plotting/plot_window.py
  67. +4 4 sympy/polynomials/base.py
  68. +4 4 sympy/polynomials/div_.py
  69. +10 10 sympy/polynomials/factor_.py
  70. +3 3 sympy/polynomials/fast/gfpoly.py
  71. +12 12 sympy/polynomials/fast/intpoly.py
  72. +2 2 sympy/polynomials/fast/modint.py
  73. +2 2 sympy/polynomials/groebner_.py
  74. +7 7 sympy/polynomials/tests/test_polynomials.py
  75. +7 7 sympy/polynomials/tests/test_polynomials_fast.py
  76. +1 1  sympy/printing/latex.py
  77. +3 3 sympy/printing/pretty/stringpict.py
  78. +2 2 sympy/printing/pretty/tests/test_pretty.py
  79. +1 1  sympy/printing/printer.py
  80. +2 2 sympy/printing/tests/test_python.py
  81. +47 47 sympy/series/gruntz.py
  82. +1 1  sympy/series/limits.py
  83. +3 3 sympy/series/limits_series.py
  84. +8 8 sympy/series/order.py
  85. +1 1  sympy/series/tests/test_gruntz.py
  86. +4 4 sympy/series/tests/test_order.py
  87. +2 2 sympy/series/tests/test_series.py
  88. +1 1  sympy/simplify/simplify.py
  89. +12 12 sympy/simplify/sqrtdenest.py
  90. +2 2 sympy/solvers/solvers.py
  91. +2 2 sympy/solvers/tests/test_ode.py
  92. +2 2 sympy/solvers/tests/test_recurr.py
  93. +1 1  sympy/specfun/tests/test_factorials.py
  94. +3 3 sympy/test_external/test_numpy.py
  95. +12 12 sympy/utilities/mathml/__init__.py
  96. +13 13 sympy/utilities/mathml/data/mmlctop.xsl
  97. +15 15 sympy/utilities/mathml/data/mmltex.xsl
  98. +13 13 sympy/utilities/mathml/data/simple_mmlctop.xsl
  99. +1 1  sympy/utilities/memoization.py
  100. +2 2 sympy/utilities/pkgdata.py
  101. +8 8 sympy/utilities/pytest.py
4 README
@@ -6,11 +6,11 @@ A Python library for symbolic mathematics.
6 6 http://code.google.com/p/sympy/
7 7
8 8 All people who contributed to SymPy by sending at least a patch or more (in
9   -the order of the date of their first contribution):
  9 +the order of the date of their first contribution):
10 10 Ondrej Certik <ondrej@certik.cz>
11 11 Fabian Seoane <fabian@fseoane.net>
12 12 Jurjen N.E. Bos <jnebos@gmail.com>
13   - Mateusz Paprocki <mattpap@gmail.com>
  13 + Mateusz Paprocki <mattpap@gmail.com>
14 14 Marc-Etienne M.Leveille <protonyc@gmail.com>
15 15 Brian Jorgensen <brian.jorgensen@gmail.com>
16 16 Jason Gedge <inferno1386@gmail.com>
2  TODO
@@ -2,7 +2,7 @@ Current problems are tracked at:
2 2
3 3 http://code.google.com/p/sympy/issues/list
4 4
5   -for ideas what should be done in the more distant future, see:
  5 +for ideas what should be done in the more distant future, see:
6 6 http://code.google.com/p/sympy/wiki/Discussion
7 7
8 8 but generally ask on the SymPy mailinglist for uptodate future plan. :)
2  bin/generate_test_list.py
... ... @@ -1,7 +1,7 @@
1 1 """
2 2 Execute like this:
3 3
4   -$ python bin/generate_test_list.py
  4 +$ python bin/generate_test_list.py
5 5 tests = [
6 6 'sympy.concrete.tests',
7 7 'sympy.core.tests',
8 bin/test_isolated
... ... @@ -1,11 +1,11 @@
1 1 #! /usr/bin/python
2 2 """
3 3 Generates a bash script, that executes py.test or nosetest on each file
4   -individually.
  4 +individually.
5 5
6 6 Example:
7 7
8   - $ bin/test_isolated
  8 + $ bin/test_isolated
9 9 Generating py.test isolated testsuite...
10 10 Done. Run '/tmp/test_sympy.sh'.
11 11
@@ -43,7 +43,7 @@ def get_paths(level=6):
43 43
44 44 def generate_test_script1(testlib="py.test"):
45 45 """Generates a bash script for doing the test.
46   -
  46 +
47 47 "testlib" is the name of the executable, that is going to execute the test,
48 48 for example "py.test" or "nosetests".
49 49 """
@@ -60,7 +60,7 @@ def generate_test_script1(testlib="py.test"):
60 60
61 61 def generate_test_script2(testlib="nosetests"):
62 62 """Generates a bash script for doing the test.
63   -
  63 +
64 64 "testlib" is the name of the executable, that is going to execute the test,
65 65 for example "py.test" or "nosetests".
66 66 """
2  bin/test_pure
... ... @@ -1,5 +1,5 @@
1 1 # This script is for testig SymPy in pure Python environment
2   -#
  2 +#
3 3 # Usage
4 4 # -----
5 5 # In this directory execute:
2  bin/test_pure_plotting
... ... @@ -1,5 +1,5 @@
1 1 # This script is for testig SymPy plotting in pure Python environment
2   -#
  2 +#
3 3 # Usage
4 4 # -----
5 5 # In this directory execute:
4 data/TeXmacs/bin/tm_sympy
@@ -4,7 +4,7 @@
4 4 #
5 5 # This plugin supports LaTeX printing of SymPy expressions
6 6 # using sympy.printing.latex function. It handles pretty
7   -# printing of containers. If you wish to display raw
  7 +# printing of containers. If you wish to display raw
8 8 # Python code, then use 'print' before an expression.
9 9 #
10 10 # TeXmacs encodes new-lines as spaces so we must use
@@ -13,7 +13,7 @@
13 13 # in a sequence. However you can and must indent your
14 14 # expression using standard Pyhon rules.
15 15 #
16   -# You can retrive the last output using '_' built-in
  16 +# You can retrive the last output using '_' built-in
17 17 # symbol. If the previous command did not generate
18 18 # any ouput, it will be assigned with None.
19 19 #
2  doc/Makefile
@@ -35,7 +35,7 @@ clean:
35 35 $(SPHINXBUILDpy):
36 36 rm -rf sphinx
37 37 mkdir sphinx
38   - cd sphinx; wget http://pypi.python.org/packages/source/S/Sphinx/Sphinx-$(SPHINXVER).tar.gz;
  38 + cd sphinx; wget http://pypi.python.org/packages/source/S/Sphinx/Sphinx-$(SPHINXVER).tar.gz;
39 39 cd sphinx; tar xzf Sphinx-$(SPHINXVER).tar.gz
40 40
41 41 html: $(SPHINXBUILDpy) spt-printable
2  doc/api/index.txt
@@ -3,7 +3,7 @@ Welcome to SymPy API reference
3 3
4 4 This is an automaticaly generated API documentation from SymPy sources.
5 5
6   -Click the "modules" (:ref:`modindex`) link in the top right corner to
  6 +Click the "modules" (:ref:`modindex`) link in the top right corner to
7 7 browse the modules.
8 8
9 9 Or click the "index" to see an index of all SymPy functions, methods and
2  doc/generate_reference.py
@@ -14,7 +14,7 @@ def isclass(x):
14 14
15 15 def ismethod(x):
16 16 from inspect import ismethod as _ismethod
17   - if _ismethod(x) or isinstance(x, (types.MethodType, types.FunctionType,
  17 + if _ismethod(x) or isinstance(x, (types.MethodType, types.FunctionType,
18 18 types.UnboundMethodType)) or str(type(x)) in [
19 19 "<type 'classmethod'>", "<type 'staticmethod'>"]:
20 20 return True
4 doc/man/isympy.xml
@@ -8,7 +8,7 @@
8 8
9 9 docbook2x-man isympy.xml
10 10
11   -this will generate isympy.1 in the current directory. -->
  11 +this will generate isympy.1 in the current directory. -->
12 12
13 13 <!-- Fill in your name for FIRSTNAME and SURNAME. -->
14 14 <!ENTITY dhfirstname "Fabian">
@@ -26,7 +26,7 @@ this will generate isympy.1 in the current directory. -->
26 26 <!-- http://www.tldp.org/HOWTO/Man-Page/q2.html). But limit -->
27 27 <!-- the length to 30 chars. -->
28 28 <!ENTITY dhtitle "&dhpackage; command-line reference">
29   -
  29 +
30 30 <!ENTITY dhucpackage "isympy">
31 31 <!ENTITY dhpackage "isympy">
32 32
2  doc/src/aboutus.txt
@@ -4,7 +4,7 @@ About
4 4 SymPy Development Team
5 5 ----------------------
6 6
7   -SymPy is a team project and it was developed by a lot of people.
  7 +SymPy is a team project and it was developed by a lot of people.
8 8
9 9 Here is a list of contributors together with what they do, plus links to their
10 10 wiki pages (if they have one on the page `People
66 doc/src/guide.txt
@@ -74,9 +74,9 @@ into the function ``Add.flatten()``::
74 74
75 75 @classmethod
76 76 def flatten(cls, seq):
77   - """
  77 + """
78 78 Takes the sequence "seq" of nested Adds and returns a flatten list.
79   -
  79 +
80 80 Returns: (commutative_part, noncommutative_part, lambda_args,
81 81 order_symbols)
82 82
@@ -95,17 +95,17 @@ into the function ``Add.flatten()``::
95 95
96 96 and then you can study how it works. I am going to stop here, this should be
97 97 enough to get you going -- with the above technique, I am able to understand
98   -almost any Python code.
  98 +almost any Python code.
99 99
100 100 .. note:: The above debugging was done on the revision `75544c92be1d <http://hg.sympy.org/sympy/rev/75544c92be1d>`_.
101 101
102 102 SymPy's Architecture
103 103 ====================
104 104
105   -We try to make the sources easily understandable, so you can look into the sources and read the doctests, it should be well documented and if you don't understand something, ask on the mailinglist.
  105 +We try to make the sources easily understandable, so you can look into the sources and read the doctests, it should be well documented and if you don't understand something, ask on the mailinglist.
106 106
107 107 You can find all the decisions archived in the Issues, to see rationale for
108   -doing this and that.
  108 +doing this and that.
109 109
110 110 Basics
111 111 ------
@@ -119,7 +119,7 @@ class supports.
119 119
120 120 For easier use, there is a syntactic sugar for expressions like:
121 121
122   -``cos(x)+1`` is equal to ``cos(x).__add__(1)`` is equal to ``Add(cos(x),Integer(1))``
  122 +``cos(x)+1`` is equal to ``cos(x).__add__(1)`` is equal to ``Add(cos(x),Integer(1))``
123 123
124 124 or
125 125
@@ -149,7 +149,7 @@ the only requirement is that all equivalent expressions must have the same
149 149 canonical form. We tried the conversion to a canonical (standard) form to be
150 150 as fast as possible and also in a way so that the result is what you would
151 151 write by hand - so for example ``b*a + -4 + b + a*b + 4 + (a+b)**2`` becomes
152   -``2*a*b + b + (a+b)**2``.
  152 +``2*a*b + b + (a+b)**2``.
153 153
154 154 Whenever you construct an expression, for example ``Add(x, x)``, the
155 155 ``Add.__new__()`` is called and it determines what to return. In this case::
@@ -163,7 +163,7 @@ Whenever you construct an expression, for example ``Add(x, x)``, the
163 163 Out[3]: <class 'sympy.core.mul.Mul'>
164 164
165 165 ``e`` is actually an instance of ``Mul(2, x)``, because ``Add.__new__()``
166   -retuned ``Mul``.
  166 +retuned ``Mul``.
167 167
168 168 Comparisons
169 169 -----------
@@ -180,7 +180,7 @@ We made the following decision in SymPy: ``a=Symbol("x")`` and another
180 180 ``b=Symbol("x")`` (with the same string "x") is the same thing, i.e ``a==b`` is
181 181 ``True``. We chose ``a==b``, because it is more natural - ``exp(x)==exp(x)`` is
182 182 also ``True`` for the same intance of ``x`` but different instances of ``exp``,
183   -so we chose to have ``exp(x)==exp(x)`` even for different instances of ``x``.
  183 +so we chose to have ``exp(x)==exp(x)`` even for different instances of ``x``.
184 184
185 185 Sometimes, you need to have a unique symbol, for example as a temporary one in
186 186 some calculation, which is going to be substituted for something else at the
@@ -202,7 +202,7 @@ don't implement the ``fdiff()`` method and you construct an expression using
202 202 such a class, then trying to use the ``Basic.series()`` method will raise an
203 203 exception of not founding the ``fdiff()`` method in your class. This "duck
204 204 typing" has an advantage that you just implement the functionality which you
205   -need.
  205 +need.
206 206
207 207 You can define the function ``cos`` like this::
208 208
@@ -289,7 +289,7 @@ both inside and outside of SymPy. Unapplied functions ``sign`` is just the class
289 289
290 290 sign
291 291
292   -Both inside and outside of SymPy.
  292 +Both inside and outside of SymPy.
293 293 This is the current structure of classes in SymPy::
294 294
295 295 class BasicType(type):
@@ -338,23 +338,23 @@ Here it's how to define a derivative of the function::
338 338 return sympify(0)
339 339
340 340 So guess what this ``my_function`` is going to be? Well, it's derivative is
341   -``cos`` and the function value at 0 is 0, but let's pretend we don't know::
  341 +``cos`` and the function value at 0 is 0, but let's pretend we don't know::
342 342
343 343 In [2]: my_function(x).series(x, 0, 10)
344   - Out[2]:
345   - 3 5 7 9
346   - x x x x
  344 + Out[2]:
  345 + 3 5 7 9
  346 + x x x x
347 347 x - ── + ─── - ──── + ────── + O(x**10)
348   - 6 120 5040 362880
  348 + 6 120 5040 362880
349 349
350 350 Looks familiar indeed::
351 351
352 352 In [3]: sin(x).series(x, 0, 10)
353   - Out[3]:
354   - 3 5 7 9
355   - x x x x
  353 + Out[3]:
  354 + 3 5 7 9
  355 + x x x x
356 356 x - ── + ─── - ──── + ────── + O(x**10)
357   - 6 120 5040 362880
  357 + 6 120 5040 362880
358 358
359 359 Let's try some more complicated example. Let's define the derivative in terms of the function itself::
360 360
@@ -373,20 +373,20 @@ Let's try some more complicated example. Let's define the derivative in terms of
373 373 So what is ``what_am_i``? Let's try it::
374 374
375 375 In [4]: what_am_i(x).series(x, 0, 10)
376   - Out[4]:
377   - 3 5 7 9
378   - x 2*x 17*x 62*x
  376 + Out[4]:
  377 + 3 5 7 9
  378 + x 2*x 17*x 62*x
379 379 x - ── + ──── - ───── + ───── + O(x**10)
380   - 3 15 315 2835
  380 + 3 15 315 2835
381 381
382 382 Well, it's ``tanh``::
383 383
384 384 In [5]: tanh(x).series(x, 0, 10)
385   - Out[5]:
386   - 3 5 7 9
387   - x 2*x 17*x 62*x
  385 + Out[5]:
  386 + 3 5 7 9
  387 + x 2*x 17*x 62*x
388 388 x - ── + ──── - ───── + ───── + O(x**10)
389   - 3 15 315 2835
  389 + 3 15 315 2835
390 390
391 391 The new functions we just defined are regular SymPy objects, you
392 392 can use them all over SymPy, e.g.::
@@ -405,14 +405,14 @@ Please use the same way as is shown below all across SymPy.
405 405 In [1]: e = sign(x**2)
406 406
407 407 In [2]: e.args
408   - Out[2]:
  408 + Out[2]:
409 409 ⎛ 2⎞
410 410 ⎝x ⎠
411 411
412 412 In [3]: e.args[0]
413   - Out[3]:
  413 + Out[3]:
414 414 2
415   - x
  415 + x
416 416
417 417 In [4]: (x+y*z).args
418 418 Out[4]: (y*z, x)
@@ -447,7 +447,7 @@ Applied functions::
447 447 In [2]: isinstance(e, Function)
448 448 Out[2]: True
449 449
450   -So ``e`` is a ``sign(z)`` function, but not ``exp(z)`` function.
  450 +So ``e`` is a ``sign(z)`` function, but not ``exp(z)`` function.
451 451
452 452 Unapplied functions::
453 453
@@ -476,7 +476,7 @@ Contributing
476 476
477 477 We welcome every SymPy user to participate in it's development. Don't worry if
478 478 you've never contributed to any open source project, we'll help you learn
479   -anything necessary, just ask on our mailinglist.
  479 +anything necessary, just ask on our mailinglist.
480 480
481 481 Don't be afraid to ask anything and don't worry that you are wasting our time
482 482 if you are new to SymPy and ask questions that maybe most of the people know
2  doc/src/index.txt
@@ -5,7 +5,7 @@
5 5 Welcome to SymPy's documentation!
6 6 =================================
7 7
8   -This is the central page for all SymPy's documentation.
  8 +This is the central page for all SymPy's documentation.
9 9
10 10 If you are new to SymPy, start with the Tutorial.
11 11
2  doc/src/modules.txt
@@ -11,7 +11,7 @@ API documentation
11 11 -----------------
12 12
13 13 This documents all SymPy modules and it is automatically generated from SymPy
14   -sources.
  14 +sources.
15 15
16 16 Click the "modules" (:ref:`modindex`) link in the top right corner for
17 17 automatically generated documentation.
6 doc/src/outreach.txt
... ... @@ -1,7 +1,7 @@
1 1 SymPy Presentations
2 2 -------------------
3 3
4   -Presentations about SymPy given at conferences are at
  4 +Presentations about SymPy given at conferences are at
5 5 `SymPyPresentations <http://code.google.com/p/sympy/wiki/SymPyPresentations>`_
6 6
7 7 Planet SymPy
@@ -17,7 +17,7 @@ SymPy has a collection of official logos, that can be accessed here:
17 17 http://sympy.googlecode.com/svn/materials/logo/
18 18
19 19 The license of all the logos is the same as SymPy: BSD. See the LICENSE file in
20   -the trunk for more information.
  20 +the trunk for more information.
21 21
22 22 Google Summer of Code
23 23 ---------------------
@@ -36,7 +36,7 @@ Here we list blog/news/magazines mentioning SymPy that we know of.
36 36 * Penguin.cz: `Zajímavé programy 50`_ (Czech), July 2007
37 37 * Penguin.cz: `Zajímavé programy 55`_ (Czech), October 2007
38 38 * `Python Magazine`_, Volume 1, Issue 11, November 2007
39   -* SymPy and Sage is mentioned in: `CAS and Python`_, December 2007
  39 +* SymPy and Sage is mentioned in: `CAS and Python`_, December 2007
40 40
41 41 .. _Zajímavé programy 50: http://www.penguin.cz/novinky-view.php?id=1142
42 42 .. _Zajímavé programy 55: http://www.penguin.cz/novinky-view.php?id=1149
28 doc/src/sympy-patches-tutorial.txt
@@ -12,7 +12,7 @@ SymPy Patches Tutorial
12 12 .. .. sidebar:: Talk is cheap. Show me the code.
13 13
14 14 .. epigraph:: Talk is cheap. Show me the code.
15   -
  15 +
16 16 -- Linus Torvalds [1]_
17 17
18 18
@@ -647,7 +647,7 @@ and clean workdir
647 647
648 648 $ :input:`hg st`
649 649 $ :input:`hg diff`
650   - $
  650 + $
651 651
652 652
653 653 Here is a bit of history:
@@ -714,22 +714,22 @@ For this we go to `sympy` mirroring repository, see whats new, and pull updates:
714 714 user: Ondrej Certik <ondrej@certik.cz>
715 715 date: Sat Mar 22 16:06:47 2008 +0100
716 716 summary: The print ordering of Add has been improved.
717   -
  717 +
718 718 changeset: 1901:7cd8948a664a
719 719 user: Kirill Smelkov <kirr@landau.phys.spbu.ru>
720 720 date: Mon Mar 24 00:17:12 2008 +0300
721 721 summary: [1/2] let's use __slots__
722   -
  722 +
723 723 changeset: 1902:529ba5e4a7c6
724 724 user: Kirill Smelkov <kirr@landau.phys.spbu.ru>
725 725 date: Mon Mar 24 00:17:13 2008 +0300
726 726 summary: [2/2] let's use __slots__
727   -
  727 +
728 728 changeset: 1903:115df7b1ee75
729 729 user: Kirill Smelkov <kirr@landau.phys.spbu.ru>
730 730 date: Mon Mar 24 00:17:14 2008 +0300
731 731 summary: add comments to Mul.flatten
732   -
  732 +
733 733 changeset: 1904:75544c92be1d
734 734 tag: tip
735 735 user: Kirill Smelkov <kirr@landau.phys.spbu.ru>
@@ -802,7 +802,7 @@ Now we have our patches applied on top of the latest tip.
802 802 Sometimes changes we've made *overlap* with the changes made by other
803 803 developers. This situation is called conflict_ and has to be resolved using
804 804 automated merge programs or by hands.
805   -
  805 +
806 806 This topic is out of scope of this tutorial, but an interested reader is
807 807 encouraged to read `chapter 3`_ in hgbook_ and TutorialConflict_ HG wiki
808 808 page.
@@ -826,13 +826,13 @@ Ensure last time on outgoing changes
826 826 user: Kirill Smelkov <kirr@landau.phys.spbu.ru>
827 827 date: Wed Mar 26 15:18:09 2008 +0300
828 828 summary: pprint: fix handling of old-style classes (#755)
829   -
  829 +
830 830 changeset: 1906:316070047993
831 831 tag: xobj-fix-even-height.patch
832 832 user: Kirill Smelkov <kirr@landau.phys.spbu.ru>
833 833 date: Wed Mar 26 15:18:09 2008 +0300
834 834 summary: pretty: fix xobj for even height
835   -
  835 +
836 836 changeset: 1907:63eb63c9f098
837 837 tag: qtip
838 838 tag: printer-fix-typos.patch
@@ -849,19 +849,19 @@ And let's finally send them:
849 849 comparing with /home/kirr/src/sympy/spt-work/sympy
850 850 searching for changes
851 851 This patch series consists of 3 patches.
852   -
  852 +
853 853 Subject: [PATCH 0 of 3] :input:`Fix for #755 + two more`
854   -
  854 +
855 855 Write the introductory message for the patch series.
856 856
857 857 :input:`While working on #755 (pprint fails on old style classes) I've spot a couple`
858 858 :input:`of other inconveniences.`
859 859
860 860 :input:`Please review.`
861   -
  861 +
862 862 To: :input:`sympy-patches@googlegroups.com` TODO put this into .hgrc
863   - Cc:
864   -
  863 + Cc:
  864 +
865 865 Sending [PATCH 0 of 3] Fix for #755 + two more ...
866 866 Sending [PATCH 1 of 3] pprint: fix handling of old-style classes (#755) ...
867 867 Sending [PATCH 2 of 3] pretty: fix xobj for even height ...
70 doc/src/tutorial.txt
@@ -34,14 +34,14 @@ Unpack it:
34 34 .. parsed-literal::
35 35
36 36 $ :input:`tar xzf sympy-0.5.12.tar.gz`
37   -
  37 +
38 38 and try it from a Python intepreter:
39 39
40 40 .. parsed-literal::
41 41
42 42 $ :input:`cd sympy-0.5.12`
43 43 $ :input:`python`
44   - Python 2.4.4 (#2, Jan 3 2008, 13:36:28)
  44 + Python 2.4.4 (#2, Jan 3 2008, 13:36:28)
45 45 [GCC 4.2.3 20071123 (prerelease) (Debian 4.2.2-4)] on linux2
46 46 Type "help", "copyright", "credits" or "license" for more information.
47 47 >>> :input:`from sympy import Symbol, cos`
@@ -60,7 +60,7 @@ distribution, e.g.:
60 60
61 61 $ :input:`sudo apt-get install python-sympy`
62 62 Reading package lists... Done
63   - Building dependency tree
  63 + Building dependency tree
64 64 Reading state information... Done
65 65 The following NEW packages will be installed:
66 66 python-sympy
@@ -68,7 +68,7 @@ distribution, e.g.:
68 68 Need to get 991kB of archives.
69 69 After this operation, 5976kB of additional disk space will be used.
70 70 Get:1 http://ftp.cz.debian.org unstable/main python-sympy 0.5.12-1 [991kB]
71   - Fetched 991kB in 2s (361kB/s)
  71 + Fetched 991kB in 2s (361kB/s)
72 72 Selecting previously deselected package python-sympy.
73 73 (Reading database ... 232619 files and directories currently installed.)
74 74 Unpacking python-sympy (from .../python-sympy_0.5.12-1_all.deb) ...
@@ -88,7 +88,7 @@ For experimenting with new features, or when figuring out how to do things, you
88 88 can use our special wrapper around IPython called ``isympy`` (located in
89 89 ``bin/isympy`` if you are running from the source directory) which is just a
90 90 standard python shell that has already imported the relevant sympy modules and
91   -defined the symbols x, y, z and some other things:
  91 +defined the symbols x, y, z and some other things:
92 92
93 93 .. parsed-literal::
94 94
@@ -100,16 +100,16 @@ defined the symbols x, y, z and some other things:
100 100 >>> x, y, z = symbols('xyz')
101 101 >>> k, m, n = symbols('kmn', integer=True)
102 102 >>> f = Function("f")
103   -
  103 +
104 104 Documentation can be found at http://sympy.org/
105   -
106   -
  105 +
  106 +
107 107 In [1]: :input:`(1/cos(x)).series(x, 0, 10)`
108   - Out[1]:
109   - 2 4 6 8
110   - x 5*x 61*x 277*x
  108 + Out[1]:
  109 + 2 4 6 8
  110 + x 5*x 61*x 277*x
111 111 1 + ── + ──── + ───── + ────── + O(x**10)
112   - 2 24 720 8064
  112 + 2 24 720 8064
113 113
114 114 .. note::
115 115
@@ -122,7 +122,7 @@ Using SymPy as a calculator
122 122
123 123 Sympy has three built-in numeric types: Real, Rational and Integer.
124 124
125   -The Rational class represents a rational number as a pair of two Integers: the numerator and the denominator, so Rational(1,2) represents 1/2, Rational(5,2) 5/2 and so on.
  125 +The Rational class represents a rational number as a pair of two Integers: the numerator and the denominator, so Rational(1,2) represents 1/2, Rational(5,2) 5/2 and so on.
126 126
127 127 ::
128 128
@@ -140,7 +140,7 @@ The Rational class represents a rational number as a pair of two Integers: the n
140 140
141 141
142 142 proceed with caution while working with python int's since they truncate
143   -integer division, and that's why::
  143 +integer division, and that's why::
144 144
145 145 >>> 1/2
146 146 0
@@ -152,7 +152,7 @@ You can however do::
152 152
153 153 >>> from __future__ import division
154 154
155   - >>> 1/2 #doctest: +SKIP
  155 + >>> 1/2 #doctest: +SKIP
156 156 0.5
157 157
158 158 True division is going to be standard in python3k and ``isympy`` does that too.
@@ -183,7 +183,7 @@ Symbols
183 183 -------
184 184
185 185 In contrast to other Computer Algebra Systems, in SymPy you have to declare
186   -symbolic variables explicitly::
  186 +symbolic variables explicitly::
187 187
188 188 >>> from sympy import *
189 189 >>> x = Symbol('x')
@@ -276,7 +276,7 @@ Higher derivatives can be calculated using the ``diff(func, var, n)`` method::
276 276 -8*cos(2*x)
277 277
278 278
279   -.. index::
  279 +.. index::
280 280 single: series expansion
281 281 single: expansion; series
282 282
@@ -308,11 +308,11 @@ Another simple example::
308 308 That should print the following after the execution::
309 309
310 310 1/y + x**2*y**(-3) + x**4*y**(-5) - x*y**(-2) - x**3*y**(-4) + O(x**5)
311   - 2 4 3
312   - 1 x x x x
  311 + 2 4 3
  312 + 1 x x x x
313 313 ─ + ── + ── - ── - ── + O(x**5)
314   - y 3 5 2 4
315   - y y y y
  314 + y 3 5 2 4
  315 + y y y y
316 316
317 317 .. index:: integration
318 318
@@ -359,7 +359,7 @@ Also improper integrals are supported as well::
359 359 >>> integrate(log(x), (x, 0, 1))
360 360 -1
361 361
362   -.. index::
  362 +.. index::
363 363 single: complex numbers
364 364 single: expansion; complex
365 365
@@ -386,11 +386,11 @@ Differential Equations
386 386 In ``isympy``::
387 387
388 388 In [4]: f(x).diff(x, x) + f(x)
389   - Out[4]:
390   - 2
391   - d
  389 + Out[4]:
  390 + 2
  391 + d
392 392 ─────(f(x)) + f(x)
393   - dx dx
  393 + dx dx
394 394
395 395 In [5]: dsolve(f(x).diff(x, x) + f(x), f(x))
396 396 Out[5]: C₁*sin(x) + C₂*cos(x)
@@ -423,7 +423,7 @@ Matrices
423 423 Matrices are created as instances from the Matrix class::
424 424
425 425 >>> from sympy import Matrix
426   - >>> Matrix([[1,0], [0,1]])
  426 + >>> Matrix([[1,0], [0,1]])
427 427 [1 0]
428 428 [0 1]
429 429
@@ -435,11 +435,11 @@ you can also put Symbols in it::
435 435 >>> A #doctest: +NORMALIZE_WHITESPACE
436 436 [1 x]
437 437 [y 1]
438   -
  438 +
439 439 >>> A**2 #doctest: +NORMALIZE_WHITESPACE
440   - [1+x*y 2*x]
  440 + [1+x*y 2*x]
441 441 [2*y 1+x*y]
442   -
  442 +
443 443 >>> 1
444 444 1
445 445
@@ -521,16 +521,16 @@ This is a nice ascii-art printing produced by a ``pprint`` function:
521 521 >>> from sympy.abc import x
522 522 >>> pprint(x**2)
523 523 2
524   - x
  524 + x
525 525 >>> pprint(1/x)
526 526 1
527 527
528 528 x
529 529 >>> pprint(Integral(x**2, x))
530   - ⌠
531   - ⎮ 2
  530 + ⌠
  531 + ⎮ 2
532 532 ⎮ x dx
533   - ⌡
  533 + ⌡
534 534 >>>
535 535
536 536 **Python printing**
@@ -547,7 +547,7 @@ This is a nice ascii-art printing produced by a ``pprint`` function:
547 547 >>> print_python(Integral(x**2, x))
548 548 x = Symbol('x')
549 549 e = Integral(x**2, x)
550   - >>>
  550 + >>>
551 551
552 552 **LaTeX printing**
553 553
6 examples/all
@@ -13,7 +13,7 @@
13 13 # File "./limits_examples.py", line 17, in ?
14 14 # [...]
15 15 # $
16   -#
  16 +#
17 17 # Obviously, we want to achieve the first result.
18 18
19 19 # The commented out examples below don't run:
@@ -21,7 +21,7 @@
21 21 #./mplot3d.py
22 22 ./relativity.py
23 23 ./differential_equations.py
24   -#./pidigits.py
  24 +#./pidigits.py
25 25 ./differentiation.py
26 26 #./plotting_nice_plot.py
27 27 ./series.py
@@ -40,4 +40,4 @@
40 40 ./vandermonde.py
41 41 ./limits_examples.py
42 42 #./qft.py
43   -#./mplot2d.py
  43 +#./mplot2d.py
2  examples/fem_test.py
@@ -4,7 +4,7 @@
4 4 """
5 5 Go to the sympy root directory and execute:
6 6
7   -$ python examples/fem_test.py
  7 +$ python examples/fem_test.py
8 8 [ 1/60, 0, -1/360, 0, -1/90, -1/360]
9 9 [ 0, 4/45, 0, 2/45, 2/45, -1/90]
10 10 [-1/360, 0, 1/60, -1/90, 0, -1/360]
4 examples/print_pretty.py
@@ -3,8 +3,8 @@
3 3
4 4 from sympy import *
5 5
6   -x=Symbol("x")
7   -y=Symbol("y")
  6 +x=Symbol("x")
  7 +y=Symbol("y")
8 8
9 9
10 10 pprint( x**x )
4 examples/print_pygame.py
@@ -5,8 +5,8 @@
5 5 from sympy.core import basic
6 6 from sympy.printing import print_pygame, pprint
7 7
8   -x=Symbol("x")
9   -y=Symbol("y")
  8 +x=Symbol("x")
  9 +y=Symbol("y")
10 10
11 11 expressions = (
12 12 x**x,
16 examples/relativity.py
@@ -100,29 +100,29 @@ def curvature(Rmn):
100 100 phi=Symbol(r"\phi")
101 101
102 102 #general, spherically symmetric metric
103   -gdd=Matrix((
104   - (-exp(nu(r)),0,0,0),
  103 +gdd=Matrix((
  104 + (-exp(nu(r)),0,0,0),
105 105 (0, exp(lam(r)), 0, 0),
106 106 (0, 0, r**2, 0),
107 107 (0, 0, 0, r**2*sin(theta)**2)
108 108 ))
109 109 #spherical - flat
110   -#gdd=Matrix((
111   -# (-1, 0, 0, 0),
  110 +#gdd=Matrix((
  111 +# (-1, 0, 0, 0),
112 112 # (0, 1, 0, 0),
113 113 # (0, 0, r**2, 0),
114 114 # (0, 0, 0, r**2*sin(theta)**2)
115 115 # ))
116 116 #polar - flat
117   -#gdd=Matrix((
118   -# (-1, 0, 0, 0),
  117 +#gdd=Matrix((
  118 +# (-1, 0, 0, 0),
119 119 # (0, 1, 0, 0),
120 120 # (0, 0, 1, 0),
121 121 # (0, 0, 0, r**2)
122 122 # ))
123 123 #polar - on the sphere, on the north pole
124   -#gdd=Matrix((
125   -# (-1, 0, 0, 0),
  124 +#gdd=Matrix((
  125 +# (-1, 0, 0, 0),
126 126 # (0, 1, 0, 0),
127 127 # (0, 0, r**2*sin(theta)**2, 0),
128 128 # (0, 0, 0, r**2)
6 examples/t.py
@@ -9,9 +9,9 @@
9 9 from sympy.core import basic
10 10 limits.debug=True
11 11
12   -x=Symbol("x")
13   -y=Symbol("y")
14   -w=Symbol("w")
  12 +x=Symbol("x")
  13 +y=Symbol("y")
  14 +w=Symbol("w")
15 15
16 16 #import pdb
17 17 #pdb.run('print limit(sin(x)/x,x,oo)')
4 examples/tensors.py
@@ -60,8 +60,8 @@ class nu(Function):
60 60 class lam(Function):
61 61 pass
62 62
63   -gdd=Matrix((
64   - (-exp(nu(r)),0,0,0),
  63 +gdd=Matrix((
  64 + (-exp(nu(r)),0,0,0),
65 65 (0, exp(lam(r)), 0, 0),
66 66 (0, 0, r**2, 0),
67 67 (0, 0, 0, r**2*sin(theta)**2)
10 sympy/core/add.py
@@ -19,9 +19,9 @@ class Add(AssocOp, RelMeths, ArithMeths):
19 19
20 20 @classmethod
21 21 def flatten(cls, seq):
22   - """
  22 + """
23 23 Takes the sequence "seq" of nested Adds and returns a flatten list.
24   -
  24 +
25 25 Returns: (commutative_part, noncommutative_part, lambda_args,
26 26 order_symbols)
27 27
@@ -147,7 +147,7 @@ def flatten(cls, seq):
147 147 @staticmethod
148 148 def compare_terms(a, b):
149 149 """
150   - Is a>b in the sense of ordering in printing?
  150 + Is a>b in the sense of ordering in printing?
151 151
152 152 yes ..... return 1
153 153 no ...... return -1
@@ -160,7 +160,7 @@ def compare_terms(a, b):
160 160 expression and returns the "sane" ordering such as:
161 161
162 162 1 < x < x**2 < x**3 < O(x**4) etc.
163   -
  163 +
164 164 """
165 165 from sympy.series.order import Order
166 166 if isinstance(a, Order) and not isinstance(b, Order):
@@ -425,7 +425,7 @@ def _sage_(self):
425 425 s = 0
426 426 for x in self.args:
427 427 s += x._sage_()
428   - return s
  428 + return s
429 429
430 430
431 431 # /cyclic/
12 sympy/core/assumptions.py
... ... @@ -1,7 +1,7 @@
1 1
2 2 class AssumeMeths(object):
3 3 """ Define default assumption methods.
4   -
  4 +
5 5 AssumeMeths should be used to derive Basic class only.
6 6
7 7 All symbolic objects have assumption attributes that
@@ -49,18 +49,18 @@ class AssumeMeths(object):
49 49 property decorators) or are attributes of objects/classes.
50 50
51 51 Examples:
52   -
  52 +
53 53 - True, when we are sure about a property. For example, when we are
54 54 working only with real numbers:
55 55 >>> from sympy import *
56 56 >>> Symbol('x', real = True)
57 57 x
58   -
  58 +
59 59 - False
60   -
  60 +
61 61 - None (if you don't know if the property is True or false)
62 62
63   -
  63 +
64 64
65 65 """
66 66
@@ -252,7 +252,7 @@ def assume(self, **assumptions):
252 252
253 253 processed = {}
254 254 replace = []
255   - aliases = self._assume_aliases
  255 + aliases = self._assume_aliases
256 256 negs = self._assume_negs
257 257 inegs = self._assume_inegs
258 258 rels = self._assume_rels
12 sympy/core/basic.py
@@ -626,9 +626,9 @@ def _subs_old_new(self, old, new):
626 626
627 627 def subs(self, *args):
628 628 """
629   - Substitutes an expression.
630   -
631   - Calls either _subs_old_new, _subs_dict or _subs_list depending
  629 + Substitutes an expression.
  630 +
  631 + Calls either _subs_old_new, _subs_dict or _subs_list depending
632 632 if you give it two arguments (old, new), a dictionary or a list.
633 633
634 634 Examples:
@@ -659,11 +659,11 @@ def subs(self, *args):
659 659
660 660 def _subs_list(self, sequence):
661 661 """
662   - Performs an order sensitive substitution from the
  662 + Performs an order sensitive substitution from the
663 663 input sequence list.
664 664
665 665 Examples:
666   -
  666 +
667 667 >>> from sympy import *
668 668 >>> x, y = symbols('xy')
669 669 >>> (x+y)._subs_list( [(x, 3), (y, x**2)] )
@@ -1643,7 +1643,7 @@ def leadterm(self, x):
1643 1643 class Atom(Basic):
1644 1644 """
1645 1645 A parent class for atomic things.
1646   -
  1646 +
1647 1647 Examples: Symbol, Number, Rational, Integer, ...
1648 1648 But not: Add, Mul, Pow, ...
1649 1649 """
32 sympy/core/decimal_math.py
@@ -43,11 +43,11 @@ def exp(x):
43 43 getcontext().prec += 2
44 44 i, lasts, s, fact, num = 0, 0, 1, 1, 1
45 45 while s != lasts:
46   - lasts = s
  46 + lasts = s
47 47 i += 1
48 48 fact *= i
49   - num *= x
50   - s += num / fact
  49 + num *= x
  50 + s += num / fact
51 51 getcontext().prec -= 2
52 52 return +s
53 53
@@ -57,13 +57,13 @@ def cos(x):
57 57 getcontext().prec += 2
58 58 i, lasts, s, fact, num, sign = 0, 0, 1, 1, 1, 1
59 59 while s != lasts:
60   - lasts = s
  60 + lasts = s
61 61 i += 2
62 62 fact *= i * (i - 1)
63 63 num *= x * x
64 64 sign *= -1
65   - s += num / fact * sign
66   - getcontext().prec -= 2
  65 + s += num / fact * sign
  66 + getcontext().prec -= 2
67 67 return +s
68 68
69 69 def sin(x):
@@ -72,7 +72,7 @@ def sin(x):
72 72 getcontext().prec += 2
73 73 i, lasts, s, fact, num, sign = 1, 0, x, 1, x, 1
74 74 while s != lasts:
75   - lasts = s
  75 + lasts = s
76 76 i += 2
77 77 fact *= i * (i - 1)
78 78 num *= x * x
@@ -85,7 +85,7 @@ def cosh(x):
85 85 """Return the hyperbolic cosine of Decimal x."""
86 86 if x == 0:
87 87 return D(1)
88   -
  88 +
89 89 getcontext().prec += 2
90 90 i, lasts, s, fact, num = 0, 0, 1, 1, 1
91 91 while s != lasts:
@@ -101,7 +101,7 @@ def sinh(x):
101 101 """Return the hyperbolic sine of Decimal x."""
102 102 if x == 0:
103 103 return D(0)
104   -
  104 +
105 105 getcontext().prec += 2
106 106 i, lasts, s, fact, num = 1, 0, x, 1, x
107 107 while s != lasts:
@@ -117,14 +117,14 @@ def asin(x):
117 117 """Return the arc sine (measured in radians) of Decimal x."""
118 118 if abs(x) > 1:
119 119 raise ValueError("Domain error: asin accepts -1 <= x <= 1")
120   -
  120 +
121 121 if x == -1:
122 122 return pi() / -2
123 123 elif x == 0:
124 124 return D(0)
125 125 elif x == 1:
126 126 return pi() / 2
127   -
  127 +
128 128 return atan2(x, D.sqrt(1 - x ** 2))
129 129
130 130 def acos(x):
@@ -138,7 +138,7 @@ def acos(x):
138 138 return pi() / 2
139 139 elif x == 1:
140 140 return D(0)
141   -
  141 +
142 142 return pi() / 2 - atan2(x, D.sqrt(1 - x ** 2))
143 143
144 144 def tan(x):
@@ -165,7 +165,7 @@ def atan(x):
165 165 return D(0)
166 166 elif x == D('Inf'):
167 167 return pi() / 2
168   -
  168 +
169 169 if x < -1:
170 170 c = pi() / -2
171 171 x = 1 / x
@@ -174,14 +174,14 @@ def atan(x):
174 174 x = 1 / x
175 175 else:
176 176 c = 0
177   -
  177 +
178 178 getcontext().prec += 2
179 179 x_squared = x ** 2
180 180 y = x_squared / (1 + x_squared)
181 181 y_over_x = y / x
182 182 i, lasts, s, coeff, num = D(0), 0, y_over_x, 1, y_over_x
183 183 while s != lasts:
184   - lasts = s
  184 + lasts = s
185 185 i += 2
186 186 coeff *= i / (i + 1)
187 187 num *= y
@@ -202,7 +202,7 @@ def atan2(y, x):
202 202 abs_y = abs(y)
203 203 abs_x = abs(x)
204 204 y_is_real = abs_y != D('Inf')
205   -
  205 +
206 206 if x:
207 207 if y_is_real:
208 208 a = y and atan(y / x) or D(0)
24 sympy/core/function.py
@@ -407,7 +407,7 @@ class Derivative(Basic, ArithMeths, RelMeths):
407 407 """
408 408
409 409 precedence = Basic.Apply_precedence
410   -
  410 +
411 411 @staticmethod
412 412 def _symbolgen(*symbols):
413 413 last_s = sympify(symbols[len(symbols)-1])
@@ -417,7 +417,7 @@ def _symbolgen(*symbols):
417 417 if s != last_s:
418 418 next_s = sympify(symbols[i+1])
419 419 # next_s = sympify(symbols[i+1]) if s != last_s else None
420   -
  420 +
421 421 if isinstance(s,Integer):
422 422 continue
423 423 elif isinstance(s, Symbol):
@@ -428,7 +428,7 @@ def _symbolgen(*symbols):
428 428 yield s
429 429 else:
430 430 raise TypeError("Derivative argument must be Symbol|Integer instance (got %s)" % (s.__class__.__name__))
431   -
  431 +
432 432 def __new__(cls, expr, *symbols, **assumptions):
433 433 expr = sympify(expr)
434 434 if not symbols: return expr
@@ -541,7 +541,7 @@ class Lambda(Function):
541 541 >>> plus1 = sum2numbers(1)
542 542 >>> plus1(3)
543 543 4
544   -
  544 +
545 545 """