@@ -4757,7 +4757,7 @@ cdef class Expression(Expression_abc):
4757
4757
return matrix([[g.derivative(x) for x in self .arguments()]
4758
4758
for g in self .gradient()])
4759
4759
4760
- def series (self , symbol , order = None , algorithm = None ):
4760
+ def series (self , symbol , order = None , algorithm = ' ginac ' ):
4761
4761
r """
4762
4762
Return the power series expansion of ``self`` in terms of the
4763
4763
given variable to the given order.
@@ -4771,8 +4771,10 @@ cdef class Expression(Expression_abc):
4771
4771
- ``order`` -- integer; if nothing given, it is set
4772
4772
to the global default ( ``20``) , which can be changed
4773
4773
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'``
4776
4778
4777
4779
OUTPUT: a power series
4778
4780
@@ -4879,14 +4881,12 @@ cdef class Expression(Expression_abc):
4879
4881
sage: (( 1 - x) ^ -x) . series( x, 8, algorithm="ginac")
4880
4882
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)
4881
4883
"""
4882
- if algorithm is None :
4883
- algorithm = " ginac" # might be changed in the future
4884
4884
if algorithm == " maxima" :
4885
4885
# call series() again to convert the result (a rational function in the symbol)
4886
4886
# to a SymbolicSeries with the correct order
4887
4887
return self .taylor(symbol, 0 , order- 1 ).series(symbol, order, algorithm = " ginac" )
4888
4888
if algorithm != " ginac" :
4889
- raise ValueError (" algorithm must be 'maxima' or 'ginac' if specified " )
4889
+ raise ValueError (" invalid algorithm " )
4890
4890
cdef Expression symbol0 = self .coerce_in(symbol)
4891
4891
cdef GEx x
4892
4892
cdef SymbolicSeries nex
0 commit comments