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

Commit

Permalink
Fix some p-adic doctests
Browse files Browse the repository at this point in the history
  • Loading branch information
roed314 committed Nov 15, 2017
1 parent d53df12 commit e68beee
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 5 deletions.
1 change: 1 addition & 0 deletions src/sage/rings/padics/CA_template.pxi
Expand Up @@ -104,6 +104,7 @@ cdef class CAElement(pAdicTemplateElement):
sage: S.<x> = ZZ[]
sage: W.<w> = R.ext(x^2 - 5)
sage: w * (w+1) #indirect doctest
w + w^2 + O(w^40)
"""
cdef type t = type(self)
cdef CAElement ans = t.__new__(t)
Expand Down
1 change: 1 addition & 0 deletions src/sage/rings/padics/CR_template.pxi
Expand Up @@ -190,6 +190,7 @@ cdef class CRElement(pAdicTemplateElement):
sage: S.<x> = ZZ[]
sage: W.<w> = R.ext(x^2 - 5)
sage: w * (w+1) #indirect doctest
w + w^2 + O(w^41)
"""
cdef type t = type(self)
cdef type polyt
Expand Down
1 change: 1 addition & 0 deletions src/sage/rings/padics/FP_template.pxi
Expand Up @@ -184,6 +184,7 @@ cdef class FPElement(pAdicTemplateElement):
sage: S.<x> = ZZ[]
sage: W.<w> = R.ext(x^2 - 5)
sage: w * (w+1) #indirect doctest
w + w^2
"""
cdef type t = type(self)
cdef FPElement ans = t.__new__(t)
Expand Down
18 changes: 13 additions & 5 deletions src/sage/rings/padics/padic_extension_leaves.py
Expand Up @@ -212,14 +212,20 @@ def _coerce_map_from_(self, R):
EXAMPLES::
sage: R.<a> = QqCR(27)
sage: R.coerce_map_from(ZqCR(27)) # indirect doctest
sage: R.coerce_map_from(ZqCA(27)) # indirect doctest
sage: R.coerce_map_from(ZqCR(27,names='a')) # indirect doctest
Ring morphism:
From: Unramified Extension in a defined by x^3 + 2*x + 1 with capped relative precision 20 over 3-adic Ring
To: Unramified Extension in a defined by x^3 + 2*x + 1 with capped relative precision 20 over 3-adic Field
sage: R.coerce_map_from(ZqCA(27,names='a')) # indirect doctest
Ring morphism:
From: Unramified Extension in a defined by x^3 + 2*x + 1 with capped absolute precision 20 over 3-adic Ring
To: Unramified Extension in a defined by x^3 + 2*x + 1 with capped relative precision 20 over 3-adic Field
"""
if isinstance(R, UnramifiedExtensionRingCappedRelative) and R.fraction_field() is self:
from sage.rings.padics.qadic_flint_CR import pAdicCoercion_CR_frac_field
return pAdicCoercion_CR_frac_field(R, self)
if isinstance(R, UnramifiedExtensionRingCappedAbsolute) and R.fraction_field() is self:
from sage.rings.padics.qadic_flint_CR import pAdicCoercion_CA_frac_field
from sage.rings.padics.qadic_flint_CA import pAdicCoercion_CA_frac_field
return pAdicCoercion_CA_frac_field(R, self)

return super(UnramifiedExtensionFieldCappedRelative, self)._coerce_map_from_(R)
Expand Down Expand Up @@ -459,8 +465,10 @@ def _coerce_map_from_(self, R):
EXAMPLES::
sage: R.<a> = QqFP(27)
sage: R.coerce_map_from(ZqFP(27)) # indirect doctest
sage: R.coerce_map_from(ZqFP(27,names='a')) # indirect doctest
Ring morphism:
From: Unramified Extension in a defined by x^3 + 2*x + 1 with floating precision 20 over 3-adic Ring
To: Unramified Extension in a defined by x^3 + 2*x + 1 with floating precision 20 over 3-adic Field
"""
if isinstance(R, UnramifiedExtensionRingFloatingPoint) and R.fraction_field() is self:
from sage.rings.padics.qadic_flint_FP import pAdicCoercion_FP_frac_field
Expand Down

0 comments on commit e68beee

Please sign in to comment.