Skip to content

Commit 04be141

Browse files
committed
doc tweaks in padics
1 parent 5188024 commit 04be141

File tree

2 files changed

+18
-12
lines changed

2 files changed

+18
-12
lines changed

src/sage/rings/padics/common_conversion.pyx

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
r"""
2+
Tools for creation of `p`-adic elements
3+
24
The functions in this file are used in creating new `p`-adic elements.
35
46
When creating a `p`-adic element, the user can specify that the absolute
@@ -49,7 +51,7 @@ cdef Rational rat_temp = PY_NEW(Rational)
4951

5052
cdef long get_ordp(x, PowComputer_class prime_pow) except? -10000:
5153
"""
52-
This function determines the valuation of the `p`-adic element
54+
Determine the valuation of the `p`-adic element
5355
that will result from the given data ``x``.
5456
5557
Note that the valuation can differ depending on the ring: if the
@@ -160,7 +162,7 @@ cdef long get_ordp(x, PowComputer_class prime_pow) except? -10000:
160162

161163
cdef long get_preccap(x, PowComputer_class prime_pow) except? -10000:
162164
"""
163-
This function determines the maximum absolute precision possible
165+
Determine the maximum absolute precision possible
164166
for an element created from the given data ``x``.
165167
166168
Note that the valuation can differ depending on the ring: if the
@@ -231,7 +233,7 @@ cdef long get_preccap(x, PowComputer_class prime_pow) except? -10000:
231233

232234
cdef long comb_prec(iprec, long prec) except? -10000:
233235
"""
234-
This function returns the minimum of iprec and prec.
236+
Return the minimum of ``iprec`` and ``prec``.
235237
236238
INPUT:
237239
@@ -255,7 +257,7 @@ cdef long comb_prec(iprec, long prec) except? -10000:
255257

256258
cdef int _process_args_and_kwds(long *aprec, long *rprec, args, kwds, bint absolute, PowComputer_class prime_pow) except -1:
257259
"""
258-
This function obtains values for absprec and relprec from a
260+
Obtain values for ``absprec`` and ``relprec`` from a
259261
combination of positional and keyword arguments.
260262
261263
When creating a `p`-adic element, the user can pass in two arguments: ``absprec`` and ``relprec``.
@@ -332,7 +334,7 @@ cdef inline long cconv_mpq_t_shared(mpz_t out, mpq_t x, long prec, bint absolute
332334
333335
OUTPUT:
334336
335-
- If ``absolute`` is False then returns the valuation that was
337+
- If ``absolute`` is ``False`` then returns the valuation that was
336338
extracted (``maxordp`` when `x = 0`).
337339
"""
338340
cdef long numval, denval
@@ -364,6 +366,8 @@ cdef inline int cconv_mpq_t_out_shared(mpq_t out, mpz_t x, long valshift, long p
364366
"""
365367
Convert the underlying `p`-adic element into a rational.
366368
369+
INPUT:
370+
367371
- ``out`` -- gives a rational approximating the input. Currently uses
368372
rational reconstruction but may change in the future to use a more naive
369373
method
@@ -447,11 +451,11 @@ cdef inline int cconv_shared(mpz_t out, x, long prec, long valshift, PowComputer
447451
else:
448452
raise NotImplementedError
449453
else:
450-
raise NotImplementedError("No conversion defined for %s which is a %s in %s"%(x,type(x),x.parent() if hasattr(x,"parent") else "no parent"))
454+
raise NotImplementedError("No conversion defined for %s which is a %s in %s" % (x, type(x), x.parent() if hasattr(x, "parent") else "no parent"))
451455

452456
cdef inline long cconv_mpz_t_shared(mpz_t out, mpz_t x, long prec, bint absolute, PowComputer_class prime_pow) except -2:
453457
"""
454-
A fast pathway for conversion of integers that doesn't require
458+
A fast pathway for conversion of integers that does not require
455459
precomputation of the valuation.
456460
457461
INPUT:
@@ -485,6 +489,8 @@ cdef inline int cconv_mpz_t_out_shared(mpz_t out, mpz_t x, long valshift, long p
485489
"""
486490
Convert the underlying `p`-adic element into an integer if possible.
487491
492+
INPUT:
493+
488494
- ``out`` -- stores the resulting integer as an integer between 0
489495
and `p^{prec + valshift}`
490496
- ``x`` -- an ``mpz_t`` giving the underlying `p`-adic element

src/sage/rings/padics/misc.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,16 @@
1414
- Ander Steele
1515
- Kiran Kedlaya (modified gauss_sum 2017/09)
1616
"""
17-
#*****************************************************************************
17+
# ****************************************************************************
1818
# Copyright (C) 2007-2013 David Roe <[email protected]>
1919
# William Stein <[email protected]>
2020
#
2121
# Distributed under the terms of the GNU General Public License (GPL)
2222
# as published by the Free Software Foundation; either version 2 of
2323
# the License, or (at your option) any later version.
2424
#
25-
# http://www.gnu.org/licenses/
26-
#*****************************************************************************
25+
# https://www.gnu.org/licenses/
26+
# ****************************************************************************
2727

2828
from sage.rings.infinity import infinity
2929

@@ -214,7 +214,7 @@ def precprint(prec_type, prec_cap, p):
214214

215215
def trim_zeros(L):
216216
r"""
217-
Strips trailing zeros/empty lists from a list.
217+
Strip trailing zeros/empty lists from a list.
218218
219219
EXAMPLES::
220220
@@ -228,7 +228,7 @@ def trim_zeros(L):
228228
sage: trim_zeros([])
229229
[]
230230
231-
Zeros are also trimmed from nested lists (one deep):
231+
Zeros are also trimmed from nested lists (one deep)::
232232
233233
sage: trim_zeros([[1,0]])
234234
[[1]]

0 commit comments

Comments
 (0)