Skip to content

Commit 03dec7d

Browse files
author
Release Manager
committed
gh-36052: `sage.rings.{padics,valuation}`: Modularization fixes, `# needs` <!-- ^^^^^ Please provide a concise, informative and self-explanatory title. Don't put issue numbers in there, do this in the PR body below. For example, instead of "Fixes #1234" use "Introduce new method to calculate 1+1" --> <!-- Describe your changes here in detail --> <!-- Why is this change required? What problem does it solve? --> - Part of: #29705 - Cherry-picked from: #35095 <!-- If this PR resolves an open issue, please link to it here. For example "Fixes #12345". --> <!-- If your change requires a documentation PR, please link it appropriately. --> ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> <!-- If your change requires a documentation PR, please link it appropriately --> <!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> <!-- Feel free to remove irrelevant items. --> - [x] The title is concise, informative, and self-explanatory. - [ ] The description explains in detail what this PR is about. - [x] I have linked a relevant issue or discussion. - [ ] I have created tests covering the changes. - [ ] I have updated the documentation accordingly. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on - #12345: short description why this is a dependency - #34567: ... --> <!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> URL: #36052 Reported by: Matthias Köppe Reviewer(s): David Coudert, Matthias Köppe
2 parents afb74af + f08f800 commit 03dec7d

File tree

9 files changed

+174
-131
lines changed

9 files changed

+174
-131
lines changed

src/sage/rings/padics/factory.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -975,10 +975,10 @@ def Qq(q, prec=None, type='capped-rel', modulus=None, names=None,
975975
976976
2. The modulus can also be given as a **symbolic expression**. ::
977977
978-
sage: x = var('x')
979-
sage: X.<a> = Qq(27, modulus = x^3 + 2*x + 1); X.modulus()
978+
sage: x = var('x') # needs sage.symbolic
979+
sage: X.<a> = Qq(27, modulus = x^3 + 2*x + 1); X.modulus() # needs sage.symbolic
980980
(1 + O(3^20))*x^3 + O(3^20)*x^2 + (2 + O(3^20))*x + 1 + O(3^20)
981-
sage: X == R
981+
sage: X == R # needs sage.symbolic
982982
True
983983
984984
By default, the polynomial chosen is the standard lift of the
@@ -2225,10 +2225,10 @@ def Zq(q, prec=None, type='capped-rel', modulus=None, names=None,
22252225
22262226
2. The modulus can also be given as a **symbolic expression**. ::
22272227
2228-
sage: x = var('x')
2229-
sage: X.<a> = Zq(27, modulus = x^3 + 2*x + 1); X.modulus()
2228+
sage: x = var('x') # needs sage.symbolic
2229+
sage: X.<a> = Zq(27, modulus = x^3 + 2*x + 1); X.modulus() # needs sage.symbolic
22302230
(1 + O(3^20))*x^3 + O(3^20)*x^2 + (2 + O(3^20))*x + 1 + O(3^20)
2231-
sage: X == R
2231+
sage: X == R # needs sage.symbolic
22322232
True
22332233
22342234
By default, the polynomial chosen is the standard lift of the

src/sage/rings/padics/local_generic.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# sage.doctest: optional - sage.rings.padics
1+
# sage.doctest: needs sage.rings.padics
22
r"""
33
Local Generic
44

src/sage/rings/padics/local_generic_element.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# sage.doctest: optional - sage.rings.padics
1+
# sage.doctest: needs sage.rings.padics
22
"""
33
Local Generic Element
44

src/sage/rings/padics/misc.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,25 +91,25 @@ def gauss_sum(a, p, f, prec=20, factored=False, algorithm='pari', parent=None):
9191
In this example, we verify that `g_3(0) = -1`::
9292
9393
sage: from sage.rings.padics.misc import gauss_sum
94-
sage: -gauss_sum(0, 3, 1) # optional - sage.rings.padics
94+
sage: -gauss_sum(0, 3, 1) # needs sage.rings.padics
9595
1 + O(pi^40)
9696
9797
Next, we verify that `g_5(a) g_5(-a) = 5 (-1)^a`::
9898
9999
sage: from sage.rings.padics.misc import gauss_sum
100-
sage: gauss_sum(2,5,1)^2 - 5 # optional - sage.rings.padics
100+
sage: gauss_sum(2,5,1)^2 - 5 # needs sage.rings.padics
101101
O(pi^84)
102-
sage: gauss_sum(1,5,1)*gauss_sum(3,5,1) + 5 # optional - sage.rings.padics
102+
sage: gauss_sum(1,5,1)*gauss_sum(3,5,1) + 5 # needs sage.rings.padics
103103
O(pi^84)
104104
105105
Finally, we compute a non-trivial value::
106106
107107
sage: from sage.rings.padics.misc import gauss_sum
108-
sage: gauss_sum(2,13,2) # optional - sage.rings.padics
108+
sage: gauss_sum(2,13,2) # needs sage.rings.padics
109109
6*pi^2 + 7*pi^14 + 11*pi^26 + 3*pi^62 + 6*pi^74 + 3*pi^86 + 5*pi^98 +
110110
pi^110 + 7*pi^134 + 9*pi^146 + 4*pi^158 + 6*pi^170 + 4*pi^194 +
111111
pi^206 + 6*pi^218 + 9*pi^230 + O(pi^242)
112-
sage: gauss_sum(2,13,2, prec=5, factored=True) # optional - sage.rings.padics
112+
sage: gauss_sum(2,13,2, prec=5, factored=True) # needs sage.rings.padics
113113
(2, 6 + 6*13 + 10*13^2 + O(13^5))
114114
115115
.. SEEALSO::

src/sage/rings/padics/padic_base_generic.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -433,11 +433,11 @@ def plot(self, max_points=2500, **args):
433433
434434
EXAMPLES::
435435
436-
sage: Zp(3).plot()
436+
sage: Zp(3).plot() # needs sage.plot
437437
Graphics object consisting of 1 graphics primitive
438-
sage: Zp(5).plot(max_points=625)
438+
sage: Zp(5).plot(max_points=625) # needs sage.plot
439439
Graphics object consisting of 1 graphics primitive
440-
sage: Zp(23).plot(rgbcolor=(1,0,0))
440+
sage: Zp(23).plot(rgbcolor=(1,0,0)) # needs sage.plot
441441
Graphics object consisting of 1 graphics primitive
442442
"""
443443
if 'pointsize' not in args:

src/sage/rings/padics/padic_generic.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# sage.doctest: optional - sage.rings.padics
1+
# sage.doctest: needs sage.rings.padics
22
r"""
33
`p`-adic Generic
44
@@ -36,7 +36,6 @@
3636
from sage.rings.ring import PrincipalIdealDomain
3737
from sage.rings.integer import Integer
3838
from sage.rings.infinity import Infinity
39-
from sage.rings.padics.padic_printing import pAdicPrinter
4039
from sage.rings.padics.precision_error import PrecisionError
4140
from sage.misc.cachefunc import cached_method
4241
from sage.structure.richcmp import richcmp_not_equal
@@ -59,6 +58,8 @@ def __init__(self, base, p, prec, print_mode, names, element_class, category=Non
5958
6059
sage: R = Zp(17) # indirect doctest
6160
"""
61+
from sage.rings.padics.padic_printing import pAdicPrinter
62+
6263
if category is None:
6364
if self.is_field():
6465
category = Fields()
@@ -1896,6 +1897,8 @@ def local_print_mode(obj, print_options, pos=None, ram_name=None):
18961897
18971898
For more documentation see :class:`sage.structure.parent_gens.localvars`.
18981899
"""
1900+
from sage.rings.padics.padic_printing import pAdicPrinter
1901+
18991902
if isinstance(print_options, str):
19001903
print_options = {'mode': print_options}
19011904
elif not isinstance(print_options, dict):

src/sage/rings/padics/padic_lattice_element.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,11 @@
1717
sage: R3 = QpLC(2)
1818
sage: R4 = QpLF(2)
1919
20-
sage: TestSuite(R1).run(skip=['_test_teichmuller', '_test_matrix_smith']) # long time
21-
sage: TestSuite(R2).run(skip=['_test_teichmuller', '_test_matrix_smith']) # long time
22-
sage: TestSuite(R3).run(skip=['_test_teichmuller', '_test_matrix_smith']) # long time
23-
sage: TestSuite(R4).run(skip=['_test_teichmuller', '_test_matrix_smith']) # long time
20+
sage: # long time
21+
sage: TestSuite(R1).run(skip=['_test_teichmuller', '_test_matrix_smith'])
22+
sage: TestSuite(R2).run(skip=['_test_teichmuller', '_test_matrix_smith'])
23+
sage: TestSuite(R3).run(skip=['_test_teichmuller', '_test_matrix_smith'])
24+
sage: TestSuite(R4).run(skip=['_test_teichmuller', '_test_matrix_smith'])
2425
"""
2526

2627
# ****************************************************************************

0 commit comments

Comments
 (0)