Skip to content
This repository was archived by the owner on Jan 30, 2023. It is now read-only.

Commit d8eec2d

Browse files
Julian Rüthsaraedum
Julian Rüth
authored andcommitted
Fixed doctests
to swap Conversion out for Coercion
1 parent 9a9e437 commit d8eec2d

22 files changed

+86
-91
lines changed

src/sage/categories/action.pyx

+2-3
Original file line numberDiff line numberDiff line change
@@ -307,9 +307,8 @@ cdef class PrecomposedAction(Action):
307307
sage: y = x.modular_symbol_rep()
308308
sage: A = y.parent().get_action(QQ, self_on_left=False, op=operator.mul)
309309
sage: A
310-
Left scalar multiplication by Rational Field on Abelian Group of all
311-
Formal Finite Sums over Rational Field
312-
with precomposition on right by Conversion map:
310+
Left scalar multiplication by Rational Field on Abelian Group of all Formal Finite Sums over Rational Field
311+
with precomposition on right by Coercion map:
313312
From: Abelian Group of all Formal Finite Sums over Integer Ring
314313
To: Abelian Group of all Formal Finite Sums over Rational Field
315314
"""

src/sage/geometry/hyperplane_arrangement/arrangement.py

+4-6
Original file line numberDiff line numberDiff line change
@@ -3102,15 +3102,13 @@ def _coerce_map_from_(self, P):
31023102
Hyperplane arrangements in 1-dimensional linear space over Real Field with 53 bits of precision with coordinate y
31033103
31043104
sage: L.coerce_map_from(ZZ)
3105-
Conversion map:
3105+
Coercion map:
31063106
From: Integer Ring
31073107
To: Hyperplane arrangements in 1-dimensional linear space over Rational Field with coordinate x
31083108
sage: M.coerce_map_from(L)
3109-
Conversion map:
3110-
From: Hyperplane arrangements in 1-dimensional linear space over
3111-
Rational Field with coordinate x
3112-
To: Hyperplane arrangements in 1-dimensional linear space over
3113-
Real Field with 53 bits of precision with coordinate y
3109+
Coercion map:
3110+
From: Hyperplane arrangements in 1-dimensional linear space over Rational Field with coordinate x
3111+
To: Hyperplane arrangements in 1-dimensional linear space over Real Field with 53 bits of precision with coordinate y
31143112
sage: L.coerce_map_from(M)
31153113
"""
31163114
if self.ambient_space().has_coerce_map_from(P):

src/sage/geometry/linear_expression.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -733,13 +733,13 @@ def _coerce_map_from_(self, P):
733733
sage: L.<x> = LinearExpressionModule(QQ)
734734
sage: M.<y> = LinearExpressionModule(ZZ)
735735
sage: L.coerce_map_from(M)
736-
Conversion map:
736+
Coercion map:
737737
From: Module of linear expressions in variable y over Integer Ring
738738
To: Module of linear expressions in variable x over Rational Field
739739
sage: M.coerce_map_from(L)
740740
741741
sage: M.coerce_map_from(ZZ)
742-
Conversion map:
742+
Coercion map:
743743
From: Integer Ring
744744
To: Module of linear expressions in variable y over Integer Ring
745745
sage: M.coerce_map_from(QQ)

src/sage/geometry/polyhedron/parent.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -647,7 +647,7 @@ def _get_action_(self, other, op, self_is_left):
647647
Right action by Integer Ring on Polyhedra in ZZ^2
648648
sage: PZZ2.get_action(QQ)
649649
Right action by Rational Field on Polyhedra in QQ^2
650-
with precomposition on left by Conversion map:
650+
with precomposition on left by Coercion map:
651651
From: Polyhedra in ZZ^2
652652
To: Polyhedra in QQ^2
653653
with precomposition on right by Identity endomorphism of Rational Field

src/sage/manifolds/differentiable/tensorfield_module.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ class TensorFieldModule(UniqueRepresentation, Parent):
172172
The coercion::
173173
174174
sage: T20U.coerce_map_from(T20)
175-
Conversion map:
175+
Coercion map:
176176
From: Module T^(2,0)(M) of type-(2,0) tensors fields on the 2-dimensional differentiable manifold M
177177
To: Free module T^(2,0)(U) of type-(2,0) tensors fields on the Open subset U of the 2-dimensional differentiable manifold M
178178
@@ -651,7 +651,7 @@ class TensorFieldFreeModule(TensorFreeModule):
651651
sage: T20.has_coerce_map_from(T20U) # the reverse is not true
652652
False
653653
sage: T20U.coerce_map_from(T20)
654-
Conversion map:
654+
Coercion map:
655655
From: Free module T^(2,0)(R^3) of type-(2,0) tensors fields on the 3-dimensional differentiable manifold R^3
656656
To: Free module T^(2,0)(U) of type-(2,0) tensors fields on the Open subset U of the 3-dimensional differentiable manifold R^3
657657

src/sage/manifolds/differentiable/vectorfield_module.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ class VectorFieldModule(UniqueRepresentation, Parent):
167167
sage: XU.has_coerce_map_from(XM)
168168
True
169169
sage: XU.coerce_map_from(XM)
170-
Conversion map:
170+
Coercion map:
171171
From: Module X(M) of vector fields on the 2-dimensional differentiable manifold M
172172
To: Free module X(U) of vector fields on the Open subset U of the 2-dimensional differentiable manifold M
173173
@@ -1149,7 +1149,7 @@ class VectorFieldFreeModule(FiniteRankFreeModule):
11491149
sage: XU.has_coerce_map_from(XM)
11501150
True
11511151
sage: XU.coerce_map_from(XM)
1152-
Conversion map:
1152+
Coercion map:
11531153
From: Free module X(S^1) of vector fields on the 1-dimensional differentiable manifold S^1
11541154
To: Free module X(U) of vector fields on the Open subset U of the 1-dimensional differentiable manifold S^1
11551155

src/sage/modules/quotient_module.py

+13-13
Original file line numberDiff line numberDiff line change
@@ -275,23 +275,23 @@ def _coerce_map_from_(self, M):
275275
Composite map:
276276
From: Ambient free module of rank 2 over the principal ideal domain Integer Ring
277277
To: Vector space quotient V/W of dimension 1 over Rational Field where
278-
V: Vector space of dimension 2 over Rational Field
279-
W: Vector space of degree 2 and dimension 1 over Rational Field
280-
Basis matrix:
281-
[1 2]
282-
Defn: Conversion map:
278+
V: Vector space of dimension 2 over Rational Field
279+
W: Vector space of degree 2 and dimension 1 over Rational Field
280+
Basis matrix:
281+
[1 2]
282+
Defn: Coercion map:
283283
From: Ambient free module of rank 2 over the principal ideal domain Integer Ring
284284
To: Vector space of dimension 2 over Rational Field
285285
then
286286
Vector space morphism represented by the matrix:
287-
[ 1]
288-
[-1/2]
289-
Domain: Vector space of dimension 2 over Rational Field
290-
Codomain: Vector space quotient V/W of dimension 1 over Rational Field where
291-
V: Vector space of dimension 2 over Rational Field
292-
W: Vector space of degree 2 and dimension 1 over Rational Field
293-
Basis matrix:
294-
[1 2]
287+
[ 1]
288+
[-1/2]
289+
Domain: Vector space of dimension 2 over Rational Field
290+
Codomain: Vector space quotient V/W of dimension 1 over Rational Field where
291+
V: Vector space of dimension 2 over Rational Field
292+
W: Vector space of degree 2 and dimension 1 over Rational Field
293+
Basis matrix:
294+
[1 2]
295295
296296
Make sure :trac:`10513` is fixed (no coercion from an abstract
297297
vector space to an isomorphic quotient vector space)::

src/sage/numerical/linear_functions.pyx

+1-1
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ cdef class LinearFunctionOrConstraint(ModuleElement):
309309
sage: cm = sage.structure.element.get_coercion_model()
310310
sage: cm.explain(10, LF(1), operator.le)
311311
Coercion on left operand via
312-
Conversion map:
312+
Coercion map:
313313
From: Integer Ring
314314
To: Linear functions over Real Double Field
315315
Arithmetic performed after coercions.

src/sage/numerical/linear_tensor_element.pyx

+6-6
Original file line numberDiff line numberDiff line change
@@ -396,15 +396,15 @@ cdef class LinearTensor(ModuleElement):
396396
sage: cm = sage.structure.element.get_coercion_model()
397397
sage: cm.explain(10, lt, operator.le)
398398
Coercion on left operand via
399-
Conversion map:
399+
Coercion map:
400400
From: Integer Ring
401-
To: Tensor product of Vector space of dimension 2 over Real
401+
To: Tensor product of Vector space of dimension 2 over Real
402402
Double Field and Linear functions over Real Double Field
403403
Arithmetic performed after coercions.
404-
Result lives in Tensor product of Vector space of dimension 2 over
405-
Real Double Field and Linear functions over Real Double Field
406-
Tensor product of Vector space of dimension 2 over Real Double Field
407-
and Linear functions over Real Double Field
404+
Result lives in Tensor product of Vector space of dimension 2 over
405+
Real Double Field and Linear functions over Real Double Field +
406+
Tensor product of Vector space of dimension 2 over Real Double Field and Linear
407+
functions over Real Double Field
408408
409409
sage: operator.le(10, lt)
410410
(10.0, 10.0) <= (1.0, 2.0)*x_0

src/sage/quivers/algebra.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ def _coerce_map_from_(self, other):
350350
sage: A2 = P2.algebra(GF(3))
351351
sage: A1.coerce_map_from(A2) # indirect doctest
352352
sage: A2.coerce_map_from(A1) # indirect doctest
353-
Conversion map:
353+
Coercion map:
354354
From: Path algebra of Multi-digraph on 2 vertices over Finite Field of size 3
355355
To: Path algebra of Multi-digraph on 2 vertices over Finite Field of size 3
356356
sage: A1.coerce_map_from(ZZ) # indirect doctest
@@ -380,7 +380,7 @@ def _coerce_map_from_(self, other):
380380
::
381381
382382
sage: A2.coerce_map_from(P1)
383-
Conversion map:
383+
Coercion map:
384384
From: Partial semigroup formed by the directed paths of Multi-digraph on 2 vertices
385385
To: Path algebra of Multi-digraph on 2 vertices over Finite Field of size 3
386386
sage: a = P1(P1.arrows()[0]); a

src/sage/quivers/homspace.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -211,9 +211,9 @@ def _coerce_map_from_(self, other):
211211
sage: H1 = P.Hom(S)
212212
sage: H2 = (P/P.radical()).Hom(S)
213213
sage: H1.coerce_map_from(H2) # indirect doctest
214-
Conversion map:
215-
From: Dimension 1 QuiverHomSpace
216-
To: Dimension 1 QuiverHomSpace
214+
Coercion map:
215+
From: Dimension 1 QuiverHomSpace
216+
To: Dimension 1 QuiverHomSpace
217217
"""
218218

219219
if not isinstance(other, QuiverHomSpace):

src/sage/rings/asymptotic/growth_group_cartesian.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -630,11 +630,11 @@ def _pushout_(self, other):
630630
Growth Group QQ^x * x^ZZ * log(x)^ZZ
631631
sage: cm.discover_coercion(A, B)
632632
((map internal to coercion system -- copy before use)
633-
Conversion map:
633+
Coercion map:
634634
From: Growth Group QQ^x * x^ZZ
635635
To: Growth Group QQ^x * x^ZZ * log(x)^ZZ,
636636
(map internal to coercion system -- copy before use)
637-
Conversion map:
637+
Coercion map:
638638
From: Growth Group x^ZZ * log(x)^ZZ
639639
To: Growth Group QQ^x * x^ZZ * log(x)^ZZ)
640640
sage: cm.common_parent(A, B)

src/sage/rings/asymptotic/term_monoid.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -2903,7 +2903,7 @@ class TermWithCoefficientMonoid(GenericTermMonoid):
29032903
sage: TC_ZZ == TC_QQ or TC_ZZ is TC_QQ
29042904
False
29052905
sage: TC_QQ.coerce_map_from(TC_ZZ)
2906-
Conversion map:
2906+
Coercion map:
29072907
From: Generic Term Monoid x^ZZ with (implicit) coefficients in Rational Field
29082908
To: Generic Term Monoid x^QQ with (implicit) coefficients in Rational Field
29092909
"""
@@ -3691,7 +3691,7 @@ class ExactTermMonoid(TermWithCoefficientMonoid):
36913691
sage: ET_QQ = ExactTermMonoid(G_QQ, QQ); ET_QQ
36923692
Exact Term Monoid x^QQ with coefficients in Rational Field
36933693
sage: ET_QQ.coerce_map_from(ET_ZZ)
3694-
Conversion map:
3694+
Coercion map:
36953695
From: Exact Term Monoid x^ZZ with coefficients in Integer Ring
36963696
To: Exact Term Monoid x^QQ with coefficients in Rational Field
36973697

src/sage/rings/complex_arb.pyx

+17-17
Original file line numberDiff line numberDiff line change
@@ -272,27 +272,27 @@ class ComplexBallField(UniqueRepresentation, Field):
272272
construction functions)::
273273
274274
sage: CBF.coerce_map_from(ZZ)
275-
Conversion map:
276-
From: Integer Ring
277-
To: Complex ball field with 53 bits precision
275+
Coercion map:
276+
From: Integer Ring
277+
To: Complex ball field with 53 bits precision
278278
sage: CBF.coerce_map_from(QQ)
279-
Conversion map:
280-
From: Rational Field
281-
To: Complex ball field with 53 bits precision
279+
Coercion map:
280+
From: Rational Field
281+
To: Complex ball field with 53 bits precision
282282
283283
Various other coercions are available through real ball fields or CLF::
284284
285285
sage: CBF.coerce_map_from(RLF)
286286
Composite map:
287-
From: Real Lazy Field
288-
To: Complex ball field with 53 bits precision
289-
Defn: Conversion map:
290-
From: Real Lazy Field
291-
To: Real ball field with 53 bits precision
287+
From: Real Lazy Field
288+
To: Complex ball field with 53 bits precision
289+
Defn: Coercion map:
290+
From: Real Lazy Field
291+
To: Real ball field with 53 bits precision
292292
then
293-
Conversion map:
294-
From: Real ball field with 53 bits precision
295-
To: Complex ball field with 53 bits precision
293+
Coercion map:
294+
From: Real ball field with 53 bits precision
295+
To: Complex ball field with 53 bits precision
296296
sage: CBF.has_coerce_map_from(AA)
297297
True
298298
sage: CBF.has_coerce_map_from(QuadraticField(-1))
@@ -422,9 +422,9 @@ class ComplexBallField(UniqueRepresentation, Field):
422422
sage: CBF.coerce_map_from(CBF)
423423
Identity endomorphism of Complex ball field with 53 bits precision
424424
sage: CBF.coerce_map_from(ComplexBallField(100))
425-
Conversion map:
426-
From: Complex ball field with 100 bits precision
427-
To: Complex ball field with 53 bits precision
425+
Coercion map:
426+
From: Complex ball field with 100 bits precision
427+
To: Complex ball field with 53 bits precision
428428
sage: CBF.has_coerce_map_from(ComplexBallField(42))
429429
False
430430
sage: CBF.has_coerce_map_from(RealBallField(54))

src/sage/rings/homset.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ def _coerce_impl(self, x):
285285
Composite map:
286286
From: Multivariate Polynomial Ring in x, y over Integer Ring
287287
To: Quotient of Multivariate Polynomial Ring in x, y over Rational Field by the ideal (x^2 + y^2)
288-
Defn: Conversion map:
288+
Defn: Coercion map:
289289
From: Multivariate Polynomial Ring in x, y over Integer Ring
290290
To: Quotient of Multivariate Polynomial Ring in x, y over Rational Field by the ideal (x^2 + y^2)
291291
then
@@ -295,7 +295,7 @@ def _coerce_impl(self, x):
295295
Defn: a |--> b
296296
b |--> a
297297
then
298-
Conversion map:
298+
Coercion map:
299299
From: Multivariate Polynomial Ring in x, y over Rational Field
300300
To: Quotient of Multivariate Polynomial Ring in x, y over Rational Field by the ideal (x^2 + y^2)
301301

src/sage/rings/infinity.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1209,7 +1209,7 @@ def _coerce_map_from_(self, R):
12091209
sage: cm = get_coercion_model()
12101210
sage: cm.explain(AA(3), oo, operator.lt)
12111211
Coercion on left operand via
1212-
Conversion map:
1212+
Coercion map:
12131213
From: Algebraic Real Field
12141214
To: The Infinity Ring
12151215
Arithmetic performed after coercions.

src/sage/rings/number_field/number_field.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -2414,14 +2414,14 @@ def maximal_totally_real_subfield(self):
24142414
Defn: a0 |--> -a^27 - a^26 - a^25 - a^24 - a^23 - a^22 - a^21 - a^20 - a^19 - a^18 - a^17 - a^16 - a^15 - a^14 - a^13 - a^12 - a^11 - a^10 - a^9 - a^8 - a^7 - a^6 - a^5 - a^4 - a^3 - a^2 - 1)
24152415
sage: F.<a> = NumberField(x^3 - 2)
24162416
sage: F.maximal_totally_real_subfield()
2417-
[Rational Field, Conversion map:
2418-
From: Rational Field
2419-
To: Number Field in a with defining polynomial x^3 - 2]
2417+
[Rational Field, Coercion map:
2418+
From: Rational Field
2419+
To: Number Field in a with defining polynomial x^3 - 2]
24202420
sage: F.<a> = NumberField(x^4 - x^3 - x^2 + x + 1)
24212421
sage: F.maximal_totally_real_subfield()
2422-
[Rational Field, Conversion map:
2423-
From: Rational Field
2424-
To: Number Field in a with defining polynomial x^4 - x^3 - x^2 + x + 1]
2422+
[Rational Field, Coercion map:
2423+
From: Rational Field
2424+
To: Number Field in a with defining polynomial x^4 - x^3 - x^2 + x + 1]
24252425
sage: F.<a> = NumberField(x^4 - x^3 + 2*x^2 + x + 1)
24262426
sage: F.maximal_totally_real_subfield()
24272427
[Number Field in a1 with defining polynomial x^2 - x - 1, Ring morphism:

src/sage/rings/polynomial/multi_polynomial_libsingular.pyx

+3-3
Original file line numberDiff line numberDiff line change
@@ -471,9 +471,9 @@ cdef class MPolynomialRing_libsingular(MPolynomialRing_generic):
471471
sage: R.has_coerce_map_from(ZZ['t'])
472472
False
473473
sage: R.coerce_map_from(ZZ['x'])
474-
Conversion map:
475-
From: Univariate Polynomial Ring in x over Integer Ring
476-
To: Multivariate Polynomial Ring in x, y over Rational Field
474+
Coercion map:
475+
From: Univariate Polynomial Ring in x over Integer Ring
476+
To: Multivariate Polynomial Ring in x, y over Rational Field
477477
478478
"""
479479
base_ring = self.base_ring()

src/sage/structure/coerce.pyx

+6-6
Original file line numberDiff line numberDiff line change
@@ -1307,14 +1307,14 @@ cdef class CoercionModel_cache_maps(CoercionModel):
13071307
sage: cm = sage.structure.element.get_coercion_model()
13081308
sage: cm.coercion_maps(V, W)
13091309
(None, (map internal to coercion system -- copy before use)
1310-
Conversion map:
1311-
From: Vector space of dimension 3 over Rational Field
1312-
To: Vector space of dimension 3 over Rational Field)
1310+
Coercion map:
1311+
From: Vector space of dimension 3 over Rational Field
1312+
To: Vector space of dimension 3 over Rational Field)
13131313
sage: cm.coercion_maps(W, V)
13141314
(None, (map internal to coercion system -- copy before use)
1315-
Conversion map:
1316-
From: Vector space of dimension 3 over Rational Field
1317-
To: Vector space of dimension 3 over Rational Field)
1315+
Coercion map:
1316+
From: Vector space of dimension 3 over Rational Field
1317+
To: Vector space of dimension 3 over Rational Field)
13181318
sage: v = V([1,2,3])
13191319
sage: w = W([1,2,3])
13201320
sage: parent(v+w) is V

src/sage/structure/coerce_actions.pyx

+3-5
Original file line numberDiff line numberDiff line change
@@ -523,13 +523,11 @@ cdef class ModuleAction(Action):
523523
sage: cm = sage.structure.element.get_coercion_model()
524524
sage: cm.explain(x, 1, operator.div)
525525
Action discovered.
526-
Right inverse action by Symbolic Constants Subring on
527-
Univariate Polynomial Ring in x over Symbolic Constants Subring
528-
with precomposition on right by Conversion map:
526+
Right inverse action by Symbolic Constants Subring on Univariate Polynomial Ring in x over Symbolic Constants Subring
527+
with precomposition on right by Coercion map:
529528
From: Integer Ring
530529
To: Symbolic Constants Subring
531-
Result lives in Univariate Polynomial Ring in x over
532-
Symbolic Constants Subring
530+
Result lives in Univariate Polynomial Ring in x over Symbolic Constants Subring
533531
Univariate Polynomial Ring in x over Symbolic Constants Subring
534532
"""
535533
K = self.G._pseudo_fraction_field()

0 commit comments

Comments
 (0)