@@ -575,7 +575,7 @@ def __init__(self, parent, summands, simplify=True, convert=True):
575
575
sage: G = GrowthGroup('x^ZZ'); x = G.gen()
576
576
sage: OT = TermMonoid('O', G, ZZ); ET = TermMonoid('exact', G, ZZ)
577
577
sage: R = AsymptoticRing(G, ZZ)
578
- sage: lst = [ET(x, 1), ET(x^2, 2), OT(x^3), ET(x^4, 4)]
578
+ sage: lst = [ET(x, coefficient= 1), ET(x^2, coefficient= 2), OT(x^3), ET(x^4, coefficient= 4)]
579
579
sage: expr = R(lst, simplify=False); expr # indirect doctest
580
580
4*x^4 + O(x^3) + 2*x^2 + x
581
581
sage: print(expr.summands.repr_full())
@@ -641,8 +641,10 @@ def __init__(self, parent, summands, simplify=True, convert=True):
641
641
ValueError: Cannot include 1/2 with parent
642
642
Exact Term Monoid x^QQ with coefficients in Rational Field in
643
643
Asymptotic Ring <x^QQ> over Integer Ring
644
- > *previous* ValueError: 1/2 is not a coefficient in
645
- Exact Term Monoid x^QQ with coefficients in Integer Ring.
644
+ > *previous* ValueError: Cannot create ExactTerm(1)
645
+ since given coefficient 1/2 is not valid in
646
+ Exact Term Monoid x^QQ with coefficients in Integer Ring.
647
+ >> *previous* TypeError: no conversion of this rational to integer
646
648
647
649
Check :trac:`19921`::
648
650
@@ -949,7 +951,7 @@ def _simplify_(self):
949
951
sage: G = GrowthGroup('x^ZZ')
950
952
sage: OT = TermMonoid('O', G, ZZ); ET = TermMonoid('exact', G, ZZ)
951
953
sage: R = AsymptoticRing(G, ZZ)
952
- sage: lst = [ET(x, 1), ET(x^2, 2), OT(x^3), ET(x^4, 4)]
954
+ sage: lst = [ET(x, coefficient= 1), ET(x^2, coefficient= 2), OT(x^3), ET(x^4, coefficient= 4)]
953
955
sage: expr = R(lst, simplify=False); expr # indirect doctest
954
956
4*x^4 + O(x^3) + 2*x^2 + x
955
957
sage: expr._simplify_(); expr
@@ -1079,7 +1081,9 @@ def monomial_coefficient(self, monomial):
1079
1081
ValueError: Cannot include n with parent Exact Term Monoid
1080
1082
n^QQ with coefficients in Rational Field in Asymptotic Ring
1081
1083
<m^QQ> over Rational Field
1082
- > *previous* ValueError: n is not in Growth Group m^QQ.
1084
+ > *previous* ValueError: Growth n is not valid in
1085
+ Exact Term Monoid m^QQ with coefficients in Rational Field.
1086
+ >> *previous* ValueError: n is not in Growth Group m^QQ.
1083
1087
1084
1088
Only monomials are allowed::
1085
1089
@@ -3068,8 +3072,10 @@ def map_coefficients(self, f, new_coefficient_ring=None):
3068
3072
sage: a.map_coefficients(lambda c: 1/c)
3069
3073
Traceback (most recent call last):
3070
3074
...
3071
- ValueError: ... is not a coefficient in
3075
+ ValueError: Cannot create ExactTerm(n^3) since
3076
+ given coefficient 1/2 is not valid in
3072
3077
Exact Term Monoid n^ZZ with coefficients in Integer Ring.
3078
+ > *previous* TypeError: no conversion of this rational to integer
3073
3079
"""
3074
3080
def mapping (term ):
3075
3081
T = term .parent ().change_parameter (
@@ -3078,7 +3084,7 @@ def mapping(term):
3078
3084
c = f (term .coefficient )
3079
3085
if c .is_zero ():
3080
3086
return None
3081
- return T (term .growth , c )
3087
+ return T (term .growth , coefficient = c )
3082
3088
else :
3083
3089
return T (term .growth )
3084
3090
@@ -3922,7 +3928,7 @@ def _element_constructor_(self, data, simplify=True, convert=True):
3922
3928
...
3923
3929
ValueError: Polynomial y is not in
3924
3930
Asymptotic Ring <x^ZZ> over Integer Ring
3925
- > *previous* ValueError: Growth y is not in
3931
+ > *previous* ValueError: Growth y is not valid in
3926
3932
Exact Term Monoid x^ZZ with coefficients in Integer Ring.
3927
3933
>> *previous* ValueError: y is not in Growth Group x^ZZ.
3928
3934
@@ -3965,7 +3971,7 @@ def _element_constructor_(self, data, simplify=True, convert=True):
3965
3971
...
3966
3972
ValueError: Polynomial a + c is not in
3967
3973
Asymptotic Ring <a^ZZ * b^ZZ> over Rational Field
3968
- > *previous* ValueError: Growth c is not in
3974
+ > *previous* ValueError: Growth c is not valid in
3969
3975
Exact Term Monoid a^ZZ * b^ZZ with coefficients in Rational Field.
3970
3976
>> *previous* ValueError: c is not in Growth Group a^ZZ * b^ZZ.
3971
3977
>...> *previous* ValueError: c is not in any of the factors
@@ -3983,7 +3989,9 @@ def _element_constructor_(self, data, simplify=True, convert=True):
3983
3989
ValueError: Cannot include m^3 with parent
3984
3990
Exact Term Monoid m^ZZ with coefficients in Integer Ring
3985
3991
in Asymptotic Ring <n^ZZ> over Rational Field
3986
- > *previous* ValueError: m^3 is not in Growth Group n^ZZ.
3992
+ > *previous* ValueError: Growth m^3 is not valid in
3993
+ Exact Term Monoid n^ZZ with coefficients in Rational Field.
3994
+ >> *previous* ValueError: m^3 is not in Growth Group n^ZZ.
3987
3995
3988
3996
::
3989
3997
@@ -4539,7 +4547,7 @@ def create_summand(self, type, data=None, **kwds):
4539
4547
sage: R.create_summand('O', growth=42*x^2, coefficient=1)
4540
4548
Traceback (most recent call last):
4541
4549
...
4542
- ValueError: Growth 42*x^2 is not in O-Term Monoid x^ZZ with implicit coefficients in Integer Ring.
4550
+ ValueError: Growth 42*x^2 is not valid in O-Term Monoid x^ZZ with implicit coefficients in Integer Ring.
4543
4551
> *previous* ValueError: 42*x^2 is not in Growth Group x^ZZ.
4544
4552
4545
4553
::
0 commit comments