Skip to content

Commit dfd5ae4

Browse files
committed
Trac #32215: fix doctest after merge
1 parent 6c3af69 commit dfd5ae4

File tree

1 file changed

+26
-25
lines changed

1 file changed

+26
-25
lines changed

src/sage/rings/asymptotic/term_monoid.py

Lines changed: 26 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -4541,34 +4541,35 @@ def __init__(self, parent, growth, coefficient, valid_from):
45414541
45424542
sage: G = MonomialGrowthGroup(ZZ, 'x');
45434543
sage: BT_QQ = TermMonoid('B', G, QQ)
4544-
sage: BT_QQ(x^3, 3, valid_from={'m': 20})
4544+
sage: BT_QQ(x^3, coefficient=3, valid_from={'m': 20})
45454545
Traceback (most recent call last):
45464546
...
45474547
ValueError: B-Term has valid_from variables defined which do
45484548
not occur in the term.
4549-
sage: BT_QQ(x^3, 0, valid_from={'x': 20})
4549+
sage: BT_QQ(x^3, coefficient=0, valid_from={'x': 20})
45504550
Traceback (most recent call last):
45514551
...
45524552
ZeroCoefficientError: Zero coefficient 0 is not allowed in
45534553
B-Term Monoid x^ZZ with coefficients in Rational Field.
45544554
45554555
sage: BT_ZZ = TermMonoid('B', G, ZZ)
4556-
sage: BT_ZZ(x, 1/2, valid_from={'x': 20})
4556+
sage: BT_ZZ(x, coefficient=1/2, valid_from={'x': 20})
45574557
Traceback (most recent call last):
45584558
...
4559-
ValueError: 1/2 is not a coefficient in B-Term Monoid x^ZZ with
4560-
coefficients in Integer Ring.
4559+
ValueError: Cannot create BTerm(x) since given coefficient 1/2 is not
4560+
valid in B-Term Monoid x^ZZ with coefficients in Integer Ring.
4561+
> *previous* TypeError: no conversion of this rational to integer
45614562
sage: B = GrowthGroup('x^ZZ * y^ZZ');
45624563
sage: x, y = B('x'), B('y')
45634564
sage: BT_ZZ = TermMonoid('B', B, ZZ)
4564-
sage: BT_ZZ(x^3, 42, valid_from={'x': 10})
4565+
sage: BT_ZZ(x^3, coefficient=42, valid_from={'x': 10})
45654566
B(42*x^3, x >= 10)
4566-
sage: BT_ZZ(x^3, 42, valid_from={'x': 10, 'y': 20})
4567+
sage: BT_ZZ(x^3, coefficient=42, valid_from={'x': 10, 'y': 20})
45674568
B(42*x^3, x >= 10, y >= 20)
4568-
sage: BT_ZZ(x^3*y^2, 42, valid_from={'x': 10})
4569+
sage: BT_ZZ(x^3*y^2, coefficient=42, valid_from={'x': 10})
45694570
Traceback (most recent call last):
45704571
ValueError: B-Term has not defined all variables which occur in the term in valid_from.
4571-
sage: BT_ZZ(x^3, 42, valid_from={'x': 10, 'z': 20})
4572+
sage: BT_ZZ(x^3, coefficient=42, valid_from={'x': 10, 'z': 20})
45724573
Traceback (most recent call last):
45734574
...
45744575
ValueError: B-Term has valid_from variables defined which do not occur in the term.
@@ -4603,12 +4604,12 @@ def _repr_(self, latex=False):
46034604
46044605
sage: G = MonomialGrowthGroup(ZZ, 'x');
46054606
sage: BT_QQ = TermMonoid('B', G, QQ)
4606-
sage: BT_QQ(x^3, 3, valid_from={'x': 20})
4607+
sage: BT_QQ(x^3, coefficient=3, valid_from={'x': 20})
46074608
B(3*x^3, x >= 20)
46084609
sage: B = GrowthGroup('x^ZZ * y^ZZ');
46094610
sage: x, y = B('x'), B('y')
46104611
sage: BT_ZZ = TermMonoid('B', B, ZZ)
4611-
sage: BT_ZZ(x^2, 4, valid_from={'x': 10, 'y': 15})
4612+
sage: BT_ZZ(x^2, coefficient=4, valid_from={'x': 10, 'y': 15})
46124613
B(4*x^2, x >= 10, y >= 15)
46134614
"""
46144615
if latex:
@@ -4634,11 +4635,11 @@ def _latex_(self):
46344635
sage: from sage.rings.asymptotic.term_monoid import DefaultTermMonoidFactory as TermMonoid
46354636
sage: G = GrowthGroup('x^ZZ'); x = G.gen()
46364637
sage: T = TermMonoid('B', G, QQ)
4637-
sage: latex(T(x, 5, valid_from={'x': 3}))
4638+
sage: latex(T(x, coefficient=5, valid_from={'x': 3}))
46384639
B_{x \ge 3}\left(5 x\right)
4639-
sage: latex(T(x^2, 3, valid_from={'x': 5}))
4640+
sage: latex(T(x^2, coefficient=3, valid_from={'x': 5}))
46404641
B_{x \ge 5}\left(3 x^{2}\right)
4641-
sage: latex(T(x^3, 6, valid_from={'x': 10}))
4642+
sage: latex(T(x^3, coefficient=6, valid_from={'x': 10}))
46424643
B_{x \ge 10}\left(6 x^{3}\right)
46434644
"""
46444645
return self._repr_(latex=True)
@@ -4668,9 +4669,9 @@ def can_absorb(self, other):
46684669
sage: from sage.rings.asymptotic.growth_group import GrowthGroup
46694670
sage: from sage.rings.asymptotic.term_monoid import DefaultTermMonoidFactory as TermMonoid
46704671
sage: BT = TermMonoid('B', GrowthGroup('x^ZZ'), QQ)
4671-
sage: t1 = BT(x^3, 3, valid_from={'x': 20})
4672-
sage: t2 = BT(x^2, 1, valid_from={'x': 10})
4673-
sage: t3 = BT(x^3, 10, valid_from={'x': 10})
4672+
sage: t1 = BT(x^3, coefficient=3, valid_from={'x': 20})
4673+
sage: t2 = BT(x^2, coefficient=1, valid_from={'x': 10})
4674+
sage: t3 = BT(x^3, coefficient=10, valid_from={'x': 10})
46744675
sage: t1.can_absorb(t2)
46754676
True
46764677
sage: t2.can_absorb(t1)
@@ -4680,7 +4681,7 @@ def can_absorb(self, other):
46804681
sage: t3.can_absorb(t1)
46814682
True
46824683
sage: ET = TermMonoid('exact', GrowthGroup('x^ZZ'), QQ)
4683-
sage: t4 = ET(x^3, 5)
4684+
sage: t4 = ET(x^3, coefficient=5)
46844685
sage: t1.can_absorb(t4)
46854686
True
46864687
@@ -4691,9 +4692,9 @@ def can_absorb(self, other):
46914692
46924693
sage: G = MonomialGrowthGroup(ZZ, 'x')
46934694
sage: BT = TermMonoid('B', G, QQ)
4694-
sage: t1 = BT(x, 3, valid_from={'x': 20})
4695-
sage: t2 = BT(x^3, 5, valid_from={'x': 5})
4696-
sage: t3 = BT(x^3, 10, valid_from={'x': 10})
4695+
sage: t1 = BT(x, coefficient=3, valid_from={'x': 20})
4696+
sage: t2 = BT(x^3, coefficient=5, valid_from={'x': 5})
4697+
sage: t3 = BT(x^3, coefficient=10, valid_from={'x': 10})
46974698
sage: t2.absorb(t1)
46984699
B(2003/400*x^3, x >= 20)
46994700
sage: t2.absorb(t3)
@@ -4721,7 +4722,7 @@ def _absorb_(self, other):
47214722
47224723
sage: G = MonomialGrowthGroup(ZZ, 'x')
47234724
sage: BT = TermMonoid('B', G, QQ)
4724-
sage: t1 = BT(x^3, 4, valid_from={'x': 10}); t2 = BT(x, 5, valid_from={'x': 20})
4725+
sage: t1 = BT(x^3, coefficient=4, valid_from={'x': 10}); t2 = BT(x, coefficient=5, valid_from={'x': 20})
47254726
sage: t1
47264727
B(4*x^3, x >= 10)
47274728
sage: t1.can_absorb(t2)
@@ -4733,7 +4734,7 @@ def _absorb_(self, other):
47334734
...
47344735
ArithmeticError: B(5*x, x >= 20) cannot absorb B(4*x^3, x >= 10)
47354736
sage: ET = TermMonoid('exact', GrowthGroup('x^ZZ'), QQ)
4736-
sage: t4 = ET(x^3, 5)
4737+
sage: t4 = ET(x^3, coefficient=5)
47374738
sage: t1.absorb(t4) # not tested, see #32229
47384739
"""
47394740
if not (self.growth >= other.growth):
@@ -4834,9 +4835,9 @@ def _create_element_(self, growth, coefficient, valid_from):
48344835
48354836
sage: G = MonomialGrowthGroup(ZZ, 'x')
48364837
sage: BT = TermMonoid('B', G, QQ)
4837-
sage: BT(x^3, 4, valid_from={'x': 10})
4838+
sage: BT(x^3, coefficient=4, valid_from={'x': 10})
48384839
B(4*x^3, x >= 10)
4839-
sage: BT(x^3, 4, valid_from=10)
4840+
sage: BT(x^3, coefficient=4, valid_from=10)
48404841
Traceback (most recent call last):
48414842
...
48424843
AttributeError: 'sage.rings.integer.Integer' object has no attribute 'keys'

0 commit comments

Comments
 (0)