Skip to content

Commit

Permalink
Docstring edits
Browse files Browse the repository at this point in the history
rest of `combinat`
  • Loading branch information
gmou3 committed Jun 11, 2024
1 parent f0445a3 commit 114c977
Show file tree
Hide file tree
Showing 106 changed files with 1,430 additions and 1,969 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ def degree_on_basis(self, i):
INPUT:
- ``i`` -- a nonnegative integer
- ``i`` -- nonnegative integer
OUTPUT: a nonnegative integer
OUTPUT: nonnegative integer
TESTS::
Expand Down
16 changes: 8 additions & 8 deletions src/sage/combinat/abstract_tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -737,8 +737,8 @@ def paths_at_depth(self, depth, path=[]):
INPUT:
- depth -- an integer
- path -- optional given path (as a list) used in the recursion
- ``depth`` -- an integer
- ``path`` -- optional given path (as a list) used in the recursion
.. WARNING::
Expand Down Expand Up @@ -790,7 +790,7 @@ def node_number_at_depth(self, depth):
INPUT:
- depth -- an integer
- ``depth`` -- an integer
.. SEEALSO::
Expand Down Expand Up @@ -2192,7 +2192,7 @@ def leaf_labels(self):

def __eq__(self, other):
"""
Test if ``self`` is equal to ``other``
Test if ``self`` is equal to ``other``.
TESTS::
Expand All @@ -2216,7 +2216,7 @@ def __eq__(self, other):

def _hash_(self):
"""
Return the hash value for ``self``
Return the hash value for ``self``.
TESTS::
Expand Down Expand Up @@ -2314,7 +2314,7 @@ def as_digraph(self):
class AbstractLabelledClonableTree(AbstractLabelledTree,
AbstractClonableTree):
"""
Abstract Labelled Clonable Tree
Abstract Labelled Clonable Tree.
This class takes care of modification for the label by the clone protocol.
Expand Down Expand Up @@ -2386,7 +2386,7 @@ def set_label(self, path, label):
INPUT:
- ``path`` -- ``None`` (default) or a path (list or tuple of children
index in the tree)
index in the tree)
- ``label`` -- any sage object
Expand Down Expand Up @@ -2432,7 +2432,7 @@ def set_label(self, path, label):

def map_labels(self, f):
"""
Apply the function `f` to the labels of ``self``
Apply the function `f` to the labels of ``self``.
This method returns a copy of ``self`` on which the function `f` has
been applied on all labels (a label `x` is replaced by `f(x)`).
Expand Down
18 changes: 9 additions & 9 deletions src/sage/combinat/affine_permutation.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class AffinePermutation(ClonableArray):

def __init__(self, parent, lst, check=True):
r"""
Initialize ``self``
Initialize ``self``.
INPUT:
Expand Down Expand Up @@ -297,7 +297,7 @@ def is_one(self) -> bool:

def reduced_word(self):
r"""
Returns a reduced word for the affine permutation.
Return a reduced word for the affine permutation.
EXAMPLES::
Expand Down Expand Up @@ -936,7 +936,7 @@ def to_bounded_partition(self, typ='decreasing', side='right'):

def to_core(self, typ='decreasing', side='right'):
r"""
Returns the core associated to the dominant element obtained by sorting
Return the core associated to the dominant element obtained by sorting
the Lehmer code.
INPUT:
Expand Down Expand Up @@ -2067,7 +2067,7 @@ def _test_enumeration(self, n=4, **options):

def weyl_group(self):
r"""
Returns the Weyl Group of the same type as ``self``.
Return the Weyl Group of the same type as ``self``.
EXAMPLES::
Expand All @@ -2079,7 +2079,7 @@ def weyl_group(self):

def classical(self):
r"""
Returns the finite permutation group.
Return the finite permutation group.
EXAMPLES::
Expand All @@ -2093,7 +2093,7 @@ def classical(self):

def cartan_type(self):
r"""
Returns the Cartan type of ``self``.
Return the Cartan type of ``self``.
EXAMPLES::
Expand All @@ -2104,7 +2104,7 @@ def cartan_type(self):

def cartan_matrix(self):
r"""
Returns the Cartan matrix of ``self``.
Return the Cartan matrix of ``self``.
EXAMPLES::
Expand Down Expand Up @@ -2192,7 +2192,7 @@ def random_element(self, n=None):

def from_word(self, w):
r"""
Builds an affine permutation from a given word.
Build an affine permutation from a given word.
Note: Already in category as ``from_reduced_word``, but this is less
typing!
Expand All @@ -2208,7 +2208,7 @@ def from_word(self, w):
@cached_method
def _an_element_(self):
r"""
Returns a Coxeter element.
Return a Coxeter element.
EXAMPLES::
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 @@ -1027,7 +1027,7 @@ class AlternatingSignMatrices(UniqueRepresentation, Parent):
INPUT:
- `n` -- integer; the size of the matrices
- ``n`` -- integer; the size of the matrices
EXAMPLES:
Expand Down
2 changes: 1 addition & 1 deletion src/sage/combinat/baxter_permutations.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def __init__(self, n):

def _repr_(self):
"""
Return a string representation of ``self``
Return a string representation of ``self``.
EXAMPLES::
Expand Down
12 changes: 6 additions & 6 deletions src/sage/combinat/binary_tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -1591,7 +1591,7 @@ def to_tilting(self):
method provides the coordinates of this depiction, with the
root as the top-left vertex.
OUTPUT: a list of pairs of integers
OUTPUT: list of pairs of integers
Every vertex of the binary tree is mapped to a pair of
integers. The conventions are the following. The root has
Expand Down Expand Up @@ -2524,10 +2524,10 @@ def comb(self, side='left'):
INPUT:
- ``side`` -- (default: 'left') set to 'left' to obtain a left
- ``side`` -- (default: ``'left'``) set to 'left' to obtain a left
comb, and to 'right' to obtain a right comb.
OUTPUT: a list of binary trees
OUTPUT: list of binary trees
.. SEEALSO::
Expand Down Expand Up @@ -2664,7 +2664,7 @@ def twisting_number(self):
composing it. A left (resp. right) branch is maximal if it is not
included in a strictly longer left (resp. right) branch.
OUTPUT: a list of two integers
OUTPUT: list of two integers
EXAMPLES::
Expand Down Expand Up @@ -4225,7 +4225,7 @@ def _an_element_(self):

def cardinality(self):
"""
The cardinality of ``self``
The cardinality of ``self``.
This is a Catalan number.
Expand Down Expand Up @@ -4474,7 +4474,7 @@ def _an_element_(self):

def cardinality(self):
r"""
The cardinality of ``self``
The cardinality of ``self``.
This is a Catalan number.
Expand Down
4 changes: 2 additions & 2 deletions src/sage/combinat/cartesian_product.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ def __repr__(self):

def cardinality(self):
r"""
Returns the number of elements in the Cartesian product of
Return the number of elements in the Cartesian product of
everything in \*iters.
EXAMPLES::
Expand Down Expand Up @@ -225,7 +225,7 @@ def __len__(self):

def list(self):
"""
Returns
Return.
EXAMPLES::
Expand Down
2 changes: 1 addition & 1 deletion src/sage/combinat/cluster_complex.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def cluster(self):

def upper_cluster(self):
"""
Return the part of the cluster that contains positive roots
Return the part of the cluster that contains positive roots.
EXAMPLES::
Expand Down
6 changes: 3 additions & 3 deletions src/sage/combinat/combinat.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ def bell_number(n, algorithm='flint', **options) -> Integer:
- ``n`` -- a positive integer
- ``algorithm`` -- (Default: ``'flint'``) any one of the following:
- ``algorithm`` -- (default: ``'flint'``) any one of the following:
- ``'dobinski'`` -- use Dobinski's formula implemented in Sage
Expand Down Expand Up @@ -863,7 +863,7 @@ def stirling_number1(n, k, algorithm='gap') -> Integer:
- ``k`` -- nonnegative machine-size integer
- ``algorithm``:
* ``'gap'`` (default) -- use GAP's ``Stirling1`` function
* ``'gap'`` -- default; use GAP's ``Stirling1`` function
* ``'flint'`` -- use flint's ``arith_stirling_number_1u`` function
EXAMPLES::
Expand Down Expand Up @@ -917,7 +917,7 @@ def stirling_number2(n, k, algorithm=None) -> Integer:
- ``k`` -- nonnegative machine-size integer
- ``algorithm``:
* ``None`` (default) -- use native implementation
* ``None`` -- default; use native implementation
* ``'flint'`` -- use flint's ``arith_stirling_number_2`` function
* ``'gap'`` -- use GAP's ``Stirling2`` function
* ``'maxima'`` -- use Maxima's ``stirling2`` function
Expand Down
6 changes: 3 additions & 3 deletions src/sage/combinat/combinatorial_map.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@

def combinatorial_map_trivial(f=None, order=None, name=None):
r"""
Combinatorial map decorator
Combinatorial map decorator.
See :ref:`sage.combinat.combinatorial_map` for a description of
this decorator and its purpose. This default implementation does
Expand Down Expand Up @@ -332,7 +332,7 @@ def unbounded_map(self):

def order(self):
"""
Returns the order of ``self``, or ``None`` if the order is not known.
Return the order of ``self``, or ``None`` if the order is not known.
EXAMPLES::
Expand All @@ -351,7 +351,7 @@ def order(self):

def name(self):
"""
Returns the name of a combinatorial map.
Return the name of a combinatorial map.
This is used for the string representation of ``self``.
EXAMPLES::
Expand Down
4 changes: 2 additions & 2 deletions src/sage/combinat/composition.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@

class Composition(CombinatorialElement):
r"""
Integer compositions
Integer compositions.
A composition of a nonnegative integer `n` is a list
`(i_1, \ldots, i_k)` of positive integers with total sum `n`.
Expand Down Expand Up @@ -1136,7 +1136,7 @@ def descents(self, final_descent=False) -> list:
INPUT:
- ``final_descent`` -- (Default: ``False``) a boolean integer
- ``final_descent`` -- boolean (default: ``False``)
OUTPUT:
Expand Down
2 changes: 1 addition & 1 deletion src/sage/combinat/composition_tableau.py
Original file line number Diff line number Diff line change
Expand Up @@ -580,7 +580,7 @@ class CompositionTableaux_size(CompositionTableaux):

def __init__(self, n, max_entry=None):
r"""
Initializes the class of composition tableaux of size ``n``.
Initialize the class of composition tableaux of size `n`.
TESTS::
Expand Down
8 changes: 4 additions & 4 deletions src/sage/combinat/constellation.py
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ def connected_components(self):
"""
Return the connected components.
OUTPUT: a list of connected constellations
OUTPUT: list of connected constellations
EXAMPLES::
Expand Down Expand Up @@ -1517,13 +1517,13 @@ def perms_sym_init(g, sym=None):

def perms_are_connected(g, n):
"""
Checks that the action of the generated group is transitive.
Check that the action of the generated group is transitive.
INPUT:
- a list of permutations of `[0, n-1]` (in a SymmetricGroup)
- ``g`` -- list of permutations of `[0, n-1]` (in a SymmetricGroup)
- an integer `n`
- ``n`` -- integer
EXAMPLES::
Expand Down
6 changes: 3 additions & 3 deletions src/sage/combinat/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ def affine_symmetric_group_action(self, w, transposition=False):
INPUT:
- ``w`` is a tuple of integers `[w_1,\ldots,w_m]` with `0\le w_j<k`.
- ``w`` -- a tuple of integers `[w_1,\ldots,w_m]` with `0\le w_j<k`
If transposition is set to be True, then `w = [w_0,w_1]` is
interpreted as a transposition `t_{w_0, w_1}`
(see :meth:`_transposition_to_reduced_word`).
Expand Down Expand Up @@ -382,7 +382,7 @@ def _transposition_to_reduced_word(self, t):
- a tuple `[r,s]` such that `r` and `s` are not equivalent mod `k`
OUTPUT: a list of integers in `\{0,1,\ldots,k-1\}` representing a
OUTPUT: list of integers in `\{0,1,\ldots,k-1\}` representing a
reduced word for the transposition `t`
EXAMPLES::
Expand Down Expand Up @@ -511,7 +511,7 @@ def strong_le(self, other):

def contains(self, other):
r"""
Checks whether ``self`` contains ``other``.
Check whether ``self`` contains ``other``.
INPUT:
Expand Down
Loading

0 comments on commit 114c977

Please sign in to comment.