Skip to content

Commit 632af5d

Browse files
user202729tscrim
andauthored
Apply suggestions from code review
Co-authored-by: Travis Scrimshaw <[email protected]>
1 parent 69313ee commit 632af5d

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/sage/symbolic/expression.pyx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4757,7 +4757,7 @@ cdef class Expression(Expression_abc):
47574757
return matrix([[g.derivative(x) for x in self.arguments()]
47584758
for g in self.gradient()])
47594759

4760-
def series(self, symbol, order=None, algorithm=None):
4760+
def series(self, symbol, order=None, algorithm='ginac'):
47614761
r"""
47624762
Return the power series expansion of ``self`` in terms of the
47634763
given variable to the given order.
@@ -4771,8 +4771,10 @@ cdef class Expression(Expression_abc):
47714771
- ``order`` -- integer; if nothing given, it is set
47724772
to the global default (``20``), which can be changed
47734773
using :func:`set_series_precision`
4774-
- ``algorithm`` -- string (default: ``None``);
4775-
if specified, ``'ginac'`` or ``'maxima'``
4774+
- ``algorithm`` -- string (default: ``'ginac'``); one of the following:
4775+
4776+
* ``'ginac'``
4777+
* ``'maxima'``
47764778
47774779
OUTPUT: a power series
47784780
@@ -4879,14 +4881,12 @@ cdef class Expression(Expression_abc):
48794881
sage: ((1 - x)^-x).series(x, 8, algorithm="ginac")
48804882
1 + 1*x^2 + 1/2*x^3 + 5/6*x^4 + 3/4*x^5 + 33/40*x^6 + 5/6*x^7 + Order(x^8)
48814883
"""
4882-
if algorithm is None:
4883-
algorithm = "ginac" # might be changed in the future
48844884
if algorithm == "maxima":
48854885
# call series() again to convert the result (a rational function in the symbol)
48864886
# to a SymbolicSeries with the correct order
48874887
return self.taylor(symbol, 0, order-1).series(symbol, order, algorithm="ginac")
48884888
if algorithm != "ginac":
4889-
raise ValueError("algorithm must be 'maxima' or 'ginac' if specified")
4889+
raise ValueError("invalid algorithm")
48904890
cdef Expression symbol0 = self.coerce_in(symbol)
48914891
cdef GEx x
48924892
cdef SymbolicSeries nex

0 commit comments

Comments
 (0)