@@ -1381,7 +1381,7 @@ def define(self, s):
1381
1381
sage: E = L(lambda n: s[n], valuation=0)
1382
1382
sage: X = L(s[1])
1383
1383
sage: A = L.undefined()
1384
- sage: A.define(X*E(A, check=False ))
1384
+ sage: A.define(X*E(A))
1385
1385
sage: A[:6]
1386
1386
[m[1],
1387
1387
2*m[1, 1] + m[2],
@@ -3632,7 +3632,7 @@ def exp(self):
3632
3632
P = self .parent ()
3633
3633
R = self .base_ring ()
3634
3634
coeff_stream = self ._coeff_stream
3635
- # TODO: coefficients should not be checked here, it prevents
3635
+ # coefficients must not be checked here, it prevents
3636
3636
# us from using self.define in some cases!
3637
3637
if ((not coeff_stream .is_uninitialized ())
3638
3638
and any (coeff_stream [i ] for i in range (coeff_stream ._approximate_order , 1 ))):
@@ -3685,7 +3685,7 @@ def log(self):
3685
3685
P = self .parent ()
3686
3686
R = self .base_ring ()
3687
3687
coeff_stream = self ._coeff_stream
3688
- # TODO: coefficients should not be checked here, it prevents
3688
+ # coefficients must not be checked here, it prevents
3689
3689
# us from using self.define in some cases!
3690
3690
if ((not coeff_stream .is_uninitialized ())
3691
3691
and (any (coeff_stream [i ] for i in range (coeff_stream ._approximate_order , 0 ))
@@ -3827,7 +3827,7 @@ def _im_gens_(self, codomain, im_gens, base_map=None):
3827
3827
3828
3828
return codomain (self .map_coefficients (base_map )(im_gens [0 ]))
3829
3829
3830
- def __call__ (self , g , * , check = True ):
3830
+ def __call__ (self , g ):
3831
3831
r"""
3832
3832
Return the composition of ``self`` with ``g``.
3833
3833
@@ -4221,18 +4221,18 @@ def __call__(self, g, *, check=True):
4221
4221
raise NotImplementedError ("can only compose with a lazy series" )
4222
4222
4223
4223
# Perhaps we just don't yet know if the valuation is positive
4224
- if check :
4225
- if g ._coeff_stream ._approximate_order <= 0 :
4226
- if any (g ._coeff_stream [i ] for i in range (g ._coeff_stream ._approximate_order , 1 )):
4227
- raise ValueError ("can only compose with a positive valuation series" )
4228
- g ._coeff_stream ._approximate_order = 1
4224
+ if g . _coeff_stream . _approximate_order <= 0 :
4225
+ if ( not g ._coeff_stream .is_uninitialized ()
4226
+ and any (g ._coeff_stream [i ] for i in range (g ._coeff_stream ._approximate_order , 1 ) )):
4227
+ raise ValueError ("can only compose with a positive valuation series" )
4228
+ g ._coeff_stream ._approximate_order = 1
4229
4229
4230
4230
if isinstance (g , LazyDirichletSeries ):
4231
- if check :
4232
- if g ._coeff_stream ._approximate_order == 1 :
4233
- if g ._coeff_stream [1 ] != 0 :
4234
- raise ValueError ("can only compose with a positive valuation series" )
4235
- g ._coeff_stream ._approximate_order = 2
4231
+ if g . _coeff_stream . _approximate_order == 1 :
4232
+ if ( not g ._coeff_stream .is_uninitialized ()
4233
+ and g ._coeff_stream [1 ] != 0 ) :
4234
+ raise ValueError ("can only compose with a positive valuation series" )
4235
+ g ._coeff_stream ._approximate_order = 2
4236
4236
# we assume that the valuation of self[i](g) is at least i
4237
4237
4238
4238
def coefficient (n ):
@@ -4815,7 +4815,7 @@ def _im_gens_(self, codomain, im_gens, base_map=None):
4815
4815
4816
4816
return codomain (self .map_coefficients (base_map )(* im_gens ))
4817
4817
4818
- def __call__ (self , * g , check = True ):
4818
+ def __call__ (self , * g ):
4819
4819
r"""
4820
4820
Return the composition of ``self`` with ``g``.
4821
4821
@@ -5068,18 +5068,17 @@ def __call__(self, *g, check=True):
5068
5068
g = [P (h ) for h in g ]
5069
5069
R = P ._internal_poly_ring .base_ring ()
5070
5070
5071
- if check :
5072
- for h in g :
5073
- if h ._coeff_stream ._approximate_order == 0 :
5074
- if h [0 ]:
5075
- raise ValueError ("can only compose with a positive valuation series" )
5076
- h ._coeff_stream ._approximate_order = 1
5071
+ for h in g :
5072
+ if h ._coeff_stream ._approximate_order == 0 :
5073
+ if not h ._coeff_stream .is_uninitialized () and h [0 ]:
5074
+ raise ValueError ("can only compose with a positive valuation series" )
5075
+ h ._coeff_stream ._approximate_order = 1
5077
5076
5078
- if isinstance (h , LazyDirichletSeries ):
5079
- if h ._coeff_stream ._approximate_order == 1 :
5080
- if h ._coeff_stream [1 ] != 0 :
5081
- raise ValueError ("can only compose with a positive valuation series" )
5082
- h ._coeff_stream ._approximate_order = 2
5077
+ if isinstance (h , LazyDirichletSeries ):
5078
+ if h ._coeff_stream ._approximate_order == 1 :
5079
+ if not h . _coeff_stream . is_uninitialized () and h ._coeff_stream [1 ] != 0 :
5080
+ raise ValueError ("can only compose with a positive valuation series" )
5081
+ h ._coeff_stream ._approximate_order = 2
5083
5082
5084
5083
# We now have that every element of g has a _coeff_stream
5085
5084
sorder = self ._coeff_stream ._approximate_order
@@ -5812,7 +5811,7 @@ def is_unit(self):
5812
5811
return False
5813
5812
return self [0 ].is_unit ()
5814
5813
5815
- def __call__ (self , * args , check = True ):
5814
+ def __call__ (self , * args ):
5816
5815
r"""
5817
5816
Return the composition of ``self`` with ``g``.
5818
5817
@@ -5998,10 +5997,10 @@ def __call__(self, *args, check=True):
5998
5997
P = LazySymmetricFunctions (R )
5999
5998
g = P (g )
6000
5999
6001
- if check and not (isinstance (self ._coeff_stream , Stream_exact )
6002
- and not self ._coeff_stream ._constant ):
6000
+ if not (isinstance (self ._coeff_stream , Stream_exact )
6001
+ and not self ._coeff_stream ._constant ):
6003
6002
if g ._coeff_stream ._approximate_order == 0 :
6004
- if g [0 ]:
6003
+ if not g . _coeff_stream . is_uninitialized () and g [0 ]:
6005
6004
raise ValueError ("can only compose with a positive valuation series" )
6006
6005
g ._coeff_stream ._approximate_order = 1
6007
6006
@@ -6401,7 +6400,7 @@ def coefficient(n):
6401
6400
else :
6402
6401
raise NotImplementedError ("only implemented for arity 1" )
6403
6402
6404
- def arithmetic_product (self , * args , check = True ):
6403
+ def arithmetic_product (self , * args ):
6405
6404
r"""
6406
6405
Return the arithmetic product of ``self`` with ``g``.
6407
6406
@@ -6450,9 +6449,6 @@ def arithmetic_product(self, *args, check=True):
6450
6449
6451
6450
- ``g`` -- a cycle index series having the same parent as ``self``
6452
6451
6453
- - ``check`` -- (default: ``True``) a Boolean which, when set
6454
- to ``False``, will cause input checks to be skipped
6455
-
6456
6452
OUTPUT:
6457
6453
6458
6454
The arithmetic product of ``self`` with ``g``.
@@ -6596,15 +6592,11 @@ def arithmetic_product(self, *args, check=True):
6596
6592
and not g ._coeff_stream ._constant ):
6597
6593
gs = g .symmetric_function ()
6598
6594
c += self [0 ].arithmetic_product (gs )
6599
- elif check :
6600
- raise ValueError ("can only take the arithmetic product with a positive valuation series" )
6601
6595
if g [0 ]:
6602
6596
if (isinstance (self ._coeff_stream , Stream_exact )
6603
6597
and not self ._coeff_stream ._constant ):
6604
6598
fs = self .symmetric_function ()
6605
6599
c += fs .arithmetic_product (g [0 ])
6606
- elif check :
6607
- raise ValueError ("can only take the arithmetic product with a positive valuation series" )
6608
6600
6609
6601
p = R .realization_of ().p ()
6610
6602
# TODO: does the following introduce a memory leak?
@@ -6879,7 +6871,7 @@ def __invert__(self):
6879
6871
return P .element_class (P , Stream_dirichlet_invert (self ._coeff_stream ,
6880
6872
P .is_sparse ()))
6881
6873
6882
- def __call__ (self , p , * , check = True ):
6874
+ def __call__ (self , p ):
6883
6875
r"""
6884
6876
Return the composition of ``self`` with a linear polynomial ``p``.
6885
6877
0 commit comments