Skip to content

Commit

Permalink
Docstring suggestions by kwankyu
Browse files Browse the repository at this point in the history
For commits 53dad87,  032518d, 53aa5f0, and 7ab69d4.
  • Loading branch information
gmou3 committed Jul 3, 2024
1 parent 6f1efc4 commit 4b8708e
Show file tree
Hide file tree
Showing 42 changed files with 91 additions and 89 deletions.
2 changes: 1 addition & 1 deletion src/sage/algebras/lie_algebras/nilpotent_lie_algebra.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ class FreeNilpotentLieAlgebra(NilpotentLieAlgebra_dense):
- ``R`` -- the base ring
- ``r`` -- integer; the number of generators
- ``s`` -- integer; the nilpotency step of the algebra
- ``names`` -- (optional) a string or a list of strings used to name the
- ``names`` -- (optional) string or list of strings used to name the
basis elements; if ``names`` is a string, then names for the basis
will be autogenerated as determined by the ``naming`` parameter
- ``naming`` -- (optional) a string; the naming scheme to use for
Expand Down
2 changes: 1 addition & 1 deletion src/sage/algebras/lie_algebras/quotient.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class LieQuotient_finite_dimensional_with_basis(LieAlgebraWithStructureCoefficie
- ``I`` -- an ideal or a list of generators of the ideal
- ``ambient`` -- (optional) the Lie algebra to be quotiented;
will be deduced from ``I`` if not given
- ``names`` -- (optional) a string or a list of strings;
- ``names`` -- (optional) string or list of strings;
names for the basis elements of the quotient. If ``names`` is a
string, the basis will be named ``names_1``,...,``names_n``.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1131,7 +1131,7 @@ def quotient(self, I, names=None, category=None):
INPUT:
- ``I`` -- an ideal or a list of generators of the ideal
- ``names`` -- (optional) a string or a list of strings;
- ``names`` -- (optional) string or list of strings;
names for the basis elements of the quotient. If ``names`` is a
string, the basis will be named ``names_1``,...,``names_n``.
Expand Down
2 changes: 1 addition & 1 deletion src/sage/categories/pushout.py
Original file line number Diff line number Diff line change
Expand Up @@ -1719,7 +1719,7 @@ def __init__(self, var, multi_variate=False):
"""
INPUT:
- ``var`` -- string or a list of strings
- ``var`` -- string or list of strings
- ``multi_variate`` -- boolean (default: ``False``); if ``var`` is a
string and ``True`` otherwise: If ``True``, application to a Laurent
polynomial ring yields a multivariate Laurent polynomial ring.
Expand Down
2 changes: 1 addition & 1 deletion src/sage/coding/linear_code.py
Original file line number Diff line number Diff line change
Expand Up @@ -2201,7 +2201,7 @@ class LinearCode(AbstractLinearCode):
- ``generator`` -- a generator matrix over a finite field (``G`` can be
defined over a finite ring but the matrices over that ring must have
certain attributes, such as ``rank``); or a code over a finite field
certain attributes, such as ``rank``) or a code over a finite field
- ``d`` -- (default: ``None``) the minimum distance of the code
Expand Down
2 changes: 1 addition & 1 deletion src/sage/combinat/cluster_algebra_quiver/cluster_seed.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class ClusterSeed(SageObject):
* :class:`QuiverMutationType`
* :class:`str` -- a string representing a :class:`QuiverMutationType`
* :class:`str` -- string representing a :class:`QuiverMutationType`
or a common quiver type (see Examples)
* :class:`ClusterQuiver`
Expand Down
2 changes: 1 addition & 1 deletion src/sage/combinat/cluster_algebra_quiver/quiver.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class ClusterQuiver(SageObject):
- ``data`` -- can be any of the following::
* :class:`QuiverMutationType`
* :class:`str` -- a string representing a :class:`QuiverMutationType` or a common quiver type (see Examples)
* :class:`str` -- string representing a :class:`QuiverMutationType` or a common quiver type (see Examples)
* :class:`ClusterQuiver`
* :class:`Matrix` -- a skew-symmetrizable matrix
* :class:`DiGraph` -- must be the input data for a quiver
Expand Down
2 changes: 1 addition & 1 deletion src/sage/combinat/combinat.py
Original file line number Diff line number Diff line change
Expand Up @@ -683,7 +683,7 @@ def fibonacci(n, algorithm='pari') -> Integer:
INPUT:
- ``algorithm`` -- string:
- ``algorithm`` -- string; one of
* ``'pari'`` -- (default) use the PARI C library's
:pari:`fibo` function
Expand Down
6 changes: 2 additions & 4 deletions src/sage/combinat/fully_packed_loop.py
Original file line number Diff line number Diff line change
Expand Up @@ -751,11 +751,9 @@ def plot(self, **options):
- ``link``, ``loop`` -- boolean (default: ``True``); whether to plot the links
or the loops
- ``color``, ``link_color``, ``loop_color`` -- (optional, a string or a
RGB triple)
- ``color``, ``link_color``, ``loop_color`` -- (optional) string or RGB triple
- ``colors``, ``link_colors``, ``loop_colors`` -- (optional, list) a list of
colors
- ``colors``, ``link_colors``, ``loop_colors`` -- (optional) list of colors
- ``color_map``, ``link_color_map``, ``loop_color_map`` -- (string,
optional) a name of a matplotlib color map for the link or the loop
Expand Down
2 changes: 2 additions & 0 deletions src/sage/crypto/boolean_function.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -642,7 +642,9 @@ cdef class BooleanFunction(SageObject):
INPUT:
- ``x`` -- either:
- a list: then all elements are evaluated as booleans
- an integer: then we consider its binary representation
EXAMPLES::
Expand Down
2 changes: 1 addition & 1 deletion src/sage/dynamics/arithmetic_dynamics/projective_ds.py
Original file line number Diff line number Diff line change
Expand Up @@ -3082,7 +3082,7 @@ def minimal_model(self, return_transformation=False, prime_list=None, algorithm=
- ``algorithm`` -- (optional) string; can be one of the following:
- ``check_primes`` -- (optional) boolean: this signals whether to
- ``check_primes`` -- (optional) boolean; this signals whether to
check whether each element in ``prime_list`` is a prime
* ``'BM'`` -- the Bruin-Molnar algorithm [BM2012]_
Expand Down
2 changes: 1 addition & 1 deletion src/sage/groups/raag.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ class RightAngledArtinGroup(ArtinGroup):
INPUT:
- ``G`` -- a graph
- ``names`` -- string or a list of generator names
- ``names`` -- string or list of generator names
EXAMPLES::
Expand Down
3 changes: 1 addition & 2 deletions src/sage/lfunctions/sympow.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,8 +244,7 @@ def analytic_rank(self, E):
.. note::
The analytic rank is *not* computed provably correctly in
general.
The analytic rank is *not* computed provably correctly in general.
.. note::
Expand Down
4 changes: 2 additions & 2 deletions src/sage/matrix/matrix2.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -2151,7 +2151,7 @@ cdef class Matrix(Matrix1):

INPUT:

- ``algorithm`` -- string:
- ``algorithm`` -- string; one of
- ``'df'`` -- generic O(n^4) division-free algorithm
- ``'hessenberg'`` -- use the Hessenberg form of the matrix

Expand Down Expand Up @@ -3082,7 +3082,7 @@ cdef class Matrix(Matrix1):
INPUT:

- ``var`` -- a variable name (default: ``'x'``)
- ``algorithm`` -- string:
- ``algorithm`` -- string; one of
- ``'df'`` -- generic `O(n^4)` division-free algorithm
- ``'hessenberg'`` -- use the Hessenberg form of the matrix

Expand Down
2 changes: 1 addition & 1 deletion src/sage/matrix/matrix_integer_dense_hnf.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def det_given_divisor(A, d, proof=True, stabilize=2):
- ``proof`` -- boolean (default: ``True``); compute det modulo enough primes
so that the determinant is computed provably correctly (via the
Hadamard bound). It would be VERY hard for ``det()`` to fail even
with proof=False.
when ``proof`` is ``False``.
- ``stabilize`` -- integer (default: 2); if proof = False, then compute
the determinant modulo `p` until ``stabilize`` successive modulo
determinant computations stabilize.
Expand Down
6 changes: 3 additions & 3 deletions src/sage/matrix/matrix_mod2_dense.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -1048,7 +1048,7 @@ cdef class Matrix_mod2_dense(matrix_dense.Matrix_dense): # dense or sparse
INPUT:
- ``self`` -- a mutable matrix
- ``algorithm`` -- string:
- ``algorithm`` -- string; one of
- ``'heuristic'`` -- uses M4RI and PLUQ (default)
- ``'m4ri'`` -- uses M4RI
Expand Down Expand Up @@ -2223,7 +2223,7 @@ def pluq(Matrix_mod2_dense A, algorithm='standard', int param=0):
INPUT:
- ``A`` -- matrix
- ``algorithm`` -- string:
- ``algorithm`` -- string; one of
* ``'standard'`` asymptotically fast (default)
* ``'mmpf'`` M4RI inspired
Expand Down Expand Up @@ -2287,7 +2287,7 @@ def ple(Matrix_mod2_dense A, algorithm='standard', int param=0):
INPUT:
- ``A`` -- matrix
- ``algorithm`` -- string:
- ``algorithm`` -- string; one of
- ``'standard'`` asymptotically fast (default)
- ``'russian'`` M4RI inspired
Expand Down
4 changes: 2 additions & 2 deletions src/sage/misc/package_dir.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ def read_distribution(src_file):
OUTPUT:
- a string, the name of the distribution package (``PKG``); or the empty
string if no directive was found.
A string, the name of the distribution package (``PKG``), or the empty
string if no directive was found.
EXAMPLES::
Expand Down
2 changes: 1 addition & 1 deletion src/sage/modular/modsym/space.py
Original file line number Diff line number Diff line change
Expand Up @@ -624,7 +624,7 @@ def q_expansion_basis(self, prec=None, algorithm='default'):
- ``prec`` -- integer
- ``algorithm`` -- string:
- ``algorithm`` -- string; one of
- ``'default'`` -- (default) decide which algorithm to
use based on heuristics
Expand Down
8 changes: 4 additions & 4 deletions src/sage/numerical/interactive_simplex_method.py
Original file line number Diff line number Diff line change
Expand Up @@ -1883,8 +1883,8 @@ class InteractiveLPProblemStandardForm(InteractiveLPProblem):
dual: each problem is of course dual to its own dual, this flag is mostly
for internal use and affects default variable names only
- ``objective_name`` -- string or a symbolic expression for the
objective used in dictionaries, default depends on :func:`style`
- ``objective_name`` -- string or symbolic expression for the
objective used in dictionaries (default: depends on :func:`style`)
- ``objective_constant_term`` -- (default: 0) a constant term of the
objective
Expand Down Expand Up @@ -2083,8 +2083,8 @@ def auxiliary_problem(self, objective_name=None):
INPUT:
- ``objective_name`` -- string or a symbolic expression for the
objective used in dictionaries, default depends on :func:`style`
- ``objective_name`` -- string or symbolic expression for the
objective used in dictionaries (default: depends on :func:`style`)
OUTPUT: an :class:`LP problem in standard form <InteractiveLPProblemStandardForm>`
Expand Down
2 changes: 1 addition & 1 deletion src/sage/quadratic_forms/genera/genus.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ def _local_genera(p, rank, det_val, max_scale, even):
- ``max_scale`` -- integer the maximal scale of a jordan block
- ``even`` -- ``bool``; is ignored if `p` is not `2`
- ``even`` -- boolean; ignored if `p` is not `2`
EXAMPLES::
Expand Down
2 changes: 1 addition & 1 deletion src/sage/repl/rich_output/display_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -661,7 +661,7 @@ def graphics_from_save(self, save_function, save_kwds,
passed to the save function
- ``file_extension`` -- string starting with ``'.'``; the file
extension of the graphics file. T
extension of the graphics file
- ``output_container`` -- subclass of
:class:`sage.repl.rich_output.output_basic.OutputBase`. The
Expand Down
2 changes: 1 addition & 1 deletion src/sage/rings/bernoulli_mod_p.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def verify_bernoulli_mod_p(data):
- ``data`` -- list; same format as output of :func:`bernoulli_mod_p` function
OUTPUT: bool; ``True`` if checksum passed
OUTPUT: boolean; ``True`` if checksum passed
EXAMPLES::
Expand Down
2 changes: 1 addition & 1 deletion src/sage/rings/cfinite_sequence.py
Original file line number Diff line number Diff line change
Expand Up @@ -1176,7 +1176,7 @@ def guess(self, sequence, algorithm='sage'):
INPUT:
- ``sequence`` -- list of integers
- ``algorithm`` -- string:
- ``algorithm`` -- string; one of
- ``'sage'`` -- the default is to use Sage's matrix kernel function
- ``'pari'`` -- use Pari's implementation of LLL
- ``'bm'`` -- use Sage's Berlekamp-Massey algorithm
Expand Down
2 changes: 1 addition & 1 deletion src/sage/rings/complex_arb.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -3021,7 +3021,7 @@ cdef class ComplexBall(RingElement):
INPUT:
- ``base`` -- (optional, complex ball or number) -- if ``None``, return
- ``base`` -- (optional) complex ball or number; if ``None``, return
the principal branch of the natural logarithm ``ln(self)``,
otherwise, return the general logarithm ``ln(self)/ln(base)``
Expand Down
6 changes: 3 additions & 3 deletions src/sage/rings/complex_double.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -2261,15 +2261,15 @@ cdef class ComplexDoubleElement(FieldElement):
this is a multi-valued function, and the algorithm used
affects the value returned, as follows:
- ``'pari'`` -- Call the :pari:`agm` function from the pari library.
- ``'pari'``: Call the :pari:`agm` function from the pari library.
- ``'optimal'`` -- Use the AGM sequence such that at each stage
- ``'optimal'``: Use the AGM sequence such that at each stage
`(a,b)` is replaced by `(a_1,b_1)=((a+b)/2,\pm\sqrt{ab})`
where the sign is chosen so that `|a_1-b_1| \leq |a_1+b_1|`, or
equivalently `\Re(b_1/a_1) \geq 0`. The resulting limit is
maximal among all possible values.
- ``'principal'`` -- Use the AGM sequence such that at each stage
- ``'principal'``: Use the AGM sequence such that at each stage
`(a,b)` is replaced by `(a_1,b_1)=((a+b)/2,\pm\sqrt{ab})`
where the sign is chosen so that `\Re(b_1/a_1) \geq 0` (the
so-called principal branch of the square root).
Expand Down
12 changes: 6 additions & 6 deletions src/sage/rings/function_field/function_field_polymod.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,10 +322,10 @@ def monic_integral_model(self, names=None):
INPUT:
- ``names`` -- string or a tuple of up to two strings (default:
``None``), the name of the generator of the field, and the name of
the generator of the underlying rational function field (if a tuple);
if not given, then the names are chosen automatically.
- ``names`` -- string or tuple of up to two strings (default:
``None``); the name of the generator of the field, and the name of
the generator of the underlying rational function field (if a tuple).
If not given, then the names are chosen automatically.
OUTPUT:
Expand Down Expand Up @@ -1574,9 +1574,9 @@ def change_variable_name(self, name):
INPUT:
- ``name`` -- string or a tuple consisting of a strings, the names of
- ``name`` -- string or tuple consisting of a strings; the names of
the new variables starting with a generator of this field and going
down to the rational function field.
down to the rational function field
OUTPUT:
Expand Down
5 changes: 3 additions & 2 deletions src/sage/rings/function_field/function_field_rational.py
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,8 @@ def free_module(self, base=None, basis=None, map=True):
- ``basis`` -- (ignored) a basis for the vector space
- ``map`` -- (default: ``True``), whether to return maps to and from the vector space
- ``map`` -- (default: ``True``) whether to return maps to and from the
vector space
OUTPUT:
Expand Down Expand Up @@ -788,7 +789,7 @@ def change_variable_name(self, name):
INPUT:
- ``name`` -- string or a tuple consisting of a single string, the
- ``name`` -- string or tuple consisting of a single string; the
name of the new variable
OUTPUT:
Expand Down
2 changes: 1 addition & 1 deletion src/sage/rings/integer.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -3858,7 +3858,7 @@ cdef class Integer(sage.structure.element.EuclideanDomainElement):
INPUT:
- ``algorithm`` -- string:
- ``algorithm`` -- string; one of
- ``'pari'`` -- (default) use the PARI library
Expand Down
16 changes: 9 additions & 7 deletions src/sage/rings/number_field/number_field.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ def NumberField(polynomial, name=None, check=True, names=None, embedding=None,

- ``polynomial`` -- a polynomial over `\QQ` or a number field, or a list
of such polynomials
- ``names`` (or ``name``) -- a string or a list of strings, the names of
- ``names`` (or ``name``) -- string or list of strings, the names of
the generators
- ``check`` -- boolean (default: ``True``); do type checking and
irreducibility checking
Expand Down Expand Up @@ -1049,7 +1049,7 @@ class CyclotomicFieldFactory(UniqueFactory):

- ``names`` -- name of generator (default: ``zetan``)

- ``bracket`` -- defines the brackets in the case of ``n==0``, and
- ``bracket`` -- defines the brackets in the case of `n=0`, and
is ignored otherwise. Can be any even length string, with ``'()'`` being
the default.

Expand Down Expand Up @@ -4539,8 +4539,8 @@ def class_group(self, proof=None, names='c'):

INPUT:

- ``proof`` -- if ``True`` then compute the class group provably
correctly (default); call :func:`number_field_proof` to change this
- ``proof`` -- if ``True`` (default), then compute the class group
provably correctly; call :func:`number_field_proof` to change this
default globally

- ``names`` -- names of the generators of this class group
Expand Down Expand Up @@ -4768,9 +4768,11 @@ def _S_class_group_and_units(self, S, proof=True):

- ``proof`` -- if ``False``, assume the GRH in computing the class group

OUTPUT: ``units`` -- list of generators of the unit group
OUTPUT:

- ``units``: a list of generators of the unit group

- ``clgp_gens`` -- list of generators of the `S`-class group
- ``clgp_gens`` -- a list of generators of the `S`-class group.
Each generator is represented as a pair ``(gen, order)``,
where ``gen`` is a fractional ideal of ``self`` and ``order`` is
its order in the `S`-class group.
Expand Down Expand Up @@ -6985,7 +6987,7 @@ def uniformizer(self, P, others='positive'):
- ``others`` -- either ``'positive'`` (default), in which case the
element will have nonnegative valuation at all other primes of
``self``, or ``'negative'``, in which case the element will have
nonpositive valuation at all other primes of ``self``.
nonpositive valuation at all other primes of ``self``

.. note::

Expand Down
2 changes: 1 addition & 1 deletion src/sage/rings/number_field/number_field_element.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -4897,7 +4897,7 @@ cdef class NumberFieldElement_relative(NumberFieldElement):
The current relative number field element implementation
does everything in terms of absolute polynomials.

All conversions from relative polynomials, lists, vectors, etc.,
All conversions from relative polynomials, lists, vectors, etc.
should happen in the parent.
"""
def __init__(self, parent, f):
Expand Down
Loading

0 comments on commit 4b8708e

Please sign in to comment.