Skip to content

Commit

Permalink
Docstring edits
Browse files Browse the repository at this point in the history
"0's" and "1's" to "0s" and "1s". Some more INPUT/OUTPUT refinements.
  • Loading branch information
gmou3 committed Jun 25, 2024
1 parent 6d8aa62 commit db6bec5
Show file tree
Hide file tree
Showing 102 changed files with 511 additions and 592 deletions.
2 changes: 1 addition & 1 deletion src/sage/algebras/commutative_dga.py
Original file line number Diff line number Diff line change
Expand Up @@ -4173,7 +4173,7 @@ def exterior_algebra_basis(n, degrees):
- ``degrees`` -- iterable of integers
Return list of lists, each list representing exponents for the
corresponding generators. (So each list consists of 0's and 1's.)
corresponding generators. (So each list consists of 0s and 1s.)
EXAMPLES::
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -708,8 +708,8 @@ cdef class FreeAlgebraElement_letterplace(AlgebraElement):
INPUT:
A twosided homogeneous ideal `I` of the parent `F` of
this element, `x`.
- ``I`` -- a twosided homogeneous ideal of the parent `F` of
this element, `x`
OUTPUT: the normal form of `x` wrt. `I`
Expand Down
2 changes: 1 addition & 1 deletion src/sage/algebras/letterplace/letterplace_ideal.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ class LetterplaceIdeal(Ideal_nc):
INPUT:
- ``degbound`` (optional integer, or Infinity): If it is provided,
- ``degbound`` -- optional integer, or Infinity; if it is provided,
a Groebner basis at least out to that degree is returned. By
default, the current degree bound of the underlying ring is used.
Expand Down
2 changes: 1 addition & 1 deletion src/sage/algebras/quantum_groups/fock_space.py
Original file line number Diff line number Diff line change
Expand Up @@ -2020,7 +2020,7 @@ def _A_to_fock_basis(self, la):

# For non-interior partitions
# Construct the d's and the partition ``a``
a = list(la) + [0]*(k - 1 - len(la)) # Add 0's to get the correct length
a = list(la) + [0]*(k - 1 - len(la)) # Add 0s to get the correct length
a = [a[i] + (k - 1 - i) for i in range(k-1)] # Shift the diagram
#shifted = list(a) # Make a copy of the shifted partition in case we need it later
d = [(a[i] - a[i+1]) % n for i in range(k-2)]
Expand Down
2 changes: 1 addition & 1 deletion src/sage/algebras/quantum_matrix_coordinate_algebra.py
Original file line number Diff line number Diff line change
Expand Up @@ -983,7 +983,7 @@ def _generator_key(t):
INPUT:
a tuple (index, exponent)
- ``t`` -- tuple (index, exponent)
OUTPUT: a tuple made from the index only
Expand Down
4 changes: 2 additions & 2 deletions src/sage/algebras/steenrod/steenrod_algebra.py
Original file line number Diff line number Diff line change
Expand Up @@ -2400,7 +2400,7 @@ def Q_exp(self, *nums):
"""
if not all(x in (0, 1) for x in nums):
raise ValueError("The tuple %s should consist " % (nums,) +
"only of 0's and 1's")
"only of 0s and 1s")
else:
if self.basis_name() != 'milnor':
return self(SteenrodAlgebra(p=self.prime(),
Expand Down Expand Up @@ -4022,7 +4022,7 @@ def SteenrodAlgebra(p=2, basis='milnor', generic='auto', **kwds):
following::
sage: A2 = SteenrodAlgebra(profile=[3,2,1])
sage: B2 = SteenrodAlgebra(profile=[3,2,1,0,0]) # trailing 0's ignored
sage: B2 = SteenrodAlgebra(profile=[3,2,1,0,0]) # trailing 0s ignored
sage: A2 == B2
True
sage: C2 = SteenrodAlgebra(profile=lambda n: max(4-n, 0), truncation_type=0)
Expand Down
2 changes: 1 addition & 1 deletion src/sage/calculus/desolvers.py
Original file line number Diff line number Diff line change
Expand Up @@ -1391,7 +1391,7 @@ def desolve_system_rk4(des, vars, ics=None, ivar=None, end_points=None, step=0.1
INPUT:
input is similar to desolve_system and desolve_rk4 commands
Input is similar to ``desolve_system`` and ``desolve_rk4`` commands
- ``des`` -- right hand sides of the system
Expand Down
8 changes: 4 additions & 4 deletions src/sage/categories/finite_posets.py
Original file line number Diff line number Diff line change
Expand Up @@ -1360,10 +1360,10 @@ def panyushev_orbits(self, element_constructor=set):
INPUT:
- ``element_constructor`` (defaults to ``set``) -- a type
- ``element_constructor`` -- (default: ``set``) a type
constructor (``set``, ``tuple``, ``list``, ``frozenset``,
``iter``, etc.) which is to be applied to the antichains
before they are returned.
before they are returned
OUTPUT:
Expand Down Expand Up @@ -1422,10 +1422,10 @@ def rowmotion_orbits(self, element_constructor=set):
INPUT:
- ``element_constructor`` (defaults to ``set``) -- a type
- ``element_constructor`` -- (default: ``set``) a type
constructor (``set``, ``tuple``, ``list``, ``frozenset``,
``iter``, etc.) which is to be applied to the antichains
before they are returned.
before they are returned
OUTPUT:
Expand Down
2 changes: 1 addition & 1 deletion src/sage/categories/functor.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -629,7 +629,7 @@ def IdentityFunctor(C):
INPUT:
A category, ``C``.
- ``C`` -- a category
OUTPUT: the identity functor in ``C``
Expand Down
2 changes: 1 addition & 1 deletion src/sage/categories/map.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -1357,7 +1357,7 @@ cdef class Section(Map):
"""
INPUT:
A map.
- ``map`` -- a map
TESTS::
Expand Down
7 changes: 4 additions & 3 deletions src/sage/categories/pushout.py
Original file line number Diff line number Diff line change
Expand Up @@ -4749,7 +4749,7 @@ def construction_tower(R):
INPUT:
An object
- ``R`` -- an object
OUTPUT:
Expand Down Expand Up @@ -4788,7 +4788,8 @@ def expand_tower(tower):
INPUT:
A construction tower as returned by :func:`construction_tower`.
- ``tower`` -- a construction tower as returned by
:func:`construction_tower`
OUTPUT: a new construction tower with all the construction functors expanded
Expand Down Expand Up @@ -4826,7 +4827,7 @@ def type_to_parent(P):
INPUT:
A type
- ``P`` -- a type
OUTPUT: a Sage parent structure corresponding to the given type
Expand Down
2 changes: 1 addition & 1 deletion src/sage/categories/simplicial_sets.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ def fundamental_group(self, simplify=True):
INPUT:
- ``simplify`` (bool, optional ``True``) -- if
- ``simplify`` -- boolean (default: ``True``); if
``False``, then return a presentation of the group
in terms of generators and relations. If ``True``,
the default, simplify as much as GAP is able to.
Expand Down
23 changes: 12 additions & 11 deletions src/sage/coding/binary_code.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -1019,9 +1019,9 @@ cdef class BinaryCode:

def _word(self, coords):
"""
Considering coords as an integer in binary, think of the 0's and 1's as
coefficients of the basis given by self.matrix(). This function returns
a string representation of that word.
Considering ``coords`` as an integer in binary, think of the 0s and 1s
as coefficients of the basis given by ``self.matrix()``. This function
returns a string representation of that word.
EXAMPLES::
Expand Down Expand Up @@ -3148,14 +3148,15 @@ cdef class BinaryCodeClassifier:
- ``verbosity`` -- nonnegative integer
OUTPUT:
a tuple, (gens, labeling, size, base)
gens -- list of permutations (in list form) representing generators
of the permutation automorphism group of the code CC.
labeling -- a permutation representing the canonical labeling of the
code. mostly for internal use; entries describe the relabeling
on the columns.
size -- the order of the automorphism group.
base -- a set of cols whose action determines the action on all cols
a tuple, (gens, labeling, size, base)
- gens; list of permutations (in list form) representing generators
of the permutation automorphism group of the code CC
- labeling; a permutation representing the canonical labeling of the
code. mostly for internal use; entries describe the relabeling
on the columns.
- size; the order of the automorphism group
- base; a set of cols whose action determines the action on all cols
EXAMPLES::
Expand Down
4 changes: 2 additions & 2 deletions src/sage/coding/self_dual_codes.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@
case:
For even `m`, let `A_m` denote the `m\times m` matrix over `\GF{2}`
given by adding the all 1's matrix to the identity matrix (in
given by adding the all 1s matrix to the identity matrix (in
``MatrixSpace(GF(2),m,m)`` of course). If `M_1, ..., M_r` are square
matrices, let `diag(M_1,M_2,...,M_r)` denote the "block diagonal"
matrix with the matrices `M_i` on the diagonal and 0's elsewhere. Let
matrix with the matrices `M_i` on the diagonal and 0s elsewhere. Let
`C(m_1,...,m_r,s)` denote the linear code with generator matrix
having block form `G = (I, A)`, where
`A = diag(A_{m_1},A_{m_2},...,A_{m_r},I_s)`, for some
Expand Down
2 changes: 1 addition & 1 deletion src/sage/combinat/alternating_sign_matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -694,7 +694,7 @@ def ASM_compatible_bigger(self):
Given an `n \times n` alternating sign matrix `A`, there are as many
ASM's of size `n+1` compatible with `A` as 2 raised to the power of
the number of 1's in `A` [EKLP1992]_.
the number of 1s in `A` [EKLP1992]_.
EXAMPLES::
Expand Down
4 changes: 2 additions & 2 deletions src/sage/combinat/colored_permutations.py
Original file line number Diff line number Diff line change
Expand Up @@ -815,8 +815,8 @@ def _element_constructor_(self, x):
INPUT:
Either a list of pairs ``(color, element)``
or a pair of lists ``(colors, elements)``.
- ``x`` -- either a list of pairs ``(color, element)`` or a pair of
lists ``(colors, elements)``
TESTS::
Expand Down
8 changes: 2 additions & 6 deletions src/sage/combinat/composition_tableau.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,16 +278,12 @@ class CompositionTableaux(UniqueRepresentation, Parent):
INPUT:
Keyword arguments:
- ``size`` -- the size of the composition tableaux
- ``shape`` -- the shape of the composition tableaux
- ``max_entry`` -- the maximum entry for the composition tableaux
Positional arguments:
- The first argument is interpreted as ``size`` or ``shape`` depending on
whether it is an integer or a composition.
The first argument is interpreted as ``size`` or ``shape`` depending on
whether it is an integer or a composition.
EXAMPLES::
Expand Down
14 changes: 5 additions & 9 deletions src/sage/combinat/constellation.py
Original file line number Diff line number Diff line change
Expand Up @@ -1631,11 +1631,9 @@ def perm_invert(p):
INPUT:
a permutation of {0,..,n-1} given by a list of values
- ``p`` -- a permutation of {0,..,n-1} given by a list of values
OUTPUT:
a permutation of {0,..,n-1} given by a list of values
OUTPUT: a permutation of {0,..,n-1} given by a list of values
EXAMPLES::
Expand All @@ -1651,15 +1649,13 @@ def perm_invert(p):

def perm_conjugate(p, s):
"""
Return the conjugate of the permutation `p` by the permutation `s`.
Return the conjugate of the permutation `p` by the permutation `s`.
INPUT:
two permutations of {0,..,n-1} given by lists of values
OUTPUT:
- ``p``, ``s`` -- two permutations of {0,..,n-1} given by lists of values
a permutation of {0,..,n-1} given by a list of values
OUTPUT: a permutation of {0,..,n-1} given by a list of values
EXAMPLES::
Expand Down
4 changes: 2 additions & 2 deletions src/sage/combinat/crystals/monomial_crystals.py
Original file line number Diff line number Diff line change
Expand Up @@ -792,7 +792,7 @@ def _normalize_c(c, n):
sage: C = InfinityCrystalOfNakajimaMonomials._normalize_c(c, 2)
Traceback (most recent call last):
...
ValueError: the c matrix must have 0's on the diagonal
ValueError: the c matrix must have 0s on the diagonal
sage: c = matrix([[0,2],[-1,0]])
sage: C = InfinityCrystalOfNakajimaMonomials._normalize_c(c, 2)
Traceback (most recent call last):
Expand All @@ -811,7 +811,7 @@ def _normalize_c(c, n):
c = MS(c)
c.set_immutable()
if any(c[i,i] != 0 for i in range(n)):
raise ValueError("the c matrix must have 0's on the diagonal")
raise ValueError("the c matrix must have 0s on the diagonal")
if any(c[i,j] + c[j,i] != 1 for i in range(n) for j in range(i)):
raise ValueError("transpose entries do not sum to 1")
if any(c[i,j] < 0 or c[j,i] < 0 for i in range(n) for j in range(i)):
Expand Down
3 changes: 2 additions & 1 deletion src/sage/combinat/designs/latin_squares.py
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,8 @@ def latin_square_product(M, N, *others):
INPUT:
An arbitrary number of latin squares (greater than 2).
- ``M``, ``N``, ``*others`` -- an arbitrary number of latin squares
(greater than or equal to 2)
EXAMPLES::
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1021,7 +1021,7 @@ def product_with_parallel_classes(OA1,k,g1,g2,g1_parall,parall,check=True):
INPUT:
- ``OA1`` (an `OA(k,g_1)`
- ``OA1`` -- (an `OA(k,g_1)`
- ``k``, ``g1``, ``g2`` -- integers
Expand Down
2 changes: 1 addition & 1 deletion src/sage/combinat/dyck_word.py
Original file line number Diff line number Diff line change
Expand Up @@ -4120,7 +4120,7 @@ def random_element(self) -> DyckWord:
Return a random complete Dyck word of semilength `n`.
The algorithm is based on a classical combinatorial fact. One
chooses at random a word with `n` 0's and `n+1` 1's. One then
chooses at random a word with `n` 0s and `n+1` 1s. One then
considers every 1 as an ascending step and every 0 as a
descending step, and one finds the lowest point of the path
(with respect to a slightly tilted slope). One then cuts the
Expand Down
3 changes: 2 additions & 1 deletion src/sage/combinat/enumeration_mod_permgroup.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ cpdef int lex_cmp(ClonableIntArray v1, ClonableIntArray v2) noexcept:
INPUT:
Two instances `v_1, v_2` of :class:`~sage.structure.list_clone.ClonableIntArray`
- ``v1``, ``v2`` -- two instances of
:class:`~sage.structure.list_clone.ClonableIntArray`
OUTPUT:
Expand Down
Loading

1 comment on commit db6bec5

@kwankyu
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Otherwise lgtm.

Please sign in to comment.