diff --git a/src/sage/categories/examples/graded_connected_hopf_algebras_with_basis.py b/src/sage/categories/examples/graded_connected_hopf_algebras_with_basis.py index d8b7fa8855b..c994a84d2d0 100644 --- a/src/sage/categories/examples/graded_connected_hopf_algebras_with_basis.py +++ b/src/sage/categories/examples/graded_connected_hopf_algebras_with_basis.py @@ -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:: diff --git a/src/sage/combinat/abstract_tree.py b/src/sage/combinat/abstract_tree.py index d7eef45927e..c6c9d10fdf2 100644 --- a/src/sage/combinat/abstract_tree.py +++ b/src/sage/combinat/abstract_tree.py @@ -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:: @@ -790,7 +790,7 @@ def node_number_at_depth(self, depth): INPUT: - - depth -- an integer + - ``depth`` -- an integer .. SEEALSO:: @@ -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:: @@ -2216,7 +2216,7 @@ def __eq__(self, other): def _hash_(self): """ - Return the hash value for ``self`` + Return the hash value for ``self``. TESTS:: @@ -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. @@ -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 @@ -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)`). diff --git a/src/sage/combinat/affine_permutation.py b/src/sage/combinat/affine_permutation.py index 7fdeb0a67cb..2e65a280e9b 100644 --- a/src/sage/combinat/affine_permutation.py +++ b/src/sage/combinat/affine_permutation.py @@ -47,7 +47,7 @@ class AffinePermutation(ClonableArray): def __init__(self, parent, lst, check=True): r""" - Initialize ``self`` + Initialize ``self``. INPUT: @@ -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:: @@ -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: @@ -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:: @@ -2079,7 +2079,7 @@ def weyl_group(self): def classical(self): r""" - Returns the finite permutation group. + Return the finite permutation group. EXAMPLES:: @@ -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:: @@ -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:: @@ -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! @@ -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:: diff --git a/src/sage/combinat/alternating_sign_matrix.py b/src/sage/combinat/alternating_sign_matrix.py index 778ed8e2e07..9aa117868de 100644 --- a/src/sage/combinat/alternating_sign_matrix.py +++ b/src/sage/combinat/alternating_sign_matrix.py @@ -1027,7 +1027,7 @@ class AlternatingSignMatrices(UniqueRepresentation, Parent): INPUT: - - `n` -- integer; the size of the matrices + - ``n`` -- integer; the size of the matrices EXAMPLES: diff --git a/src/sage/combinat/baxter_permutations.py b/src/sage/combinat/baxter_permutations.py index 4576129b5ca..f0f31f53551 100644 --- a/src/sage/combinat/baxter_permutations.py +++ b/src/sage/combinat/baxter_permutations.py @@ -85,7 +85,7 @@ def __init__(self, n): def _repr_(self): """ - Return a string representation of ``self`` + Return a string representation of ``self``. EXAMPLES:: diff --git a/src/sage/combinat/binary_tree.py b/src/sage/combinat/binary_tree.py index 5c6ee265100..b940190e4a7 100644 --- a/src/sage/combinat/binary_tree.py +++ b/src/sage/combinat/binary_tree.py @@ -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 @@ -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:: @@ -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:: @@ -4225,7 +4225,7 @@ def _an_element_(self): def cardinality(self): """ - The cardinality of ``self`` + The cardinality of ``self``. This is a Catalan number. @@ -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. diff --git a/src/sage/combinat/cartesian_product.py b/src/sage/combinat/cartesian_product.py index ef151e55ffa..a0e6838c267 100644 --- a/src/sage/combinat/cartesian_product.py +++ b/src/sage/combinat/cartesian_product.py @@ -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:: @@ -225,7 +225,7 @@ def __len__(self): def list(self): """ - Returns + Return. EXAMPLES:: diff --git a/src/sage/combinat/cluster_complex.py b/src/sage/combinat/cluster_complex.py index bc1b9dd54d1..c99dc0df6f3 100644 --- a/src/sage/combinat/cluster_complex.py +++ b/src/sage/combinat/cluster_complex.py @@ -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:: diff --git a/src/sage/combinat/combinat.py b/src/sage/combinat/combinat.py index 7e57033a5df..8367e375e9a 100644 --- a/src/sage/combinat/combinat.py +++ b/src/sage/combinat/combinat.py @@ -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 @@ -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:: @@ -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 diff --git a/src/sage/combinat/combinatorial_map.py b/src/sage/combinat/combinatorial_map.py index 3fe38ae30b6..257d1957670 100644 --- a/src/sage/combinat/combinatorial_map.py +++ b/src/sage/combinat/combinatorial_map.py @@ -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 @@ -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:: @@ -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:: diff --git a/src/sage/combinat/composition.py b/src/sage/combinat/composition.py index ea49e2f55dc..6e5586ffecc 100644 --- a/src/sage/combinat/composition.py +++ b/src/sage/combinat/composition.py @@ -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`. @@ -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: diff --git a/src/sage/combinat/composition_tableau.py b/src/sage/combinat/composition_tableau.py index 0d67d73e03e..f0cbdaf038f 100644 --- a/src/sage/combinat/composition_tableau.py +++ b/src/sage/combinat/composition_tableau.py @@ -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:: diff --git a/src/sage/combinat/constellation.py b/src/sage/combinat/constellation.py index 403210df056..601d8e798c7 100644 --- a/src/sage/combinat/constellation.py +++ b/src/sage/combinat/constellation.py @@ -448,7 +448,7 @@ def connected_components(self): """ Return the connected components. - OUTPUT: a list of connected constellations + OUTPUT: list of connected constellations EXAMPLES:: @@ -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:: diff --git a/src/sage/combinat/core.py b/src/sage/combinat/core.py index 8fcb778ac1f..778e7f47958 100644 --- a/src/sage/combinat/core.py +++ b/src/sage/combinat/core.py @@ -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 bool: - ``L`` -- if ``cyc_act`` is ``None``: list of orbit sizes, otherwise list of objects - - ``cyc_act`` -- (default:``None``) bijective function from ``L`` to ``L`` + - ``cyc_act`` -- (default: ``None``) bijective function from ``L`` to ``L`` - - ``order`` -- (default:``None``) if set to an integer, this + - ``order`` -- (default: ``None``) if set to an integer, this cyclic order of ``cyc_act`` is used (must be an integer multiple of the order of ``cyc_act``) otherwise, the order of ``cyc_action`` is used diff --git a/src/sage/combinat/debruijn_sequence.pyx b/src/sage/combinat/debruijn_sequence.pyx index cd4c7aa5a32..d5729d9e51c 100644 --- a/src/sage/combinat/debruijn_sequence.pyx +++ b/src/sage/combinat/debruijn_sequence.pyx @@ -193,7 +193,7 @@ from sage.rings.integer_ring import ZZ class DeBruijnSequences(UniqueRepresentation, Parent): - """ + r""" Represents the De Bruijn sequences of given parameters `k` and `n`. A De Bruijn sequence of parameters `k` and `n` is defined as the shortest @@ -302,7 +302,7 @@ class DeBruijnSequences(UniqueRepresentation, Parent): def an_element(self): """ - Returns the lexicographically smallest De Bruijn sequence with the given + Return the lexicographically smallest De Bruijn sequence with the given parameters. ALGORITHM: @@ -337,7 +337,7 @@ class DeBruijnSequences(UniqueRepresentation, Parent): def cardinality(self): """ - Returns the number of distinct De Bruijn sequences for the object's + Return the number of distinct De Bruijn sequences for the object's parameters. EXAMPLES:: diff --git a/src/sage/combinat/decorated_permutation.py b/src/sage/combinat/decorated_permutation.py index ea1f06eebc8..00df5b02fdd 100644 --- a/src/sage/combinat/decorated_permutation.py +++ b/src/sage/combinat/decorated_permutation.py @@ -137,7 +137,7 @@ class DecoratedPermutations(UniqueRepresentation, Parent): INPUT: - - `n` -- integer; the size of the decorated permutations + - ``n`` -- integer; the size of the decorated permutations EXAMPLES: diff --git a/src/sage/combinat/degree_sequences.pyx b/src/sage/combinat/degree_sequences.pyx index 6a0b070a44e..4e0d282d068 100644 --- a/src/sage/combinat/degree_sequences.pyx +++ b/src/sage/combinat/degree_sequences.pyx @@ -286,7 +286,7 @@ class DegreeSequences: def __init__(self, n): r""" - Degree Sequences + Degree Sequences. An instance of this class represents the degree sequences of graphs on a given number `n` of vertices. It can be used to list and count them, as @@ -383,7 +383,7 @@ class DegreeSequences: def __repr__(self): """ - Representing the element + Representing the element. TESTS:: @@ -416,7 +416,7 @@ class DegreeSequences: cdef init(int n): """ - Initializes the memory and starts the enumeration algorithm. + Initialize the memory and starts the enumeration algorithm. """ global seq global N diff --git a/src/sage/combinat/diagram_algebras.py b/src/sage/combinat/diagram_algebras.py index a1f7de1a73a..85e4313481e 100644 --- a/src/sage/combinat/diagram_algebras.py +++ b/src/sage/combinat/diagram_algebras.py @@ -934,10 +934,10 @@ class options(GlobalOptions): The compact representation ``[A/B;pi]`` of the Brauer algebra diagram (see [GL1996]_) has the following components: - - ``A`` -- is a list of pairs of positive elements (upper row) that + - ``A`` -- a list of pairs of positive elements (upper row) that are connected, - - ``B`` -- is a list of pairs of negative elements (lower row) that + - ``B`` -- a list of pairs of negative elements (lower row) that are connected, and - ``pi`` -- is a permutation that is to be interpreted as the relative diff --git a/src/sage/combinat/e_one_star.py b/src/sage/combinat/e_one_star.py index 172213f3b11..0057b6d2262 100644 --- a/src/sage/combinat/e_one_star.py +++ b/src/sage/combinat/e_one_star.py @@ -557,8 +557,8 @@ class Patch(SageObject): INPUT: - ``faces`` -- finite iterable of faces - - ``face_contour`` -- dict (default:``None``) maps the face - type to vectors describing the contour of unit faces. If None, + - ``face_contour`` -- dict (default: ``None``); maps the face + type to vectors describing the contour of unit faces. If ``None``, defaults contour are assumed for faces of type 1, 2, 3 or 1, 2, 3. Used in plotting methods only. @@ -959,7 +959,7 @@ def occurrences_of(self, other) -> list: - ``other`` -- a Patch - OUTPUT: a list of vectors + OUTPUT: list of vectors EXAMPLES:: @@ -1004,12 +1004,12 @@ def repaint(self, cmap='Set1') -> None: - ``cmap`` -- color map (default: ``'Set1'``). It can be one of the following: - - string -- A coloring map. For available coloring map names type: + - ``string`` -- A coloring map. For available coloring map names type: ``sorted(colormaps)`` - - list -- list of colors to assign cyclically to the faces - A list of a single color colors all the faces with the same color. - - dict -- a dict of face types mapped to colors, to color the - faces according to their type. + - ``list`` -- list of colors to assign cyclically to the faces + A list of a single color colors all the faces with the same color + - ``dict`` -- a dict of face types mapped to colors, to color the + faces according to their type - ``{}``, the empty dict -- shortcut for ``{1:'red', 2:'green', 3:'blue'}``. @@ -1351,7 +1351,7 @@ class E1Star(SageObject): - ``sigma`` -- unimodular ``WordMorphism``, i.e. such that its incidence matrix has determinant `\pm 1` - - ``method`` -- 'prefix' or 'suffix' (default: 'suffix'); + - ``method`` -- 'prefix' or 'suffix' (default: ``'suffix'``); enables to use an alternative definition `E_1^*(\sigma)` substitutions, where the abelianized of the prefix` is used instead of the suffix diff --git a/src/sage/combinat/enumeration_mod_permgroup.pyx b/src/sage/combinat/enumeration_mod_permgroup.pyx index 70b05c6276b..91db90b5304 100644 --- a/src/sage/combinat/enumeration_mod_permgroup.pyx +++ b/src/sage/combinat/enumeration_mod_permgroup.pyx @@ -15,7 +15,7 @@ from sage.groups.perm_gps.permgroup_element cimport PermutationGroupElement cpdef list all_children(ClonableIntArray v, int max_part): r""" - Returns all the children of an integer vector (:class:`~sage.structure.list_clone.ClonableIntArray`) + Return all the children of an integer vector (:class:`~sage.structure.list_clone.ClonableIntArray`) ``v`` in the tree of enumeration by lexicographic order. The children of an integer vector ``v`` whose entries have the sum `n` are all integer vectors of sum `n+1` which follow ``v`` in the lexicographic order. @@ -139,7 +139,7 @@ cpdef int lex_cmp(ClonableIntArray v1, ClonableIntArray v2) noexcept: cpdef bint is_canonical(list sgs, ClonableIntArray v) except -1: r""" - Returns ``True`` if the integer vector `v` is maximal with respect to + Return ``True`` if the integer vector `v` is maximal with respect to the lexicographic order in its orbit under the action of the permutation group whose strong generating system is ``sgs``. Such vectors are said to be canonical. @@ -186,7 +186,7 @@ cpdef bint is_canonical(list sgs, ClonableIntArray v) except -1: cpdef ClonableIntArray canonical_representative_of_orbit_of(list sgs, ClonableIntArray v): r""" - Returns the maximal vector for the lexicographic order living in + Return the maximal vector for the lexicographic order living in the orbit of `v` under the action of the permutation group whose strong generating system is ``sgs``. The maximal vector is also called "canonical". Hence, this method returns the canonical @@ -232,7 +232,7 @@ cpdef ClonableIntArray canonical_representative_of_orbit_of(list sgs, ClonableIn cpdef list canonical_children(list sgs, ClonableIntArray v, int max_part): r""" - Returns the canonical children of the integer vector ``v``. This + Return the canonical children of the integer vector ``v``. This function computes all children of the integer vector ``v`` via the function :func:`all_children` and returns from this list only these which are canonicals identified via the function @@ -253,7 +253,7 @@ cpdef list canonical_children(list sgs, ClonableIntArray v, int max_part): cpdef set orbit(list sgs, ClonableIntArray v): r""" - Returns the orbit of the integer vector ``v`` under the action of the + Return the orbit of the integer vector ``v`` under the action of the permutation group whose strong generating system is ``sgs``. NOTE: diff --git a/src/sage/combinat/expnums.pyx b/src/sage/combinat/expnums.pyx index a62b9cf5ed4..7b726a990d5 100644 --- a/src/sage/combinat/expnums.pyx +++ b/src/sage/combinat/expnums.pyx @@ -7,9 +7,7 @@ AUTHORS: """ from cysignals.memory cimport check_allocarray, sig_free - from sage.libs.gmp.mpz cimport * - from sage.rings.integer cimport Integer @@ -20,13 +18,11 @@ def expnums(int n, int aa): INPUT: - - ``n`` -- C machine int - ``aa`` -- C machine int - - OUTPUT: a list of length `n` + OUTPUT: list of length `n` ALGORITHM: We use the same integer addition algorithm as GAP. This is an extension of Bell's triangle to the general case of diff --git a/src/sage/combinat/fast_vector_partitions.pyx b/src/sage/combinat/fast_vector_partitions.pyx index 1cdd5792149..82722b56136 100644 --- a/src/sage/combinat/fast_vector_partitions.pyx +++ b/src/sage/combinat/fast_vector_partitions.pyx @@ -290,7 +290,7 @@ def fast_vector_partitions(v, min_vals=None): - ``min_vals`` -- optional list of nonnegative integers, of same length as ``v`` - OUTPUT: a list of lists, each representing a vector partition of ``v`` + OUTPUT: list of lists, each representing a vector partition of ``v`` If ``min_vals`` is given, only partitions with parts ``p >= min_vals`` in the lexicographic ordering will appear. diff --git a/src/sage/combinat/finite_state_machine.py b/src/sage/combinat/finite_state_machine.py index 86d0d5f725b..09dbe197241 100644 --- a/src/sage/combinat/finite_state_machine.py +++ b/src/sage/combinat/finite_state_machine.py @@ -1023,7 +1023,7 @@ def full_group_by(l, key=None): def equal(iterator): """ - Checks whether all elements of ``iterator`` are equal. + Check whether all elements of ``iterator`` are equal. INPUT: @@ -1136,7 +1136,7 @@ def FSMWordSymbol(word): - ``word`` -- the input word - OUTPUT: a string of ``word`` + OUTPUT: string of ``word`` EXAMPLES:: @@ -1191,7 +1191,7 @@ class FSMState(SageObject): the state is reached as the last state of some input; only for final states. - - ``initial_probability`` -- (default: ``None``) The probability of + - ``initial_probability`` -- (default: ``None``) the probability of starting in this state if it is a state of a Markov chain. - ``hook`` -- (default: ``None``) A function which is called when @@ -1213,7 +1213,7 @@ class FSMState(SageObject): equivalent. Note that :meth:`Automaton.determinisation` requires that ``color`` is hashable. - - ``allow_label_None`` -- boolean (default: ``False``); If ``True`` allows + - ``allow_label_None`` -- boolean (default: ``False``); if ``True`` allows also ``None`` as label. Note that a state with label ``None`` is used in :class:`FSMProcessIterator`. @@ -1429,7 +1429,7 @@ def __lt__(self, other): INPUT: - - `other` -- a state + - ``other`` -- a state OUTPUT: boolean @@ -2350,11 +2350,7 @@ def _in_out_label_(self): """ Return the input and output of a transition as "word_in|word_out". - INPUT: - - Nothing. - - OUTPUT: a string of the input and output labels + OUTPUT: string of the input and output labels EXAMPLES:: @@ -3352,7 +3348,7 @@ def __setstate__(self, d): INPUT: - - `d` -- a dictionary + - ``d`` -- a dictionary OUTPUT: none @@ -3979,7 +3975,7 @@ def __contains__(self, item): def is_Markov_chain(self, is_zero=None): """ - Checks whether ``self`` is a Markov chain where the transition + Check whether ``self`` is a Markov chain where the transition probabilities are modeled as input labels. INPUT: @@ -5123,7 +5119,7 @@ def determine_output_alphabet(self, reset=True): INPUT: - - ``reset`` -- boolean (default: ``True``); If ``True``, then + - ``reset`` -- boolean (default: ``True``); if ``True``, then the existing output alphabet is erased, otherwise new letters are appended to the existing alphabet. @@ -5249,7 +5245,7 @@ def transitions(self, from_state=None): - ``from_state`` -- (default: ``None``) If ``from_state`` is given, then a list of transitions starting there is given. - OUTPUT: a list of all transitions + OUTPUT: list of all transitions EXAMPLES:: @@ -5309,8 +5305,6 @@ def initial_states(self): """ Return a list of all initial states. - OUTPUT: a list of all initial states - EXAMPLES:: sage: from sage.combinat.finite_state_machine import FSMState @@ -5343,8 +5337,6 @@ def final_states(self): """ Return a list of all final states. - OUTPUT: a list of all final states - EXAMPLES:: sage: from sage.combinat.finite_state_machine import FSMState @@ -6334,7 +6326,7 @@ def _iter_process_simple_(self, iterator): def add_state(self, state): """ - Adds a state to the finite state machine and returns the new + Add a state to the finite state machine and returns the new state. If the state already exists, that existing state is returned. @@ -6373,7 +6365,7 @@ def add_state(self, state): def add_states(self, states): """ - Adds several states. See add_state for more information. + Add several states. See add_state for more information. INPUT: @@ -6393,7 +6385,7 @@ def add_states(self, states): def add_transition(self, *args, **kwargs): """ - Adds a transition to the finite state machine and returns the + Add a transition to the finite state machine and returns the new transition. If the transition already exists, the return value of @@ -6482,7 +6474,7 @@ def add_transition(self, *args, **kwargs): def _add_fsm_transition_(self, t): """ - Adds a transition. + Add a transition. INPUT: @@ -6511,7 +6503,7 @@ def _add_fsm_transition_(self, t): def add_from_transition_function(self, function, initial_states=None, explore_existing_states=True): """ - Constructs a finite state machine from a transition function. + Construct a finite state machine from a transition function. INPUT: @@ -6661,7 +6653,7 @@ def add_from_transition_function(self, function, initial_states=None, def add_transitions_from_function(self, function, labels_as_input=True): """ - Adds one or more transitions if ``function(state, state)`` + Add one or more transitions if ``function(state, state)`` says that there are some. INPUT: @@ -7460,8 +7452,8 @@ def product_FiniteStateMachine(self, other, function, \ldots, B_d)`. If there is no transition from `A` to `B`, then ``function`` should raise a :class:`LookupError`. - - ``new_input_alphabet`` (optional) -- the new input alphabet - as a list. + - ``new_input_alphabet`` -- optional; the new input alphabet + as a list - ``only_accessible_components`` -- if ``True`` (default), then the result is piped through :meth:`.accessible_components`. If no @@ -8787,8 +8779,6 @@ def equivalence_classes(self): r""" Return a list of equivalence classes of states. - OUTPUT: a list of equivalence classes of states - Two states `a` and `b` are equivalent if and only if there is a bijection `\varphi` between paths starting at `a` and paths starting at `b` with the following properties: Let `p_a` be a @@ -9108,7 +9098,7 @@ def markov_chain_simplification(self): def with_final_word_out(self, letters, allow_non_final=True): """ - Constructs a new finite state machine with final output words + Construct a new finite state machine with final output words for all states by implicitly reading trailing letters until a final state is reached. @@ -9543,7 +9533,7 @@ def predecessors(self, state, valid_input=None): than `1` are used, then ``valid_input`` has to be a list of lists. - OUTPUT: a list of states + OUTPUT: list of states EXAMPLES:: @@ -12817,9 +12807,7 @@ class _FSMTapeCache_(SageObject): corresponding input track. If ``False`` input-words are interpreted as an iterable of letters. - OUTPUT: - - A tape-cache. + OUTPUT: a tape-cache TESTS:: @@ -13093,7 +13081,7 @@ def preview_word(self, track_number=None, length=1, return_word=False): INPUT: - - ``track_number`` -- integer (default: ``None``); If ``None``, + - ``track_number`` -- integer (default: ``None``); if ``None``, then a tuple of words (one from each track) is returned - ``length`` -- (default: ``1``) the length of the word(s) @@ -13573,7 +13561,7 @@ def tupleofwords_to_wordoftuples(tupleofwords): - ``tupleofwords`` -- a tuple of a list of letters - OUTPUT: a list of tuples + OUTPUT: list of tuples Missing letters in the words are padded with the letter ``None`` (from the empty word). @@ -14433,8 +14421,8 @@ def preview_word(self, track_number=None, length=1, return_word=False): INPUT: - - ``track_number`` -- integer (default: ``None``); If ``None``, then - a tuple of words (one from each track) is returned. + - ``track_number`` -- integer (default: ``None``); if ``None``, then + a tuple of words (one from each track) is returned - ``length`` -- (default: ``1``) the length of the word(s) diff --git a/src/sage/combinat/finite_state_machine_generators.py b/src/sage/combinat/finite_state_machine_generators.py index a397a8fc0eb..edad48de4c0 100644 --- a/src/sage/combinat/finite_state_machine_generators.py +++ b/src/sage/combinat/finite_state_machine_generators.py @@ -359,16 +359,14 @@ class TransducerGenerators: def Identity(self, input_alphabet): """ - Returns the identity transducer realizing the identity map. + Return the identity transducer realizing the identity map. INPUT: - ``input_alphabet`` -- list or other iterable - OUTPUT: - - A transducer mapping each word over ``input_alphabet`` to - itself. + OUTPUT: a transducer mapping each word over ``input_alphabet`` to + itself EXAMPLES:: @@ -397,7 +395,7 @@ def Identity(self, input_alphabet): def CountSubblockOccurrences(self, block, input_alphabet): r""" - Returns a transducer counting the number of (possibly + Return a transducer counting the number of (possibly overlapping) occurrences of a block in the input. INPUT: @@ -605,7 +603,7 @@ def map(self, f, input_alphabet): def operator(self, operator, input_alphabet, number_of_operands=2): r""" - Returns a transducer which realizes an operation + Return a transducer which realizes an operation on tuples over the given input alphabet. INPUT: @@ -687,7 +685,7 @@ def transition_function(state, operands): def all(self, input_alphabet, number_of_operands=2): r""" - Returns a transducer which realizes logical ``and`` over the given + Return a transducer which realizes logical ``and`` over the given input alphabet. INPUT: @@ -738,7 +736,7 @@ def all(self, input_alphabet, number_of_operands=2): def any(self, input_alphabet, number_of_operands=2): r""" - Returns a transducer which realizes logical ``or`` over the given + Return a transducer which realizes logical ``or`` over the given input alphabet. INPUT: @@ -789,7 +787,7 @@ def any(self, input_alphabet, number_of_operands=2): def add(self, input_alphabet, number_of_operands=2): r""" - Returns a transducer which realizes addition on pairs over the + Return a transducer which realizes addition on pairs over the given input alphabet. INPUT: @@ -843,7 +841,7 @@ def add(self, input_alphabet, number_of_operands=2): def sub(self, input_alphabet): r""" - Returns a transducer which realizes subtraction on pairs over + Return a transducer which realizes subtraction on pairs over the given input alphabet. INPUT: @@ -882,7 +880,7 @@ def sub(self, input_alphabet): def weight(self, input_alphabet, zero=0): r""" - Returns a transducer which realizes the Hamming weight of the input + Return a transducer which realizes the Hamming weight of the input over the given input alphabet. INPUT: @@ -948,7 +946,7 @@ def weight(state, input): def abs(self, input_alphabet): r""" - Returns a transducer which realizes the letter-wise + Return a transducer which realizes the letter-wise absolute value of an input word over the given input alphabet. INPUT: @@ -982,7 +980,7 @@ def abs(self, input_alphabet): def GrayCode(self): """ - Returns a transducer converting the standard binary + Return a transducer converting the standard binary expansion to Gray code. INPUT: diff --git a/src/sage/combinat/fqsym.py b/src/sage/combinat/fqsym.py index a3898280fc6..a41bb68ead6 100644 --- a/src/sage/combinat/fqsym.py +++ b/src/sage/combinat/fqsym.py @@ -800,9 +800,7 @@ def _G_to_F_on_basis(self, w): - ``w`` -- a permutation - OUTPUT: - - - An element of the F basis + OUTPUT: an element of the F basis TESTS:: @@ -832,9 +830,7 @@ def _F_to_G_on_basis(self, w): - ``w`` -- a permutation - OUTPUT: - - - An element of the G basis + OUTPUT: an element of the G basis TESTS:: @@ -911,10 +907,10 @@ def __init__(self, alg): F = self.realization_of().F() phi = F.module_morphism(self._F_to_M_on_basis, codomain=self, - unitriangular="lower") + unitriangular='lower') phi.register_as_coercion() phi_i = self.module_morphism(self._M_to_F_on_basis, codomain=F, - unitriangular="lower") + unitriangular='lower') phi_i.register_as_coercion() def _element_constructor_(self, x): @@ -1018,9 +1014,7 @@ def _F_to_M_on_basis(self, w): - ``w`` -- a permutation - OUTPUT: - - - An element of the M basis + OUTPUT: an element of the M basis TESTS:: @@ -1047,9 +1041,7 @@ def _M_to_F_on_basis(self, w): - ``w`` -- a permutation - OUTPUT: - - - An element of the F basis + OUTPUT: an element of the F basis ALGORITHM: @@ -1238,7 +1230,7 @@ class FQSymBases(Category_realization_of_parent): def __init__(self, base): r""" - Initialize the bases of an `FQSym` + Initialize the bases of an `FQSym`. INPUT: diff --git a/src/sage/combinat/free_dendriform_algebra.py b/src/sage/combinat/free_dendriform_algebra.py index 900b9a7ca5d..6f320ff00c2 100644 --- a/src/sage/combinat/free_dendriform_algebra.py +++ b/src/sage/combinat/free_dendriform_algebra.py @@ -224,11 +224,11 @@ def _repr_(self): def gen(self, i): r""" - Return the ``i``-th generator of the algebra. + Return the `i`-th generator of the algebra. INPUT: - - ``i`` -- an integer + - ``i`` -- integer EXAMPLES:: diff --git a/src/sage/combinat/free_module.py b/src/sage/combinat/free_module.py index 821d53849fd..9a7d00ad77e 100644 --- a/src/sage/combinat/free_module.py +++ b/src/sage/combinat/free_module.py @@ -35,13 +35,13 @@ class CombinatorialFreeModule(UniqueRepresentation, Module, IndexedGenerators): r""" - Class for free modules with a named basis + Class for free modules with a named basis. INPUT: - ``R`` -- base ring - - ``basis_keys`` -- list, tuple, family, set, etc. defining the + - ``basis_keys`` -- list; tuple, family, set, etc. defining the indexing set for the basis of this module - ``element_class`` -- the class of which elements of this module @@ -226,8 +226,8 @@ class CombinatorialFreeModule(UniqueRepresentation, Module, IndexedGenerators): involves comparison by equality (not identity). Hence, the last line of the following example used to fail with an assertion error:: - sage: F = CombinatorialFreeModule(ZZ, [1,2,3], prefix="F") - sage: G = CombinatorialFreeModule(ZZ, [1,2,3,4], prefix="G") + sage: F = CombinatorialFreeModule(ZZ, [1,2,3], prefix='F') + sage: G = CombinatorialFreeModule(ZZ, [1,2,3,4], prefix='G') sage: f = F.monomial(1) + 2 * F.monomial(2) sage: g = 2*G.monomial(3) + G.monomial(4) sage: tensor([f, g]) @@ -1158,7 +1158,7 @@ def sum_of_terms(self, terms, distinct=False): INPUT: - - ``terms`` -- a list (or iterable) of pairs ``(index, coeff)`` + - ``terms`` -- list (or iterable) of pairs ``(index, coeff)`` - ``distinct`` -- boolean (default: ``False``); whether the indices are guaranteed to be distinct @@ -1212,10 +1212,10 @@ def _from_dict(self, d, coerce=False, remove_zeros=True): the index of a basis element and each ``coeff`` belongs to the coefficient ring ``self.base_ring()`` - - ``coerce`` -- a boolean (default: ``False``), whether to coerce + - ``coerce`` -- boolean (default: ``False``); whether to coerce the coefficients ``coeff`` to the coefficient ring - - ``remove_zeros`` -- a boolean (default: ``True``), if some + - ``remove_zeros`` -- boolean (default: ``True``); if some coefficients ``coeff`` may be zero and should therefore be removed EXAMPLES:: @@ -1264,7 +1264,7 @@ def _from_dict(self, d, coerce=False, remove_zeros=True): class CombinatorialFreeModule_Tensor(CombinatorialFreeModule): """ - Tensor Product of Free Modules + Tensor Product of Free Modules. EXAMPLES: @@ -1441,7 +1441,7 @@ def _ascii_art_(self, term): TESTS:: sage: R = NonCommutativeSymmetricFunctions(QQ).R() # needs sage.combinat - sage: Partitions.options(diagram_str="#", convention="french") # needs sage.combinat + sage: Partitions.options(diagram_str='#', convention='french') # needs sage.combinat sage: s = ascii_art(tensor((R[1,2], R[3,1,2]))); s # needs sage.combinat R # R # ### @@ -1470,7 +1470,7 @@ def _unicode_art_(self, term): TESTS:: sage: R = NonCommutativeSymmetricFunctions(QQ).R() # needs sage.combinat - sage: Partitions.options(diagram_str="#", convention="french") # needs sage.combinat + sage: Partitions.options(diagram_str='#', convention='french') # needs sage.combinat sage: s = unicode_art(tensor((R[1,2], R[3,1,2]))); s # needs sage.combinat R ⊗ R ┌┐ ┌┬┬┐ @@ -1518,8 +1518,8 @@ def _repr_term(self, term): """ TESTS:: - sage: F = CombinatorialFreeModule(ZZ, [1,2,3], prefix="F") - sage: G = CombinatorialFreeModule(ZZ, [1,2,3,4], prefix="G") + sage: F = CombinatorialFreeModule(ZZ, [1,2,3], prefix='F') + sage: G = CombinatorialFreeModule(ZZ, [1,2,3,4], prefix='G') sage: f = F.monomial(1) + 2 * F.monomial(2) sage: g = 2*G.monomial(3) + G.monomial(4) sage: tensor([f, g]) # indirect doctest @@ -1599,7 +1599,7 @@ def tensor_constructor(self, modules): def _tensor_of_elements(self, elements): """ - Returns the tensor product of the specified elements. + Return the tensor product of the specified elements. The result should be in ``self``. EXAMPLES:: @@ -1738,7 +1738,7 @@ def __call__(self, *indices): class CombinatorialFreeModule_CartesianProduct(CombinatorialFreeModule): """ - An implementation of Cartesian products of modules with basis + An implementation of Cartesian products of modules with basis. EXAMPLES: @@ -1836,7 +1836,7 @@ def cartesian_embedding(self, i): INPUT: - - ``i`` -- an integer + - ``i`` -- integer EXAMPLES:: @@ -1870,7 +1870,7 @@ def cartesian_projection(self, i): INPUT: - - ``i`` -- an integer + - ``i`` -- integer EXAMPLES:: diff --git a/src/sage/combinat/free_prelie_algebra.py b/src/sage/combinat/free_prelie_algebra.py index 88d54b1f443..00781ab782b 100644 --- a/src/sage/combinat/free_prelie_algebra.py +++ b/src/sage/combinat/free_prelie_algebra.py @@ -289,7 +289,7 @@ def gen(self, i): INPUT: - - ``i`` -- an integer + - ``i`` -- integer EXAMPLES:: @@ -337,7 +337,7 @@ def change_ring(self, R): INPUT: - - `R` -- a ring + - ``R`` -- a ring EXAMPLES:: @@ -1048,8 +1048,8 @@ def tree_from_sortkey(ch, labels=True): INPUT: - - ``ch`` -- a list of pairs ``(integer, label)`` - - ``labels`` -- (default ``True``) whether to use labelled trees + - ``ch`` -- list of pairs ``(integer, label)`` + - ``labels`` -- boolean (default: ``True``); whether to use labelled trees OUTPUT: @@ -1101,7 +1101,7 @@ def corolla_gen(tx, list_ty, labels=True): INPUT: - ``tx`` -- a tree - - ``list_ty`` -- a list of trees + - ``list_ty`` -- list of trees EXAMPLES:: diff --git a/src/sage/combinat/fully_commutative_elements.py b/src/sage/combinat/fully_commutative_elements.py index d5d2d48dae8..fb361cf844a 100644 --- a/src/sage/combinat/fully_commutative_elements.py +++ b/src/sage/combinat/fully_commutative_elements.py @@ -189,9 +189,9 @@ def heap(self, **kargs): INPUT: - - ``self`` -- list, a reduced word `w=s_0... s_{k-1}` of an FC element + - ``self`` -- list; a reduced word `w=s_0... s_{k-1}` of an FC element - - ``one_index`` -- boolean (default: ``False``). Setting the value to True + - ``one_index`` -- boolean (default: ``False``); setting the value to True will change the underlying set of the poset to `\{1, 2, \dots, n\}` - ``display_labeling`` -- boolean (default: ``False``); setting the value to diff --git a/src/sage/combinat/gelfand_tsetlin_patterns.py b/src/sage/combinat/gelfand_tsetlin_patterns.py index 14335ef0a8d..6241180b0fe 100644 --- a/src/sage/combinat/gelfand_tsetlin_patterns.py +++ b/src/sage/combinat/gelfand_tsetlin_patterns.py @@ -479,8 +479,8 @@ def Tokuyama_coefficient(self, name='t'): INPUT: - - ``name`` -- (Default: ``'t'``) An alternative name for the - variable `t`. + - ``name`` -- (default: ``'t'``) an alternative name for the + variable `t` EXAMPLES:: @@ -579,15 +579,15 @@ class GelfandTsetlinPatterns(UniqueRepresentation, Parent): INPUT: - - ``n`` -- The width or depth of the array, also known as the rank + - ``n`` -- the width or depth of the array, also known as the rank - - ``k`` -- (Default: ``None``) If specified, this is the maximum value that + - ``k`` -- (default: ``None``) If specified, this is the maximum value that can occur in the patterns - - ``top_row`` -- (Default: ``None``) If specified, this is the fixed top + - ``top_row`` -- (default: ``None``) If specified, this is the fixed top row of all patterns - - ``strict`` -- (Default: ``False``) Set to ``True`` if all patterns are + - ``strict`` -- (default: ``False``) Set to ``True`` if all patterns are strict patterns TESTS: @@ -1018,10 +1018,10 @@ def _toggle_markov_chain(self, chain_state, row, col, direction): INPUT: - - ``chain_state`` -- A GelfandTsetlin pattern represented as a list of lists - - ``row`` -- The row of the cell being modified - - ``col`` -- The column of the cell being modified - - ``direction`` -- The direction to change the cell 1 = increase, 0 = decrease + - ``chain_state`` -- a GelfandTsetlin pattern represented as a list of lists + - ``row`` -- the row of the cell being modified + - ``col`` -- the column of the cell being modified + - ``direction`` -- the direction to change the cell 1 = increase, 0 = decrease OUTPUT: ``chain_state`` is possibly modified @@ -1339,8 +1339,8 @@ def Tokuyama_formula(self, name='t'): INPUT: - - ``name`` -- (Default: ``'t'``) An alternative name for the - variable `t`. + - ``name`` -- (default: ``'t'``) an alternative name for the + variable `t` EXAMPLES:: diff --git a/src/sage/combinat/gray_codes.py b/src/sage/combinat/gray_codes.py index e2508e0e01c..92446d0d8f9 100644 --- a/src/sage/combinat/gray_codes.py +++ b/src/sage/combinat/gray_codes.py @@ -21,7 +21,7 @@ def product(m): INPUT: - - ``m`` -- a list or tuple of positive integers that correspond to the size + - ``m`` -- list or tuple of positive integers that correspond to the size of the sets in the product EXAMPLES:: @@ -119,9 +119,9 @@ def combinations(n,t): INPUT: - - ``n`` -- (integer or ``Infinity``) -- size of the ground set + - ``n`` -- integer or ``Infinity``; size of the ground set - - ``t`` -- (integer) -- size of the subsets + - ``t`` -- integer; size of the subsets EXAMPLES:: diff --git a/src/sage/combinat/grossman_larson_algebras.py b/src/sage/combinat/grossman_larson_algebras.py index db2f1de5eca..642508f0968 100644 --- a/src/sage/combinat/grossman_larson_algebras.py +++ b/src/sage/combinat/grossman_larson_algebras.py @@ -336,7 +336,7 @@ def change_ring(self, R): INPUT: - - `R` -- a ring + - ``R`` -- a ring EXAMPLES:: diff --git a/src/sage/combinat/growth.py b/src/sage/combinat/growth.py index a45c3ff7f26..6d34d59a1b1 100644 --- a/src/sage/combinat/growth.py +++ b/src/sage/combinat/growth.py @@ -27,7 +27,7 @@ Growth diagrams, invented by Sergey Fomin [Fom1994]_, [Fom1995]_, provide a vast generalization of the Robinson-Schensted-Knuth (RSK) -correspondence between matrices with non-negative integer entries and +correspondence between matrices with nonnegative integer entries and pairs of semistandard Young tableaux of the same shape. The main fact is that many correspondences similar to RSK can be @@ -127,7 +127,7 @@ In general, growth diagrams are defined for `0-1`-fillings of arbitrary skew shapes. In the case of the Robinson-Schensted-Knuth -correspondence, even arbitrary non-negative integers are allowed. In +correspondence, even arbitrary nonnegative integers are allowed. In other cases, entries may be either zero or an `r`-th root of unity - for example, :class:`~sage.combinat.growth.RuleDomino` insertion is defined for signed permutations, that is, `r=2`. Traditionally, words @@ -138,7 +138,7 @@ to (signed) entries, where zeros can be omitted. In this case, when the parameter ``shape`` is not explicitly specified, it is assumed to be the minimal rectangle containing the origin and all coordinates -with non-zero entries. +with nonzero entries. For example, consider the following generalized permutation:: @@ -183,8 +183,8 @@ between oscillating tableaux and (partial) perfect matchings. Perfect matchings of `\{1, \ldots, 2r\}` are in bijection with `0-1`-fillings of a triangular shape with `2r-1` rows, such that for -each `k` there is either exactly one non-zero entry in row `k` or -exactly one non-zero entry in column `2r-k`. Explicitly, if `(i,j)` +each `k` there is either exactly one nonzero entry in row `k` or +exactly one nonzero entry in column `2r-k`. Explicitly, if `(i,j)` is a pair in the perfect matching, the entry in column `i-1` and row `2r-j` equals `1`. For example:: @@ -339,7 +339,7 @@ For illustration, let us implement a growth diagram class with the backward rule only. Suppose that the vertices of the graph are the -non-negative integers, the rank is given by the integer itself, and +nonnegative integers, the rank is given by the integer itself, and the backward rule is `(y, z, x) \mapsto (\min(x,y), 0)` if `y = z` or `x = z` and `(y, z, x) \mapsto (\min(x,y), 1)` otherwise. @@ -517,7 +517,7 @@ class GrowthDiagram(SageObject): Growth diagrams were introduced by Sergey Fomin [Fom1994]_, [Fom1995]_ and provide a vast generalization of the Robinson-Schensted-Knuth (RSK) correspondence between matrices - with non-negative integer entries and pairs of semistandard Young + with nonnegative integer entries and pairs of semistandard Young tableaux of the same shape. A growth diagram is based on the notion of *dual graded graphs*, @@ -1051,7 +1051,7 @@ def to_biword(self): w2.extend([j+1]*v) else: raise ValueError("can only convert fillings with" - " non-negative entries to words") + " nonnegative entries to words") return (w1, w2) def __iter__(self): @@ -1636,12 +1636,12 @@ class Rule(UniqueRepresentation): Subclasses may provide the following methods: - ``normalize_vertex`` -- a function that converts its input to a - vertex. + vertex - - ``vertices`` -- a function that takes a non-negative integer - as input and returns the list of vertices on this rank. + - ``vertices`` -- a function that takes a nonnegative integer + as input and returns the list of vertices on this rank - - ``rank`` -- the rank function of the dual graded graphs. + - ``rank`` -- the rank function of the dual graded graphs - ``forward_rule`` -- a function with input ``(y, t, x, content)`` or ``(y, e, t, f, x, content)`` if @@ -3706,7 +3706,7 @@ class RuleRSK(RulePartitions): Partitions of the integer 3 The local rules implemented provide the RSK correspondence - between matrices with non-negative integer entries and pairs of + between matrices with nonnegative integer entries and pairs of semistandard tableaux, the :meth:`~sage.combinat.growth.RulePartitions.P_symbol` and the :meth:`~sage.combinat.growth.RulePartitions.Q_symbol`. For @@ -3766,7 +3766,7 @@ def forward_rule(self, y, t, x, content): t x y - - ``content`` -- a non-negative integer; the content of the cell + - ``content`` -- nonnegative integer; the content of the cell OUTPUT: @@ -3871,7 +3871,7 @@ class RuleBurge(RulePartitions): Partitions of the integer 3 The local rules implemented provide Burge's correspondence - between matrices with non-negative integer entries and pairs of + between matrices with nonnegative integer entries and pairs of semistandard tableaux, the :meth:`~sage.combinat.growth.RulePartitions.P_symbol` and the :meth:`~sage.combinat.growth.RulePartitions.Q_symbol`. For @@ -3918,7 +3918,7 @@ def forward_rule(self, y, t, x, content): t x y - - ``content`` -- a non-negative integer; the content of the cell + - ``content`` -- nonnegative integer; the content of the cell OUTPUT: the fourth partition according to the Burge correspondence diff --git a/src/sage/combinat/hillman_grassl.py b/src/sage/combinat/hillman_grassl.py index 7a98b2e2c85..c4e0f48088d 100644 --- a/src/sage/combinat/hillman_grassl.py +++ b/src/sage/combinat/hillman_grassl.py @@ -462,7 +462,7 @@ def _repr_(self): def an_element(self): r""" - Returns a particular element of the class. + Return a particular element of the class. TESTS:: diff --git a/src/sage/combinat/integer_lists/base.pyx b/src/sage/combinat/integer_lists/base.pyx index e425979ee9a..5929de73c72 100644 --- a/src/sage/combinat/integer_lists/base.pyx +++ b/src/sage/combinat/integer_lists/base.pyx @@ -526,7 +526,7 @@ cdef class Envelope(): r""" Return a bound on the limit of ``self``. - OUTPUT: a nonnegative integer or `\infty` + OUTPUT: nonnegative integer or `\infty` This returns some upper bound for the accumulation points of this upper envelope. For a lower envelope, a lower bound is diff --git a/src/sage/combinat/integer_matrices.py b/src/sage/combinat/integer_matrices.py index db8105dd6ba..fae016ddc7b 100644 --- a/src/sage/combinat/integer_matrices.py +++ b/src/sage/combinat/integer_matrices.py @@ -1,8 +1,8 @@ # sage.doctest: needs sage.combinat sage.modules r""" -Counting, generating, and manipulating non-negative integer matrices +Counting, generating, and manipulating nonnegative integer matrices -Counting, generating, and manipulating non-negative integer matrices with +Counting, generating, and manipulating nonnegative integer matrices with prescribed row sums and column sums. AUTHORS: @@ -26,7 +26,7 @@ class IntegerMatrices(UniqueRepresentation, Parent): r""" - The class of non-negative integer matrices with + The class of nonnegative integer matrices with prescribed row sums and column sums. An *integer matrix* `m` with column sums `c := (c_1,...,c_k)` and row @@ -231,9 +231,7 @@ def row_sums(self): r""" The row sums of the integer matrices in ``self``. - OUTPUT: - - - Composition + OUTPUT: Composition EXAMPLES:: @@ -248,9 +246,7 @@ def column_sums(self): r""" The column sums of the integer matrices in ``self``. - OUTPUT: - - - Composition + OUTPUT: Composition EXAMPLES:: @@ -306,9 +302,7 @@ def integer_matrices_generator(row_sums, column_sums): - ``row_sums`` -- list or tuple - ``column_sums`` -- list or tuple - OUTPUT: - - - an iterator producing a list of lists + OUTPUT: an iterator producing a list of lists EXAMPLES:: diff --git a/src/sage/combinat/integer_vector.py b/src/sage/combinat/integer_vector.py index 6863e8f328a..abb61ee00ba 100644 --- a/src/sage/combinat/integer_vector.py +++ b/src/sage/combinat/integer_vector.py @@ -59,14 +59,14 @@ def is_gale_ryser(r, s): If, given a binary matrix, these two vectors are easy to compute, the Gale-Ryser theorem lets us decide whether, given two - non-negative vectors `r,s`, there exists a binary matrix + nonnegative vectors `r,s`, there exists a binary matrix whose row/column sums vectors are `r` and `s`. This functions answers accordingly. INPUT: - - ``r``, ``s`` -- lists of non-negative integers. + - ``r``, ``s`` -- lists of nonnegative integers ALGORITHM: @@ -103,7 +103,7 @@ def is_gale_ryser(r, s): generic-sounding) term ''realizable sequence''. """ - # The sequences only contain non-negative integers + # The sequences only contain nonnegative integers if [x for x in r if x < 0] or [x for x in s if x < 0]: return False @@ -126,7 +126,7 @@ def is_gale_ryser(r, s): def gale_ryser_theorem(p1, p2, algorithm="gale", *, solver=None, integrality_tolerance=1e-3): r""" - Returns the binary matrix given by the Gale-Ryser theorem. + Return the binary matrix given by the Gale-Ryser theorem. The Gale Ryser theorem asserts that if `p_1,p_2` are two partitions of `n` of respective lengths `k_1,k_2`, then there is @@ -153,7 +153,7 @@ def gale_ryser_theorem(p1, p2, algorithm="gale", :class:`MixedIntegerLinearProgram `. - ``integrality_tolerance`` -- parameter for use with MILP solvers over an - inexact base ring; see :meth:`MixedIntegerLinearProgram.get_values`. + inexact base ring; see :meth:`MixedIntegerLinearProgram.get_values` OUTPUT: a binary matrix if it exists, ``None`` otherwise @@ -223,27 +223,27 @@ def gale_ryser_theorem(p1, p2, algorithm="gale", sage: from sage.combinat.integer_vector import gale_ryser_theorem sage: p1 = [3,3,1,1] sage: p2 = [3,3,1,1] - sage: gale_ryser_theorem(p1, p2, algorithm="ryser") + sage: gale_ryser_theorem(p1, p2, algorithm='ryser') [1 1 1 0] [1 1 0 1] [1 0 0 0] [0 1 0 0] sage: p1 = [4,2,2] sage: p2 = [3,3,1,1] - sage: gale_ryser_theorem(p1, p2, algorithm="ryser") + sage: gale_ryser_theorem(p1, p2, algorithm='ryser') [1 1 1 1] [1 1 0 0] [1 1 0 0] sage: p1 = [4,2,2,0] sage: p2 = [3,3,1,1,0,0] - sage: gale_ryser_theorem(p1, p2, algorithm="ryser") + sage: gale_ryser_theorem(p1, p2, algorithm='ryser') [1 1 1 1 0 0] [1 1 0 0 0 0] [1 1 0 0 0 0] [0 0 0 0 0 0] sage: p1 = [3,3,2,1] sage: p2 = [3,2,2,1,1] - sage: print(gale_ryser_theorem(p1, p2, algorithm="gale")) # not tested + sage: print(gale_ryser_theorem(p1, p2, algorithm='gale')) # not tested [1 1 1 0 0] [1 1 0 0 1] [1 0 1 0 0] @@ -252,7 +252,7 @@ def gale_ryser_theorem(p1, p2, algorithm="gale", With `0` in the sequences, and with unordered inputs:: sage: from sage.combinat.integer_vector import gale_ryser_theorem - sage: gale_ryser_theorem([3,3,0,1,1,0], [3,1,3,1,0], algorithm="ryser") # needs sage.combinat sage.modules + sage: gale_ryser_theorem([3,3,0,1,1,0], [3,1,3,1,0], algorithm='ryser') # needs sage.combinat sage.modules [1 1 1 0 0] [1 0 1 1 0] [0 0 0 0 0] @@ -260,7 +260,7 @@ def gale_ryser_theorem(p1, p2, algorithm="gale", [0 0 1 0 0] [0 0 0 0 0] sage: p1 = [3,1,1,1,1]; p2 = [3,2,2,0] - sage: gale_ryser_theorem(p1, p2, algorithm="ryser") # needs sage.combinat sage.modules + sage: gale_ryser_theorem(p1, p2, algorithm='ryser') # needs sage.combinat sage.modules [1 1 1 0] [1 0 0 0] [1 0 0 0] @@ -293,11 +293,11 @@ def gale_ryser_theorem(p1, p2, algorithm="gale", Null matrix:: - sage: gale_ryser_theorem([0,0,0],[0,0,0,0], algorithm="gale") # needs sage.combinat sage.modules + sage: gale_ryser_theorem([0,0,0],[0,0,0,0], algorithm='gale') # needs sage.combinat sage.modules [0 0 0 0] [0 0 0 0] [0 0 0 0] - sage: gale_ryser_theorem([0,0,0],[0,0,0,0], algorithm="ryser") # needs sage.combinat sage.modules + sage: gale_ryser_theorem([0,0,0],[0,0,0,0], algorithm='ryser') # needs sage.combinat sage.modules [0 0 0 0] [0 0 0 0] [0 0 0 0] @@ -449,7 +449,7 @@ class IntegerVector(ClonableArray): def check(self): """ Check to make sure this is a valid integer vector by making sure - all entries are non-negative. + all entries are nonnegative. EXAMPLES:: @@ -476,7 +476,7 @@ def check(self): ValueError: [2, 2] doesn't satisfy correct constraints """ if any(x < 0 for x in self): - raise ValueError("all entries must be non-negative") + raise ValueError("all entries must be nonnegative") if self not in self.parent(): raise ValueError(f"{self} doesn't satisfy correct constraints") @@ -551,7 +551,7 @@ def specht_module_dimension(self, base_ring=None): class IntegerVectors(Parent, metaclass=ClasscallMetaclass): """ - The class of (non-negative) integer vectors. + The class of (nonnegative) integer vectors. INPUT: @@ -564,7 +564,7 @@ class IntegerVectors(Parent, metaclass=ClasscallMetaclass): .. NOTE:: - The entries are non-negative integers. + The entries are nonnegative integers. EXAMPLES: @@ -579,7 +579,7 @@ class IntegerVectors(Parent, metaclass=ClasscallMetaclass): sage: [1, 0, 0] in IntegerVectors() True - Entries are non-negative:: + Entries are nonnegative:: sage: [-1, 2] in IntegerVectors() False @@ -783,8 +783,8 @@ def _unrank_helper(self, x, rtn): INPUT: - - ``x`` -- a nonnegative integer - - ``rtn`` -- a list of nonnegative integers + - ``x`` -- nonnegative integer + - ``rtn`` -- list of nonnegative integers EXAMPLES:: @@ -941,7 +941,7 @@ def rank(self, x): INPUT: - - ``x`` -- a list with ``sum(x) == n`` + - ``x`` -- list with ``sum(x) == n`` EXAMPLES:: @@ -966,7 +966,7 @@ def unrank(self, x): INPUT: - - ``x`` -- an integer. + - ``x`` -- integer EXAMPLES:: @@ -1076,7 +1076,7 @@ def rank(self, x): INPUT: - - ``x`` -- a list with ``len(x) == k`` + - ``x`` -- list with ``len(x) == k`` EXAMPLES:: @@ -1101,7 +1101,7 @@ def unrank(self, x): INPUT: - - ``x`` -- an integer such that x < self.cardinality()`` + - ``x`` -- integer such that ``x < self.cardinality()`` EXAMPLES:: @@ -1313,7 +1313,7 @@ def rank(self, x): INPUT: - - ``x`` -- a list with ``sum(x) == n`` and ``len(x) == k`` + - ``x`` -- list with ``sum(x) == n`` and ``len(x) == k`` TESTS:: @@ -1336,7 +1336,7 @@ def unrank(self, x): INPUT: - - ``x`` -- an integer such that ``x < self.cardinality()`` + - ``x`` -- integer such that ``x < self.cardinality()`` EXAMPLES:: @@ -1374,9 +1374,9 @@ class IntegerVectors_nnondescents(UniqueRepresentation, IntegerVectors): The grading parameters on the integer vector `v` are: - - `n` -- the sum of the parts of `v`, + - ``n`` -- the sum of the parts of `v`, - - `c` -- the non descents composition of `v`. + - ``c`` -- the non descents composition of `v` In other words: the length of `v` equals `c_1 + \cdots + c_k`, and `v` is decreasing in the consecutive blocs of length `c_1, \ldots, c_k`, diff --git a/src/sage/combinat/integer_vector_weighted.py b/src/sage/combinat/integer_vector_weighted.py index 9a28d632c85..cbe821bdb3b 100644 --- a/src/sage/combinat/integer_vector_weighted.py +++ b/src/sage/combinat/integer_vector_weighted.py @@ -350,7 +350,7 @@ def iterator_fast(n, l): INPUT: - - ``n`` -- an integer + - ``n`` -- integer - ``l`` -- the weights in weakly decreasing order EXAMPLES:: diff --git a/src/sage/combinat/integer_vectors_mod_permgroup.py b/src/sage/combinat/integer_vectors_mod_permgroup.py index b02789e2f90..272b048ff53 100644 --- a/src/sage/combinat/integer_vectors_mod_permgroup.py +++ b/src/sage/combinat/integer_vectors_mod_permgroup.py @@ -417,7 +417,7 @@ def retract(self, elt): def roots(self): r""" - Returns the root of generation of ``self``. This method is + Return the root of generation of ``self``. This method is required to build the tree structure of ``self`` which inherits from the class :class:`~sage.sets.recursively_enumerated_set.RecursivelyEnumeratedSet_forest`. @@ -431,7 +431,7 @@ def roots(self): def children(self, x): r""" - Returns the list of children of the element ``x``. This method + Return the list of children of the element ``x``. This method is required to build the tree structure of ``self`` which inherits from the class :class:`~sage.sets.recursively_enumerated_set.RecursivelyEnumeratedSet_forest`. @@ -445,7 +445,7 @@ def children(self, x): def permutation_group(self): r""" - Returns the permutation group given to define ``self``. + Return the permutation group given to define ``self``. EXAMPLES:: @@ -457,7 +457,7 @@ def permutation_group(self): def is_canonical(self, v, check=True): r""" - Returns ``True`` if the integer list ``v`` is maximal in its + Return ``True`` if the integer list ``v`` is maximal in its orbit under the action of the permutation group given to define ``self``. Such integer vectors are said to be canonical. A vector `v` is canonical if and only if @@ -508,7 +508,7 @@ def __contains__(self, v): def __call__(self, v, check=True): r""" - Returns an element of ``self`` constructed from ``v`` if + Return an element of ``self`` constructed from ``v`` if possible. TESTS:: @@ -527,7 +527,7 @@ def __call__(self, v, check=True): def orbit(self, v): r""" - Returns the orbit of the integer vector ``v`` under the action of the + Return the orbit of the integer vector ``v`` under the action of the permutation group defining ``self``. The result is a set. EXAMPLES: @@ -557,7 +557,7 @@ def orbit(self, v): def subset(self, sum=None, max_part=None): r""" - Returns the subset of ``self`` containing integer vectors + Return the subset of ``self`` containing integer vectors whose entries sum to ``sum``. EXAMPLES:: @@ -591,7 +591,7 @@ class Element(ClonableIntArray): def check(self): r""" - Checks that ``self`` verify the invariants needed for + Check that ``self`` verify the invariants needed for living in ``self.parent()``. EXAMPLES:: @@ -1178,7 +1178,7 @@ def orbit(self, v): INPUT: - ``v`` -- an element of ``self`` or any list of length the - degree of the permutation group. + degree of the permutation group EXAMPLES: diff --git a/src/sage/combinat/interval_posets.py b/src/sage/combinat/interval_posets.py index 1c4d07e808a..f921f8c063a 100644 --- a/src/sage/combinat/interval_posets.py +++ b/src/sage/combinat/interval_posets.py @@ -95,12 +95,12 @@ class TamariIntervalPoset(Element, INPUT: - - ``size`` -- an integer, the size of the interval-posets (number of + - ``size`` -- integer; the size of the interval-posets (number of vertices) - - ``relations`` -- a list (or tuple) of pairs ``(a,b)`` (themselves + - ``relations`` -- list (or tuple) of pairs ``(a,b)`` (themselves lists or tuples), each representing a relation of the form - '`a` precedes `b`' in the poset. + '`a` precedes `b`' in the poset - ``check`` -- boolean (default: ``True``); whether to check the interval-poset condition or not @@ -722,7 +722,7 @@ def increasing_children(self, v) -> list[int]: INPUT: - - ``v`` -- an integer representing a vertex of ``self`` + - ``v`` -- integer representing a vertex of ``self`` (between 1 and ``size``) OUTPUT: @@ -761,7 +761,7 @@ def increasing_parent(self, v) -> None | int: INPUT: - - ``v`` -- an integer representing a vertex of ``self`` + - ``v`` -- integer representing a vertex of ``self`` (between 1 and ``size``) EXAMPLES:: @@ -858,7 +858,7 @@ def decreasing_children(self, v) -> list[int]: INPUT: - - ``v`` -- an integer representing a vertex of ``self`` + - ``v`` -- integer representing a vertex of ``self`` (between 1 and ``size``) OUTPUT: @@ -897,7 +897,7 @@ def decreasing_parent(self, v) -> None | int: INPUT: - - ``v`` -- an integer representing a vertex of ``self`` (between + - ``v`` -- integer representing a vertex of ``self`` (between 1 and ``size``) EXAMPLES:: @@ -1944,8 +1944,8 @@ def subposet(self, start, end) -> TIP: INPUT: - - ``start`` -- an integer, the starting vertex (inclusive) - - ``end`` -- an integer, the ending vertex (not inclusive) + - ``start`` -- integer; the starting vertex (inclusive) + - ``end`` -- integer; the ending vertex (not inclusive) EXAMPLES:: @@ -2511,9 +2511,7 @@ def new_decomposition(self) -> list[TIP]: For the number of terms, you can use instead the method :meth:`number_of_new_components`. - OUTPUT: - - a list of new interval-posets. + OUTPUT: list of new interval-posets .. SEEALSO:: @@ -3420,9 +3418,7 @@ def from_minimal_schnyder_wood(graph) -> TIP: Beware that the embedding convention used here is the opposite of the one used by the plot method. - OUTPUT: - - a Tamari interval-poset + OUTPUT: a Tamari interval-poset EXAMPLES: diff --git a/src/sage/combinat/k_tableau.py b/src/sage/combinat/k_tableau.py index 0b35435c517..19e24128e1c 100644 --- a/src/sage/combinat/k_tableau.py +++ b/src/sage/combinat/k_tableau.py @@ -51,7 +51,7 @@ lazy_import('sage.combinat.root_system.weyl_group', 'WeylGroup') -def WeakTableau(t, k, inner_shape=[], representation="core"): +def WeakTableau(t, k, inner_shape=[], representation='core'): r""" This is the dispatcher method for the element class of weak `k`-tableaux. @@ -85,7 +85,7 @@ def WeakTableau(t, k, inner_shape=[], representation="core"): (default: ``[]``) - ``representation`` -- 'core', 'bounded', or 'factorized_permutation' - (default: 'core') + (default: ``'core'``) EXAMPLES: @@ -111,7 +111,7 @@ def WeakTableau(t, k, inner_shape=[], representation="core"): Next we create the analogue of the first example in bounded representation:: - sage: tb = WeakTableau([[1,1,2],[2,3],[3]], 3, representation="bounded") + sage: tb = WeakTableau([[1,1,2],[2,3],[3]], 3, representation='bounded') sage: tb.shape() [3, 2, 1] sage: tb.weight() @@ -196,7 +196,7 @@ def WeakTableau(t, k, inner_shape=[], representation="core"): raise NotImplementedError("The representation option needs to be 'core', 'bounded', or 'factorized_permutation'") -def WeakTableaux(k, shape , weight, representation="core"): +def WeakTableaux(k, shape , weight, representation='core'): r""" This is the dispatcher method for the parent class of weak `k`-tableaux. @@ -360,7 +360,7 @@ def size(self): ([5, 2, 1], [1, 1]) sage: t.size() 4 - sage: t = WeakTableau([[1,1,2],[2,3],[3]], 3, representation="bounded") + sage: t = WeakTableau([[1,1,2],[2,3],[3]], 3, representation='bounded') sage: t.shape() [3, 2, 1] sage: t.size() @@ -486,7 +486,7 @@ def representation(self, representation='core'): INPUT: - - ``representation`` -- 'core', 'bounded', or 'factorized_permutation' (default: 'core') + - ``representation`` -- 'core', 'bounded', or 'factorized_permutation' (default: ``'core'``) EXAMPLES:: @@ -614,7 +614,7 @@ def representation(self, representation='core'): INPUT: - - ``representation`` -- 'core', 'bounded', or 'factorized_permutation' (default: 'core') + - ``representation`` -- 'core', 'bounded', or 'factorized_permutation' (default: ``'core'``) EXAMPLES:: @@ -911,9 +911,7 @@ def residues_of_entries(self, v): - ``v`` -- a label of a cell in ``self`` - OUTPUT: - - - a list of residues + OUTPUT: list of residues EXAMPLES:: @@ -940,9 +938,7 @@ def dictionary_of_coordinates_at_residues(self, v): - ``v`` -- a label of a cell in ``self`` - OUTPUT: - - - dictionary assigning coordinates in ``self`` to residues + OUTPUT: dictionary assigning coordinates in ``self`` to residues EXAMPLES:: @@ -975,9 +971,7 @@ def list_of_standard_cells(self): - ``self`` -- a weak `k`-tableau in core representation with partition weight - OUTPUT: - - - a list of lists of coordinates + OUTPUT: list of lists of coordinates .. WARNING:: @@ -1036,18 +1030,16 @@ def list_of_standard_cells(self): out.append(standard_cells) return out - def k_charge(self, algorithm="I"): + def k_charge(self, algorithm='I'): r""" Return the `k`-charge of ``self``. INPUT: - - ``algorithm`` -- (default: "I") if "I", computes `k`-charge using the `I` + - ``algorithm`` -- (default: ``'I'``) if "I", computes `k`-charge using the `I` algorithm, otherwise uses the `J`-algorithm - OUTPUT: - - - a nonnegative integer + OUTPUT: nonnegative integer For the definition of `k`-charge and the various algorithms to compute it see Section 3.3 of [LLMSSZ2013]_. @@ -1084,9 +1076,7 @@ def k_charge_I(self): For the definition of `k`-charge and the `I`-algorithm see Section 3.3 of [LLMSSZ2013]_. - OUTPUT: - - - a nonnegative integer + OUTPUT: nonnegative integer .. SEEALSO:: :meth:`k_charge` and :meth:`k_charge_J` @@ -1130,9 +1120,7 @@ def k_charge_J(self): For the definition of `k`-charge and the `J`-algorithm see Section 3.3 of [LLMSSZ2013]_. - OUTPUT: - - - a nonnegative integer + OUTPUT: nonnegative integer .. SEEALSO:: :meth:`k_charge` and :meth:`k_charge_I` @@ -1189,9 +1177,7 @@ def _height_of_restricted_subword(self, sw, r): - ``sw`` -- one of the subwords of standard cells of ``self`` - ``r`` -- nonnegative integer - OUTPUT: - - - a nonnegative integer + OUTPUT: nonnegative integer EXAMPLES:: @@ -1265,7 +1251,7 @@ def __classcall_private__(cls, k, shape, weight): def __init__(self, k, shape, weight): r""" - Initializes the parent class of (skew) weak `k`-tableaux in core representation. + Initialize the parent class of (skew) weak `k`-tableaux in core representation. INPUT: @@ -1334,9 +1320,7 @@ def diag(self, c, ha): - ``c`` -- a cell in the lattice - ``ha`` -- another cell in the lattice with bigger row and smaller column than `c` - OUTPUT: - - - a nonnegative integer + OUTPUT: nonnegative integer EXAMPLES:: @@ -1354,9 +1338,7 @@ def circular_distance(self, cr, r): - ``cr``, ``r`` -- nonnegative integers between `0` and `k` - OUTPUT: - - - a positive integer + OUTPUT: positive integer EXAMPLES:: @@ -1564,7 +1546,7 @@ def check(self): def _is_k_tableau(self): r""" - Checks whether ``self`` is a valid weak `k`-tableau. + Check whether ``self`` is a valid weak `k`-tableau. EXAMPLES:: @@ -1662,12 +1644,10 @@ def k_charge(self, algorithm='I'): INPUT: - - ``algorithm`` -- (default: "I") if "I", computes `k`-charge using the `I` + - ``algorithm`` -- (default: ``'I'``) if "I", computes `k`-charge using the `I` algorithm, otherwise uses the `J`-algorithm - OUTPUT: - - - a nonnegative integer + OUTPUT: nonnegative integer For the definition of `k`-charge and the various algorithms to compute it see Section 3.3 of [LLMSSZ2013]_. @@ -1733,7 +1713,7 @@ def __classcall_private__(cls, k, shape, weight): def __init__(self, k, shape, weight): r""" - Initializes the parent class of (skew) weak `k`-tableaux in bounded representation. + Initialize the parent class of (skew) weak `k`-tableaux in bounded representation. INPUT: @@ -1809,9 +1789,9 @@ def straighten_input(t, k): INPUT: - - ``t`` -- a list of reduced words or a list of elements in the Weyl group of type + - ``t`` -- list of reduced words or a list of elements in the Weyl group of type `A_k^{(1)}` - - ``k`` -- a positive integer + - ``k`` -- positive integer EXAMPLES:: @@ -2003,7 +1983,7 @@ def check(self): def _is_k_tableau(self): r""" - Checks whether ``self`` is a valid weak `k`-tableau. + Check whether ``self`` is a valid weak `k`-tableau. EXAMPLES:: @@ -2094,9 +2074,7 @@ def k_charge(self, algorithm='I'): r""" Return the `k`-charge of ``self``. - OUTPUT: - - - a nonnegative integer + OUTPUT: nonnegative integer EXAMPLES:: @@ -2156,7 +2134,7 @@ def __classcall_private__(cls, k, shape, weight): def __init__(self, k, shape, weight): r""" - Initializes the parent class of weak `k`-tableaux in factorized permutation representation. + Initialize the parent class of weak `k`-tableaux in factorized permutation representation. INPUT: @@ -2490,11 +2468,9 @@ def _is_valid_marked( self ): INPUT: - - ``self`` -- a list of lists representing a potential *standard* marked tableau - - OUTPUT: + - ``self`` -- list of lists representing a potential *standard* marked tableau - - a boolean, ``True`` if the marks are properly placed in the tableau + OUTPUT: boolean; ``True`` if the marks are properly placed in the tableau EXAMPLES:: @@ -2551,9 +2527,7 @@ def _is_valid_standard( self ): less than or equal to `i` for each `i`) is a `k+1`-core and that the length of the `i+1`-restricted core is the length of the `i`-restricted core plus 1. - OUTPUT: - - - a boolean, ``True`` means the standard strong marked tableau is valid + OUTPUT: boolean; ``True`` means the standard strong marked tableau is valid EXAMPLES:: @@ -2595,9 +2569,8 @@ def is_column_strict_with_weight( self, mu ): - ``mu`` -- a vector of weights - OUTPUT: - - - a boolean, ``True`` means the underlying column strict strong marked tableau is valid + OUTPUT: boolean; ``True`` means the underlying column strict strong + marked tableau is valid EXAMPLES:: @@ -2684,18 +2657,18 @@ def _repr_(self): sage: T = StrongTableau([[-1,-2,3],[-3]],2) sage: T [[-1, -2, 3], [-3]] - sage: Tableaux.options(display="diagram") + sage: Tableaux.options(display='diagram') sage: T -1 -2 3 -3 - sage: Tableaux.options(convention="French") + sage: Tableaux.options(convention='French') sage: T -3 -1 -2 3 - sage: Tableaux.options(display="compact") + sage: Tableaux.options(display='compact') sage: T -1,-2,3/-3 - sage: Tableaux.options(display="list",convention="English") + sage: Tableaux.options(display="list",convention='English') """ return self.parent().options._dispatch(self, '_repr_', 'display') @@ -2709,11 +2682,9 @@ def cell_of_marked_head(self, v): INPUT: - - ``v`` -- an integer representing the label in the standard tableau - - OUTPUT: + - ``v`` -- integer representing the label in the standard tableau - - a pair of the coordinates of the marked cell with entry ``v`` + OUTPUT: a pair of the coordinates of the marked cell with entry ``v`` EXAMPLES:: @@ -2748,11 +2719,9 @@ def content_of_marked_head(self, v): INPUT: - - ``v`` -- an integer representing the label in the standard tableau + - ``v`` -- integer representing the label in the standard tableau - OUTPUT: - - - an integer representing the residue of the location of the mark + OUTPUT: integer representing the residue of the location of the mark EXAMPLES:: @@ -2839,12 +2808,10 @@ def cell_of_highest_head( self, v ): INPUT: - - ``v`` -- an integer indicating the label in the standard tableau - - OUTPUT: + - ``v`` -- integer indicating the label in the standard tableau - - a pair of integers indicating the coordinates of the head of the highest - ribbon with label ``v`` + OUTPUT: a pair of integers indicating the coordinates of the head of + the highest ribbon with label ``v`` EXAMPLES:: @@ -2883,12 +2850,10 @@ def content_of_highest_head( self, v ): INPUT: - - ``v`` -- an integer representing the label in the standard tableau - - OUTPUT: + - ``v`` -- integer representing the label in the standard tableau - - an integer representing the content of the head of the highest - ribbon with label ``v`` + OUTPUT: an integer representing the content of the head of the highest + ribbon with label ``v`` EXAMPLES:: @@ -2959,12 +2924,10 @@ def cells_of_heads(self, v): INPUT: - - ``v`` -- an integer label + - ``v`` -- integer label - OUTPUT: - - - a list of pairs of integers of the coordinates of the heads of the ribbons - with label ``v`` + OUTPUT: a list of pairs of integers of the coordinates of the heads of + the ribbons with label ``v`` EXAMPLES:: @@ -3003,11 +2966,10 @@ def contents_of_heads(self, v): INPUT: - - ``v`` -- an integer label - - OUTPUT: + - ``v`` -- integer label - - a list of integers of the content of the heads of the ribbons with label ``v`` + OUTPUT: list of integers of the content of the heads of the ribbons + with label ``v`` EXAMPLES:: @@ -3043,11 +3005,9 @@ def entries_by_content(self, diag): INPUT: - - ``diag`` -- an integer indicating the diagonal + - ``diag`` -- integer indicating the diagonal - OUTPUT: - - - a list (perhaps empty) of labels on the diagonal ``diag`` + OUTPUT: list (perhaps empty) of labels on the diagonal ``diag`` EXAMPLES:: @@ -3080,11 +3040,9 @@ def entries_by_content_standard(self, diag): INPUT: - - ``diag`` -- an integer indicating the diagonal + - ``diag`` -- integer indicating the diagonal - OUTPUT: - - - a list (perhaps empty) of labels on the diagonal ``diag`` + OUTPUT: list (perhaps empty) of labels on the diagonal ``diag`` EXAMPLES:: @@ -3161,10 +3119,8 @@ def height_of_ribbon(self, v): - ``v`` -- the label of the standard marked tableau - OUTPUT: - - - a non-negative integer representing the number of rows - occupied by the ribbon which is marked + OUTPUT: nonnegative integer representing the number of rows + occupied by the ribbon which is marked EXAMPLES:: @@ -3202,10 +3158,8 @@ def number_of_connected_components(self, v): - ``v`` -- the label of the standard marked tableau - OUTPUT: - - - a non-negative integer representing the number of connected - components + OUTPUT: nonnegative integer representing the number of connected + components EXAMPLES:: @@ -3248,9 +3202,7 @@ def intermediate_shapes(self): recover the strong tableau one would need the intermediate shapes and the :meth:`content_of_marked_head` for each pair of adjacent shapes in the list. - OUTPUT: - - - a list of lists of integers representing `k+1`-cores + OUTPUT: list of lists of integers representing `k+1`-cores EXAMPLES:: @@ -3292,7 +3244,7 @@ def pp( self ): 3 3 3 - sage: Tableaux.options(convention="French") + sage: Tableaux.options(convention='French') sage: T.pp() 3 3 @@ -3302,7 +3254,7 @@ def pp( self ): -1 -2 . . . . -1 -2 - sage: Tableaux.options(convention="English") + sage: Tableaux.options(convention='English') """ print(self._repr_diagram()) @@ -3371,11 +3323,10 @@ def shape( self ): INPUT: - - ``form`` -- optional argument to indicate 'inner', 'outer' or 'skew' (default : 'outer') - - OUTPUT: + - ``form`` -- optional argument to indicate 'inner', 'outer' or 'skew' + (default: : 'outer') - - a `k+1`-core or a pair of `k+1`-cores if form is not 'inner' or 'outer' + OUTPUT: a `k+1`-core or a pair of `k+1`-cores if form is not 'inner' or 'outer' EXAMPLES:: @@ -3400,12 +3351,10 @@ def weight( self ): r""" Return the weight of the tableau. - The weight is a list of non-negative integers indicating the number of 1s, + The weight is a list of nonnegative integers indicating the number of 1s, number of 2s, number of 3s, etc. - OUTPUT: - - - a list of non-negative integers + OUTPUT: list of nonnegative integers EXAMPLES:: @@ -3435,9 +3384,7 @@ def size( self ): .. SEEALSO:: :meth:`sage.combinat.core.Core.length` - OUTPUT: - - - a non-negative integer + OUTPUT: nonnegative integer EXAMPLES:: @@ -3459,9 +3406,7 @@ def to_list( self ): """ Return the marked column strict (possibly skew) tableau as a list of lists. - OUTPUT: - - - a list of lists of integers or ``None`` + OUTPUT: list of lists of integers or ``None`` EXAMPLES:: @@ -3494,9 +3439,7 @@ def to_unmarked_list( self ): Return the list of lists of the rows of the tableau where the markings have been removed. - OUTPUT: - - - a list of lists of integers or ``None`` + OUTPUT: list of lists of integers or ``None`` EXAMPLES:: @@ -3525,9 +3468,7 @@ def to_standard_list(self): Internally, for a strong tableau the standard strong tableau and its weight is stored separately. This method returns the underlying standard part. - OUTPUT: - - - a list of lists of integers or ``None`` + OUTPUT: list of lists of integers or ``None`` EXAMPLES:: @@ -3553,9 +3494,7 @@ def to_standard_tableau(self): is stored separately. This method returns the underlying standard part as a ``StrongTableau``. - OUTPUT: - - - a strong tableau with standard weight + OUTPUT: a strong tableau with standard weight EXAMPLES:: @@ -3583,9 +3522,7 @@ def to_unmarked_standard_list( self ): Return the list of lists of the rows of the tableau where the markings have been removed. - OUTPUT: - - - a list of lists of integers or ``None`` + OUTPUT: list of lists of integers or ``None`` EXAMPLES:: @@ -3650,11 +3587,9 @@ def restrict( self, r ): INPUT: - - ``r`` -- an integer + - ``r`` -- integer - OUTPUT: - - - A strong tableau + OUTPUT: a strong tableau EXAMPLES:: @@ -3691,7 +3626,7 @@ def set_weight( self, mu ): INPUT: - - ``mu`` -- a list of non-negative integers representing the new weight + - ``mu`` -- list of nonnegative integers representing the new weight EXAMPLES:: @@ -3730,9 +3665,7 @@ def left_action( self, tij ): - ``tij`` -- a transposition represented as a pair `(i, j)`. - OUTPUT: - - - ``self`` after it has been modified by the action of the transposition ``tij`` + OUTPUT: ``self`` after it has been modified by the action of the transposition ``tij`` EXAMPLES:: @@ -3769,9 +3702,7 @@ def follows_tableau( self ): Return list of all strong tableaux obtained from ``self`` by extending to a core which follows the shape of ``self`` in the strong order. - OUTPUT: - - - a list of strong tableaux which follow ``self`` in strong order + OUTPUT: list of strong tableaux which follow ``self`` in strong order EXAMPLES:: @@ -3817,9 +3748,7 @@ def spin_of_ribbon( self, v ): - ``v`` -- a label of the standard part of the tableau - OUTPUT: - - - an integer value representing the spin of the ribbon with label ``v``. + OUTPUT: integer value representing the spin of the ribbon with label ``v`` EXAMPLES:: @@ -3860,9 +3789,7 @@ def spin( self ): where the sum is over all column strict marked strong `k`-tableaux of shape `\lambda` and partition content. - OUTPUT: - - - an integer value representing the spin. + OUTPUT: integer value representing the spin EXAMPLES:: @@ -3901,9 +3828,7 @@ def to_transposition_sequence( self ): which when applied to the left of an empty tableau gives the corresponding strong standard tableau. - OUTPUT: - - - a list of pairs of values ``[i,j]`` representing the transpositions `t_{ij}` + OUTPUT: list of pairs of values ``[i,j]`` representing the transpositions `t_{ij}` EXAMPLES:: @@ -4014,9 +3939,7 @@ def outer_shape(self): r""" Return the outer shape of the class of strong tableaux. - OUTPUT: - - - a `k+1`-core + OUTPUT: a `k+1`-core EXAMPLES:: @@ -4033,9 +3956,7 @@ def inner_shape(self): r""" Return the inner shape of the class of strong tableaux. - OUTPUT: - - - a `k+1`-core + OUTPUT: a `k+1`-core EXAMPLES:: @@ -4055,9 +3976,7 @@ def shape(self): If the ``self`` has an inner shape return a pair consisting of an inner and an outer shape. If the inner shape is empty then return only the outer shape. - OUTPUT: - - - a `k+1`-core or a pair of `k+1`-cores + OUTPUT: a `k+1`-core or a pair of `k+1`-cores EXAMPLES:: @@ -4125,8 +4044,8 @@ def standard_unmarked_iterator( cls, k, size, outer_shape=None, inner_shape=[] ) INPUT: - ``k``, ``size`` -- positive integers - - ``outer_shape`` -- a list representing a `k+1`-core (default: ``None``) - - ``inner_shape`` -- a list representing a `k+1`-core (default: ``[]``) + - ``outer_shape`` -- list representing a `k+1`-core (default: ``None``) + - ``inner_shape`` -- list representing a `k+1`-core (default: ``[]``) OUTPUT: @@ -4174,13 +4093,11 @@ def marked_given_unmarked_and_weight_iterator(cls, unmarkedT, k, weight): INPUT: - - ``unmarkedT`` -- a list of lists representing a strong unmarked tableau + - ``unmarkedT`` -- list of lists representing a strong unmarked tableau - ``k`` -- a positive integer - - ``weight`` -- a list of non-negative integers indicating the weight - - OUTPUT: + - ``weight`` -- list of nonnegative integers indicating the weight - - an iterator that returns ``StrongTableau`` objects + OUTPUT: an iterator that returns ``StrongTableau`` objects EXAMPLES:: @@ -4234,14 +4151,12 @@ def add_marking( cls, unmarkedT, marking, k, weight ): INPUT: - - ``unmarkedT`` -- a list of lists which is a partially marked strong `k`-tableau - - ``marking`` -- a list of pairs of coordinates where cells are to be marked - - ``k`` -- a positive integer - - ``weight`` -- a tuple of the weight of the output tableau - - OUTPUT: + - ``unmarkedT`` -- list of lists which is a partially marked strong `k`-tableau + - ``marking`` -- list of pairs of coordinates where cells are to be marked + - ``k`` -- positive integer + - ``weight`` -- tuple of the weight of the output tableau - - a ``StrongTableau`` object + OUTPUT: a ``StrongTableau`` object EXAMPLES:: @@ -4282,9 +4197,7 @@ def _left_action_list( cls, Tlist, tij, v, k ): - ``v`` -- the label to add to the tableau - ``k`` -- a positive integer - OUTPUT: - - - a list of lists, in particular, it is ``Tlist`` + OUTPUT: list of lists, in particular, it is ``Tlist`` EXAMPLES:: @@ -4331,11 +4244,9 @@ def follows_tableau_unsigned_standard( cls, Tlist, k ): INPUT: - ``Tlist`` -- a filling of a `k+1`-core as a list of lists - - ``k`` -- an integer - - OUTPUT: + - ``k`` -- integer - - a list of strong tableaux which follow ``Tlist`` in strong order + OUTPUT: list of strong tableaux which follow ``Tlist`` in strong order EXAMPLES:: @@ -4380,8 +4291,8 @@ def standard_marked_iterator( cls, k, size, outer_shape=None, inner_shape=[] ): - ``k`` -- a positive integer - ``size`` -- a positive integer - - ``outer_shape`` -- a list which is a `k+1`-core (default: ``None``) - - ``inner_shape`` -- a list which is a `k+1`-core (default: ``[]``) + - ``outer_shape`` -- list which is a `k+1`-core (default: ``None``) + - ``inner_shape`` -- list which is a `k+1`-core (default: ``[]``) OUTPUT: @@ -4485,9 +4396,7 @@ def marked_CST_to_transposition_sequence(self, T, k): - ``T`` -- a non-empty column strict tableau as a list of lists - ``k`` -- a positive integer - OUTPUT: - - - a list of pairs of values ``[i,j]`` representing the transpositions `t_{ij}` + OUTPUT: list of pairs of values ``[i,j]`` representing the transpositions `t_{ij}` EXAMPLES:: @@ -4565,9 +4474,7 @@ def transpositions_to_standard_strong( self, transeq, k, emptyTableau=[] ): - ``emptyTableau`` -- (default: ``[]``) an empty list or a skew strong tableau possibly consisting of ``None`` entries - OUTPUT: - - - a ``StrongTableau`` object + OUTPUT: a ``StrongTableau`` object EXAMPLES:: @@ -4607,9 +4514,7 @@ def nabs(v): - ``v`` -- either an integer or ``None`` - OUTPUT: - - - either a non-negative integer or ``None`` + OUTPUT: either a nonnegative integer or ``None`` EXAMPLES:: @@ -4633,9 +4538,7 @@ def intermediate_shapes(t): shapes, where the `i`-th shape is given by the shape of the subtableau on letters `1, 2, \ldots, i`. The output is the list of these shapes. - OUTPUT: - - - a list of lists representing partitions + OUTPUT: list of lists representing partitions EXAMPLES:: diff --git a/src/sage/combinat/kazhdan_lusztig.py b/src/sage/combinat/kazhdan_lusztig.py index eca077cd815..0014af47b73 100644 --- a/src/sage/combinat/kazhdan_lusztig.py +++ b/src/sage/combinat/kazhdan_lusztig.py @@ -46,7 +46,7 @@ class KazhdanLusztigPolynomial(UniqueRepresentation, SageObject): EXAMPLES:: - sage: W = WeylGroup("B3",prefix="s") + sage: W = WeylGroup("B3",prefix='s') sage: [s1,s2,s3] = W.simple_reflections() sage: R. = LaurentPolynomialRing(QQ) sage: KL = KazhdanLusztigPolynomial(W,q) @@ -66,7 +66,7 @@ def __init__(self, W, q, trace=False): EXAMPLES:: - sage: W = WeylGroup("B3",prefix="s") + sage: W = WeylGroup("B3",prefix='s') sage: R. = LaurentPolynomialRing(QQ) sage: KL = KazhdanLusztigPolynomial(W,q) sage: TestSuite(KL).run() @@ -95,7 +95,7 @@ def R(self, x, y): EXAMPLES:: sage: R.=QQ[] - sage: W = WeylGroup("A2", prefix="s") + sage: W = WeylGroup("A2", prefix='s') sage: [s1,s2]=W.simple_reflections() sage: KL = KazhdanLusztigPolynomial(W, q) sage: [KL.R(x,s2*s1) for x in [1,s1,s2,s1*s2]] @@ -114,7 +114,7 @@ def R(self, x, y): return self._base_ring.one() else: return self._base_ring.zero() - s = self._coxeter_group.simple_reflection(y.first_descent(side="left")) + s = self._coxeter_group.simple_reflection(y.first_descent(side='left')) if (s*x).length() < x.length(): ret = self.R(s*x,s*y) if self._trace: @@ -141,7 +141,7 @@ def R_tilde(self, x, y): EXAMPLES:: sage: R. = QQ[] - sage: W = WeylGroup("A2", prefix="s") + sage: W = WeylGroup("A2", prefix='s') sage: [s1,s2] = W.simple_reflections() sage: KL = KazhdanLusztigPolynomial(W, q) sage: [KL.R_tilde(x,s2*s1) for x in [1,s1,s2,s1*s2]] @@ -155,7 +155,7 @@ def R_tilde(self, x, y): return self._base_ring.zero() if x == y: return self._base_ring.one() - s = self._coxeter_group.simple_reflection(y.first_descent(side="right")) + s = self._coxeter_group.simple_reflection(y.first_descent(side='right')) if (x * s).length() < x.length(): ret = self.R_tilde(x * s, y * s) if self._trace: @@ -187,7 +187,7 @@ def P(self, x, y): EXAMPLES:: sage: R. = QQ[] - sage: W = WeylGroup("A3", prefix="s") + sage: W = WeylGroup("A3", prefix='s') sage: [s1,s2,s3] = W.simple_reflections() sage: KL = KazhdanLusztigPolynomial(W, q) sage: KL.P(s2,s2*s1*s3*s2) diff --git a/src/sage/combinat/knutson_tao_puzzles.py b/src/sage/combinat/knutson_tao_puzzles.py index c05d8f6e6d5..4dd3c170c08 100644 --- a/src/sage/combinat/knutson_tao_puzzles.py +++ b/src/sage/combinat/knutson_tao_puzzles.py @@ -308,9 +308,7 @@ def clockwise_rotation(self) -> NablaPiece: r""" Rotate the Nabla piece by 120 degree clockwise. - OUTPUT: - - - Nabla piece + OUTPUT: Nabla piece EXAMPLES:: @@ -327,9 +325,7 @@ def half_turn_rotation(self) -> DeltaPiece: r""" Rotate the Nabla piece by 180 degree. - OUTPUT: - - - Delta piece + OUTPUT: Delta piece EXAMPLES:: @@ -430,9 +426,7 @@ def clockwise_rotation(self) -> DeltaPiece: r""" Rotate the Delta piece by 120 degree clockwise. - OUTPUT: - - - Delta piece + OUTPUT: Delta piece EXAMPLES:: @@ -449,9 +443,7 @@ def half_turn_rotation(self) -> NablaPiece: r""" Rotate the Delta piece by 180 degree. - OUTPUT: - - - Nabla piece + OUTPUT: Nabla piece EXAMPLES:: @@ -1358,7 +1350,7 @@ def __iter__(self): for k in range(d + 1): yield self[k + 1, self._n - d + k] - def plot(self, labels=True, style="fill"): + def plot(self, labels=True, style='fill'): r""" Plot completed puzzle. @@ -1570,7 +1562,7 @@ class KnutsonTaoPuzzleSolver(UniqueRepresentation): (3, 4): 1/\0 0\/1, (4, 4): 1/1\1}] - The pieces in a puzzle filling are indexed by pairs of non-negative + The pieces in a puzzle filling are indexed by pairs of nonnegative integers `(i, j)` with `1 \leq i \leq j \leq n`, where `n` is the length of the word labelling the triangle edge. The pieces indexed by `(i, i)` are the triangles along the south edge of the puzzle. :: @@ -2064,9 +2056,7 @@ def _fill_piece(self, nw_label, ne_label, pieces) -> list[PuzzlePiece]: - ``nw_label``, ``nw_label`` -- label - ``pieces`` -- puzzle pieces used for the filling - OUTPUT: - - - list of the fillings + OUTPUT: list of the fillings EXAMPLES:: @@ -2094,9 +2084,7 @@ def _fill_strip(self, nw_labels, ne_label, pieces, final_pieces=None): - ``pieces`` -- puzzle pieces used for the filling - ``final_pieces`` -- pieces used for the last piece to be filled in - OUTPUT: - - - list of lists of the fillings + OUTPUT: list of lists of the fillings EXAMPLES:: diff --git a/src/sage/combinat/lr_tableau.py b/src/sage/combinat/lr_tableau.py index 90d60beda3b..953a244e99f 100644 --- a/src/sage/combinat/lr_tableau.py +++ b/src/sage/combinat/lr_tableau.py @@ -179,7 +179,7 @@ def __classcall_private__(cls, shape, weight): def __init__(self, shape, weight): r""" - Initializes the parent class of Littlewood-Richardson tableaux. + Initialize the parent class of Littlewood-Richardson tableaux. INPUT: diff --git a/src/sage/combinat/misc.py b/src/sage/combinat/misc.py index 2a4341e8f4c..e32aa946bcf 100644 --- a/src/sage/combinat/misc.py +++ b/src/sage/combinat/misc.py @@ -211,7 +211,7 @@ def _monomial_exponent_to_lower_factorial(me, x): def umbral_operation(poly): r""" - Returns the umbral operation `\downarrow` applied to poly. + Return the umbral operation `\downarrow` applied to poly. The umbral operation replaces each instance of `x_i^{a_i}` with diff --git a/src/sage/combinat/multiset_partition_into_sets_ordered.py b/src/sage/combinat/multiset_partition_into_sets_ordered.py index 39bbb8e5671..adfdf63251d 100755 --- a/src/sage/combinat/multiset_partition_into_sets_ordered.py +++ b/src/sage/combinat/multiset_partition_into_sets_ordered.py @@ -96,7 +96,7 @@ class OrderedMultisetPartitionIntoSets(ClonableArray, metaclass=InheritComparisonClasscallMetaclass): r""" - Ordered Multiset Partition into sets + Ordered Multiset Partition into sets. An *ordered multiset partition into sets* `c` of a multiset `X` is a list `[c_1, \ldots, c_r]` of nonempty subsets of `X` (note: not @@ -1127,7 +1127,7 @@ class OrderedMultisetPartitionsIntoSets(UniqueRepresentation, Parent): - Two Arguments: - + `A` -- a list (representing allowable letters within blocks of `c`), + + `A` -- list (representing allowable letters within blocks of `c`), or a positive integer (representing the maximal allowable letter) + `n` -- a nonnegative integer (the total number of letters within `c`) @@ -1912,7 +1912,7 @@ def subset(self, size): INPUT: - - ``size`` -- an integer representing a slice of all ordered + - ``size`` -- integer representing a slice of all ordered multiset partitions into sets The slice alluded to above is taken with respect to length, or @@ -3416,7 +3416,7 @@ class Element(ElementWrapper): Minimaj elements `b` are stored internally as pairs ``(w, breaks)``, where: - - ``w`` is a word of length ``self.parent().ell`` over the + - ``w`` -- a word of length ``self.parent().ell`` over the letters `1` up to ``self.parent().n``; - ``breaks`` is a list of de-concatenation points to turn ``w`` into a list of row words of (skew-)tableaux that represent diff --git a/src/sage/combinat/necklace.py b/src/sage/combinat/necklace.py index 9cfbe719cdc..45fb2921d27 100644 --- a/src/sage/combinat/necklace.py +++ b/src/sage/combinat/necklace.py @@ -47,7 +47,7 @@ def Necklaces(content): INPUT: - - ``content`` -- a list or tuple of non-negative integers + - ``content`` -- list or tuple of nonnegative integers EXAMPLES:: @@ -75,7 +75,7 @@ class Necklaces_evaluation(UniqueRepresentation, Parent): INPUT: - - ``content`` -- a list or tuple of non-negative integers + - ``content`` -- list or tuple of nonnegative integers """ @staticmethod def __classcall_private__(cls, content): @@ -134,7 +134,7 @@ def __contains__(self, x) -> bool: INPUT: - - ``x`` -- a list of integers + - ``x`` -- list of integers EXAMPLES:: @@ -456,7 +456,7 @@ def _sfc(content, equality=False): INPUT: - - ``content`` -- a list of non-negative integers with no leading 0s + - ``content`` -- list of nonnegative integers with no leading 0s - ``equality`` -- boolean (default: ``True``) .. WARNING:: diff --git a/src/sage/combinat/non_decreasing_parking_function.py b/src/sage/combinat/non_decreasing_parking_function.py index 532b4bf8762..49762560555 100644 --- a/src/sage/combinat/non_decreasing_parking_function.py +++ b/src/sage/combinat/non_decreasing_parking_function.py @@ -410,7 +410,7 @@ def __contains__(self, x) -> bool: def __iter__(self): """ - An iterator + An iterator. TESTS:: @@ -478,7 +478,7 @@ def __init__(self, n): """ n = Integer(n) if n < 0: - raise ValueError('%s is not a non-negative integer' % n) + raise ValueError('%s is not a nonnegative integer' % n) self.n = n Parent.__init__(self, category=Monoids().Enumerated().Finite()) diff --git a/src/sage/combinat/nu_dyck_word.py b/src/sage/combinat/nu_dyck_word.py index a3efff5fae2..e765ddd9f4d 100644 --- a/src/sage/combinat/nu_dyck_word.py +++ b/src/sage/combinat/nu_dyck_word.py @@ -128,15 +128,13 @@ def replace_dyck_symbol(x, open_char='N', close_char='E') -> str: INPUT: - - ``x`` -- either ``ndw_open_symbol`` or ``ndw_close_symbol``. + - ``x`` -- either ``ndw_open_symbol`` or ``ndw_close_symbol`` - - ``open_char`` -- str (optional) default ``'N'`` + - ``open_char`` -- string (optional) default ``'N'`` - - ``close_char`` -- str (optional) default ``'E'`` + - ``close_char`` -- string (optional) default ``'E'`` - OUTPUT: - - - If ``x`` is ``ndw_open_symbol``, replace ``x`` with ``open_char``. + OUTPUT: if ``x`` is ``ndw_open_symbol``, replace ``x`` with ``open_char`` - If ``x`` is ``ndw_close_symbol``, replace ``x`` with ``close_char``. @@ -178,9 +176,9 @@ class NuDyckWord(CombinatorialElement): INPUT: - - k1 -- A path for the `\nu`-Dyck word + - ``k1`` -- a path for the `\nu`-Dyck word - - k2 -- A path for `\nu` + - ``k2`` -- a path for `\nu` EXAMPLES:: @@ -332,7 +330,7 @@ def __le__(self, other): def __lt__(self, other): """ - Return if one path is strictly included in another + Return if one path is strictly included in another. EXAMPLES:: @@ -354,7 +352,7 @@ def __lt__(self, other): def __ge__(self, other): """ - Return if one path is included in another + Return if one path is included in another. EXAMPLES:: @@ -378,7 +376,7 @@ def __ge__(self, other): def __gt__(self, other): """ - Return if one path is strictly included in another + Return if one path is strictly included in another. EXAMPLES:: @@ -1140,7 +1138,7 @@ class NuDyckWords(Parent): INPUT: - - ``nu`` -- the base lattice path. + - ``nu`` -- the base lattice path EXAMPLES:: @@ -1402,9 +1400,7 @@ def to_word_path(word): - ``word`` -- word to convert to wordpath - OUTPUT: - - - A ``FiniteWordPath_north_east`` object. + OUTPUT: a ``FiniteWordPath_north_east`` object EXAMPLES:: @@ -1447,9 +1443,9 @@ def path_weakly_above_other(path, other) -> bool: INPUT: - - ``path`` -- The path to verify is weakly above the other path. + - ``path`` -- the path to verify is weakly above the other path - - ``other`` -- The other path to verify is weakly below the path. + - ``other`` -- the other path to verify is weakly below the path OUTPUT: bool diff --git a/src/sage/combinat/nu_tamari_lattice.py b/src/sage/combinat/nu_tamari_lattice.py index 21b3a59fdc3..29c2e90bf6a 100644 --- a/src/sage/combinat/nu_tamari_lattice.py +++ b/src/sage/combinat/nu_tamari_lattice.py @@ -76,7 +76,7 @@ def NuTamariLattice(nu): INPUT: - - `\nu` -- a list of 0s and 1s or a string of 0s and 1s. + - `\nu` -- list of 0s and 1s or a string of 0s and 1s OUTPUT: a finite lattice @@ -131,13 +131,11 @@ def delta_swap(p, k, delta): - ``p`` -- a `\nu`-Dyck word - - ``k`` -- an integer between `0` and ``p.length()-1`` + - ``k`` -- integer between `0` and ``p.length()-1`` - - ``delta`` -- a list of nonnegative integers of length ``p.height()`` + - ``delta`` -- list of nonnegative integers of length ``p.height()`` - OUTPUT: - - - a `\nu`-Dyck word + OUTPUT: a `\nu`-Dyck word EXAMPLES:: @@ -206,13 +204,11 @@ def AltNuTamariLattice(nu, delta=None): INPUT: - - `\nu` -- a list of 0s and 1s or a string of 0s and 1s. - - - `\delta` -- a list of nonnegative integers. + - `\nu` -- list of 0s and 1s or a string of 0s and 1s - OUTPUT: + - `\delta` -- list of nonnegative integers - - a finite lattice + OUTPUT: a finite lattice EXAMPLES:: diff --git a/src/sage/combinat/ordered_tree.py b/src/sage/combinat/ordered_tree.py index d7099b95cc6..898ede38e0a 100644 --- a/src/sage/combinat/ordered_tree.py +++ b/src/sage/combinat/ordered_tree.py @@ -277,7 +277,7 @@ def is_empty(self): """ return False - def _to_binary_tree_rec(self, bijection="left"): + def _to_binary_tree_rec(self, bijection='left'): r""" Internal recursive method to obtain a binary tree from an ordered tree. @@ -290,12 +290,12 @@ def _to_binary_tree_rec(self, bijection="left"): sage: T = OrderedTree([[],[]]) sage: T._to_binary_tree_rec() [[., .], .] - sage: T._to_binary_tree_rec(bijection="right") + sage: T._to_binary_tree_rec(bijection='right') [., [., .]] sage: T = OrderedTree([[], [[], []], [[], [[]]]]) sage: T._to_binary_tree_rec() [[[., .], [[., .], .]], [[., .], [., .]]] - sage: T._to_binary_tree_rec(bijection="right") + sage: T._to_binary_tree_rec(bijection='right') [., [[., [., .]], [[., [[., .], .]], .]]] """ from sage.combinat.binary_tree import BinaryTree @@ -493,7 +493,7 @@ def to_binary_tree_right_branch(self): sage: T == T.to_binary_tree_right_branch().to_ordered_tree_right_branch() True """ - return self._to_binary_tree_rec(bijection="right") + return self._to_binary_tree_rec(bijection='right') @combinatorial_map(name="To Dyck path") def to_dyck_word(self): @@ -591,8 +591,8 @@ def to_poset(self, root_to_leaf=False): INPUT: - - ``root_to_leaf`` -- boolean, true if the poset orientation should - be from root to leaves. It is false by default. + - ``root_to_leaf`` -- boolean (default: ``False``); ``True`` if the + poset orientation should be from root to leaves EXAMPLES:: @@ -709,8 +709,7 @@ def plot(self): except AttributeError: root = 1 g = self.canonical_labelling().to_undirected_graph() - return g.plot(layout='tree', tree_root=root, - tree_orientation="down") + return g.plot(layout='tree', tree_root=root, tree_orientation='down') def sort_key(self): """ @@ -775,7 +774,7 @@ def normalize(self, inplace=False): INPUT: - - ``inplace`` -- boolean, (default ``False``) if ``True``, + - ``inplace`` -- boolean (default: ``False``); if ``True``, then ``self`` is modified and nothing returned. Otherwise the normalized tree is returned. @@ -835,7 +834,7 @@ def normalize(self, inplace=False): # Abstract class to serve as a Factory no instance are created. class OrderedTrees(UniqueRepresentation, Parent): """ - Factory for ordered trees + Factory for ordered trees. INPUT: @@ -887,7 +886,7 @@ def __classcall_private__(cls, n=None): @cached_method def leaf(self): """ - Return a leaf tree with ``self`` as parent + Return a leaf tree with ``self`` as parent. EXAMPLES:: @@ -963,7 +962,7 @@ def __contains__(self, x): def unlabelled_trees(self): """ - Return the set of unlabelled trees associated to ``self`` + Return the set of unlabelled trees associated to ``self``. EXAMPLES:: @@ -974,7 +973,7 @@ def unlabelled_trees(self): def labelled_trees(self): """ - Return the set of labelled trees associated to ``self`` + Return the set of labelled trees associated to ``self``. EXAMPLES:: @@ -1006,7 +1005,7 @@ def _element_constructor_(self, *args, **keywords): class OrderedTrees_size(OrderedTrees): """ - The enumerated sets of binary trees of a given size + The enumerated sets of binary trees of a given size. EXAMPLES:: @@ -1063,7 +1062,7 @@ def _an_element_(self): def cardinality(self): """ - The cardinality of ``self`` + The cardinality of ``self``. This is a Catalan number. @@ -1112,7 +1111,7 @@ def random_element(self): def __iter__(self): """ - A basic generator + A basic generator. .. TODO:: could be optimized. @@ -1138,7 +1137,7 @@ def __iter__(self): @lazy_attribute def _parent_for(self): """ - Return the parent of the element generated by ``self`` + Return the parent of the element generated by ``self``. TESTS:: @@ -1150,7 +1149,7 @@ def _parent_for(self): @lazy_attribute def element_class(self): """ - The class of the element of ``self`` + The class of the element of ``self``. EXAMPLES:: @@ -1192,7 +1191,7 @@ class LabelledOrderedTree(AbstractLabelledClonableTree, OrderedTree): INPUT: - - ``children`` -- a list or tuple or more generally any iterable + - ``children`` -- list or tuple or more generally any iterable of trees or object convertible to trees - ``label`` -- any Sage object (default: ``None``) @@ -1398,7 +1397,7 @@ def _an_element_(self): t = LT([], label=3) t1 = LT([t, t], label=42) t2 = LT([[]], label=5) - return LT([t, t1, t2], label="toto") + return LT([t, t1, t2], label='toto') def _element_constructor_(self, *args, **keywords): """ diff --git a/src/sage/combinat/output.py b/src/sage/combinat/output.py index 7f223921d7e..fb39dc91a00 100644 --- a/src/sage/combinat/output.py +++ b/src/sage/combinat/output.py @@ -28,9 +28,9 @@ def tex_from_array(array, with_lines=True): INPUT: - - ``array`` -- a list of list - - ``with_lines`` -- a boolean (default: ``True``) - Whether to draw a line to separate the entries in the array. + - ``array`` -- list of list + - ``with_lines`` -- boolean (default: ``True``); whether to draw a line to + separate the entries in the array. Empty rows are allowed; however, such rows should be given as ``[None]`` rather than ``[]``. @@ -249,8 +249,8 @@ def tex_from_array_tuple(a_tuple, with_lines=True): INPUT: - ``a_tuple`` -- a tuple of lists of lists - - ``with_lines`` -- a boolean (default: ``True``) - Whether to draw lines to separate the entries in the components of ``a_tuple``. + - ``with_lines`` -- boolean (default: ``True``); whether to draw lines to + separate the entries in the components of ``a_tuple``. .. SEEALSO:: :meth:`tex_from_array` for the description of each array @@ -347,12 +347,12 @@ def tex_from_skew_array(array, with_lines=False, align='b'): INPUT: - - ``array`` -- The array + - ``array`` -- the array - - ``with_lines`` -- (Default: ``False``) If ``True`` lines are drawn, if + - ``with_lines`` -- (default: ``False``) if ``True`` lines are drawn, if ``False`` they are not - - ``align`` -- (Default: ``'b'``) Determines the alignment on the latex + - ``align`` -- (default: ``'b'``); determine the alignment on the latex array environments EXAMPLES:: @@ -412,7 +412,7 @@ def end_line(r): return tex+r'\end{array}$'+raisebox_end -def ascii_art_table(data, use_unicode=False, convention="English"): +def ascii_art_table(data, use_unicode=False, convention='English'): r""" Return an ascii art table of ``data``. @@ -772,7 +772,7 @@ def box_exists(tab, i, j): INPUT: - - ``tab`` -- a list of lists + - ``tab`` -- list of lists - ``i`` -- first coordinate - ``j`` -- second coordinate diff --git a/src/sage/combinat/parallelogram_polyomino.py b/src/sage/combinat/parallelogram_polyomino.py index 42ddf42b69a..196a9644fb8 100644 --- a/src/sage/combinat/parallelogram_polyomino.py +++ b/src/sage/combinat/parallelogram_polyomino.py @@ -62,7 +62,7 @@ class LocalOptions: INPUT: - - ``name`` -- The name of the LocalOptions + - ``name`` -- the name of the LocalOptions - ``=dict(...)`` -- dictionary specifying an option @@ -111,7 +111,7 @@ def __init__(self, name='', **options): INPUT: - - ``name`` -- The name of the LocalOptions + - ``name`` -- the name of the LocalOptions - ``=dict(...)`` -- dictionary specifying an option @@ -205,9 +205,9 @@ def __setitem__(self, key, value): INPUT: - - ``key`` -- An option. + - ``key`` -- an option - - ``value`` -- The value. + - ``value`` -- the value EXAMPLES:: @@ -274,10 +274,10 @@ def __call__(self, *get_values, **options): INPUT: - - ``get_values`` -- The options to be printed. + - ``get_values`` -- the options to be printed - ``=dict(...)`` -- dictionary specifying an option see - :class:`LocalOptions` for more details. + :class:`LocalOptions` for more details EXAMPLES:: @@ -303,10 +303,10 @@ def __call__(self, *get_values, **options): ....: ) sage: o("display") 'list' - sage: o(display="diagram") + sage: o(display='diagram') sage: o("display") 'diagram' - sage: o(display="?") + sage: o(display='?') Current value : diagram {'default': 'list', 'values': {'diagram': 'diagram representation', @@ -325,7 +325,7 @@ def __getitem__(self, key): INPUT: - - ``key`` -- An option. + - ``key`` -- an option EXAMPLES:: @@ -606,8 +606,8 @@ def __init__(self, options, XY=lambda v: v): - ``options`` -- drawing options - - ``XY`` -- A user function to convert vector in other vector. - (default : identity function) + - ``XY`` -- a user function to convert vector in other vector + (default: identity function) EXAMPLES:: @@ -643,9 +643,9 @@ def XY(self, v): INPUT: - - ``v`` -- The vector to transform. + - ``v`` -- the vector to transform - OUTPUT: a list of 2 floats encoding a vector + OUTPUT: list of 2 floats encoding a vector EXAMPLES:: @@ -675,9 +675,9 @@ def translate(pos, v): INPUT: - - ``pos`` -- The position to translate. + - ``pos`` -- the position to translate - - ``v`` -- The translation vector. + - ``v`` -- the translation vector OUTPUT: @@ -691,9 +691,9 @@ def rotate(pos, angle): INPUT: - - ``pos`` -- The position to rotate. + - ``pos`` -- the position to rotate - - ``angle`` -- The angle of rotation. + - ``angle`` -- the angle of rotation OUTPUT: @@ -708,9 +708,9 @@ def mirror(pos, axe): INPUT: - - ``pos`` -- The position to mirror. + - ``pos`` -- the position to mirror - - ``axe`` -- The axe vector. + - ``axe`` -- the axe vector OUTPUT: @@ -745,15 +745,15 @@ def draw_line(self, v1, v2, color=None, size=None): INPUT: - - ``v1`` -- point, The first point of the line. + - ``v1`` -- point, The first point of the line - - ``v2`` -- point, The second point of the line. + - ``v2`` -- point, The second point of the line - - ``color`` -- string (default:``None``), The color of the line. + - ``color`` -- string (default: ``None``); the color of the line. If set to ``None``, the color is chosen according the drawing option given by ``_drawing_tool``. - - ``size`` -- integer (default:``None``), The size of the line. + - ``size`` -- integer (default: ``None``); the size of the line. If set to ``None``, the size is chosen according the drawing option given by ``_drawing_tool``. @@ -786,13 +786,13 @@ def draw_polyline(self, list_of_vertices, color=None, size=None): INPUT: - - ``list_of_vertices`` -- A list of points + - ``list_of_vertices`` -- a list of points - - ``color`` -- string (default:``None``), The color of the line. + - ``color`` -- string (default: ``None``); the color of the line. If set to ``None``, the color is chosen according the drawing option given by ``_drawing_tool``. - - ``size`` -- integer (default:``None``), The size of the line. + - ``size`` -- integer (default: ``None``); the size of the line. If set to ``None``, the size is chosen according the drawing option given by ``_drawing_tool``. @@ -823,13 +823,13 @@ def draw_point(self, p1, color=None, size=None): INPUT: - - ``p1`` -- A point + - ``p1`` -- a point - - ``color`` -- string (default:``None``), The color of the line. + - ``color`` -- string (default: ``None``); the color of the line. If set to ``None``, the color is chosen according the drawing option given by ``_drawing_tool``. - - ``size`` -- integer (default:``None``), The size of the line. + - ``size`` -- integer (default: ``None``); the size of the line. If set to ``None``, the size is chosen according the drawing option given by ``_drawing_tool``. @@ -1116,7 +1116,7 @@ def __hash__(self): def __copy__(self): r""" - Copy a parallelogram Polyomino + Copy a parallelogram Polyomino. EXAMPLES:: @@ -1298,7 +1298,7 @@ def to_dyck_word(self, bijection=None): INPUT: - - ``bijection`` -- string or ``None`` (default:``None``) The name of + - ``bijection`` -- string or ``None`` (default: ``None``); the name of the bijection. If it is set to ``None`` then the ``'Delest-Viennot'`` bijection is used. Expected values are ``None``, ``'Delest-Viennot'``, or ``'Delest-Viennot-beta'``. @@ -1422,8 +1422,8 @@ def from_dyck_word(dyck, bijection=None): - ``dyck`` -- a Dyck word - - ``bijection`` -- string or ``None`` (default:``None``) the bijection - to use. See :meth:`to_dyck_word` for more details. + - ``bijection`` -- string or ``None`` (default: ``None``); the + bijection to use. See :meth:`to_dyck_word` for more details. OUTPUT: a parallelogram polyomino @@ -1456,8 +1456,8 @@ def _to_binary_tree_Aval_Boussicault(self, position=None): INPUT: - - ``position`` -- the cell position. This is a recursive parameter. - It should not be used directly. + - ``position`` -- the cell position; this is a recursive parameter + It should not be used directly EXAMPLES:: @@ -1513,7 +1513,7 @@ def to_binary_tree(self, bijection=None): INPUT: - - ``bijection`` -- string or ``None`` (default:``None``) The name of + - ``bijection`` -- string or ``None`` (default: ``None``); the name of bijection to use for the conversion. The possible values are ``None`` or ``'Aval-Boussicault'``. The ``None`` value is equivalent to ``'Aval-Boussicault'``. @@ -1706,7 +1706,7 @@ def to_ordered_tree(self, bijection=None): INPUT: - - ``bijection`` -- string or ``None`` (default:``None``) The name of + - ``bijection`` -- string or ``None`` (default: ``None``); the name of bijection to use for the conversion. The possible value are ``None``, ``'Boussicault-Socci'`` or ``'via dyck and Delest-Viennot'``. The ``None`` value is equivalent to the ``'Boussicault-Socci'`` @@ -1855,11 +1855,11 @@ def _prefix_lengths(word, up): INPUT: - - ``word`` -- a word of 0 and 1. + - ``word`` -- a word of 0 and 1 - ``up`` -- 0 or 1 (a letter of the word) - OUTPUT: a list of integers + OUTPUT: list of integers EXAMPLES:: @@ -1886,7 +1886,7 @@ def upper_heights(self): Return the list of heights associated to each vertical step of the parallelogram polyomino's upper path. - OUTPUT: a list of integers + OUTPUT: list of integers EXAMPLES:: @@ -1904,7 +1904,7 @@ def lower_heights(self): Return the list of heights associated to each vertical step of the parallelogram polyomino's lower path. - OUTPUT: a list of integers + OUTPUT: list of integers EXAMPLES:: @@ -1922,7 +1922,7 @@ def upper_widths(self): Return the list of widths associated to each horizontal step of the parallelogram polyomino's upper path. - OUTPUT: a list of integers + OUTPUT: list of integers EXAMPLES:: @@ -1940,7 +1940,7 @@ def lower_widths(self): Return the list of widths associated to each horizontal step of the parallelogram polyomino's lower path. - OUTPUT: a list of integers + OUTPUT: list of integers EXAMPLES:: @@ -2062,7 +2062,7 @@ def is_k_directed(self, k) -> bool: INPUT: - - ``k`` -- A non negative integer. + - ``k`` -- nonnegative integer EXAMPLES:: @@ -2190,9 +2190,9 @@ def cell_is_inside(self, w, h): INPUT: - - ``w`` -- The x coordinate of the box position. + - ``w`` -- the x coordinate of the box position - - ``h`` -- The y coordinate of the box position. + - ``h`` -- the y coordinate of the box position OUTPUT: @@ -2288,7 +2288,7 @@ class _polyomino_row: def __init__(self, polyomino, row): r""" - The constructor of the class + The constructor of the class. EXAMPLES:: @@ -3052,12 +3052,12 @@ def get_node_position_from_box(self, box_position, direction, nb_crossed_nodes=N INPUT: - - ``box_position`` -- the position of the statring cell. + - ``box_position`` -- the position of the statring cell - - ``direction`` -- the direction (0 or 1). + - ``direction`` -- the direction (0 or 1) - ``nb_crossed_nodes`` -- ``[0]`` (default) a list containing just one - integer. + integer OUTPUT: a [row,column] position of the cell @@ -3126,7 +3126,7 @@ def box_is_node(self, pos) -> bool: INPUT: - - ``pos`` -- the [x,y] coordinate of the box. + - ``pos`` -- the [x,y] coordinate of the box OUTPUT: boolean @@ -3164,7 +3164,7 @@ def box_is_root(self, box) -> bool: INPUT: - - ``box`` -- the x,y coordinate of the cell. + - ``box`` -- the x,y coordinate of the cell EXAMPLES:: @@ -3198,9 +3198,9 @@ def _get_number_of_nodes_in_the_bounding_path(self, box, direction): INPUT: - ``box`` -- the x,y coordinate of the starting point of the bounding - path. + path - ``direction`` -- the initial direction of the bounding path (1 or 0, - 1 for left and 0 for top). + 1 for left and 0 for top). EXAMPLES:: @@ -3280,9 +3280,9 @@ def _get_path_in_pair_of_tree_from_row(self, line): INPUT: - - ``line`` -- the x coordinate of the line. + - ``line`` -- the x coordinate of the line - OUTPUT: a list of integers + OUTPUT: list of integers EXAMPLES:: @@ -3339,9 +3339,9 @@ def _get_path_in_pair_of_tree_from_column(self, column): INPUT: - - ``column`` -- the y coordinate of the column. + - ``column`` -- the y coordinate of the column - OUTPUT: a list of integers + OUTPUT: list of integers EXAMPLES:: @@ -3458,7 +3458,7 @@ def get_left_BS_nodes(self): the Boussicault-Socci bijection between parallelogram polyominoes and pair of ordered trees. - OUTPUT: a list of [row,column] position of cells + OUTPUT: list of [row,column] position of cells EXAMPLES:: @@ -3656,7 +3656,7 @@ def geometry(self) -> list: def _plot_diagram(self): r""" - Return a plot of the diagram representing ``self`` + Return a plot of the diagram representing ``self``. TESTS:: @@ -3969,7 +3969,7 @@ def __call__(self, size=None, policy=None): INPUT: - - ``size`` -- integer (default: ``None``), the size of the parallelogram + - ``size`` -- integer (default: ``None``); the size of the parallelogram polyominoes contained in the family. If set to ``None``, the family returned contains all the parallelogram polyominoes. diff --git a/src/sage/combinat/parking_functions.py b/src/sage/combinat/parking_functions.py index 06ce08b87f0..f94522d57d5 100644 --- a/src/sage/combinat/parking_functions.py +++ b/src/sage/combinat/parking_functions.py @@ -460,10 +460,7 @@ def lucky_cars(self): # the set of cars that can park in their preferred spo ``lucky_cars(PF) = [1, 2, 7]`` means that cars 1, 2 and 7 parked in their preferred spots and all the other cars did not. - - OUTPUT: - - - the cars that can park in their preferred spots + OUTPUT: the cars that can park in their preferred spots EXAMPLES:: @@ -488,9 +485,7 @@ def luck(self) -> Integer: # the number of lucky cars Return the number of cars that parked in their preferred parking spots (see [Shin]_ p. 33). - OUTPUT: - - - the number of cars that parked in their preferred parking spots + OUTPUT: the number of cars that parked in their preferred parking spots EXAMPLES:: @@ -574,9 +569,7 @@ def dinversion_pairs(self) -> list[tuple[int, int]]: Return the descent inversion pairs of a labelled Dyck path corresponding to the parking function. - OUTPUT: - - - the primary and secondary diversion pairs + OUTPUT: the primary and secondary diversion pairs EXAMPLES:: @@ -602,9 +595,7 @@ def dinv(self) -> int: Same as the cardinality of :meth:`dinversion_pairs`. - OUTPUT: - - - the number of dinversion pairs + OUTPUT: the number of dinversion pairs EXAMPLES:: @@ -793,9 +784,7 @@ def to_labelling_permutation(self) -> Permutation: r""" Return the labelling of the support Dyck path of the parking function. - OUTPUT: - - - the labelling of the Dyck path + OUTPUT: the labelling of the Dyck path EXAMPLES:: @@ -820,9 +809,7 @@ def to_area_sequence(self) -> list: Return the area sequence of the support Dyck path of the parking function. - OUTPUT: - - - the area sequence of the Dyck path + OUTPUT: the area sequence of the Dyck path EXAMPLES:: @@ -877,9 +864,7 @@ def to_dyck_word(self) -> DyckWord: r""" Return the support Dyck word of the parking function. - OUTPUT: - - - the Dyck word of the corresponding parking function + OUTPUT: the Dyck word of the corresponding parking function .. SEEALSO:: :meth:`DyckWord` @@ -970,9 +955,7 @@ def to_NonDecreasingParkingFunction(self) -> PF: Return the non-decreasing parking function which underlies the parking function. - OUTPUT: - - - a sorted parking function + OUTPUT: a sorted parking function .. SEEALSO:: :meth:`NonDecreasingParkingFunction` @@ -1014,9 +997,7 @@ def characteristic_quasisymmetric_function(self, q=None, - ``R`` -- (default: ``R = QQ['q','t'].fraction_field()``) the base ring to do the calculations over - OUTPUT: - - - an element of the quasisymmetric functions over the ring ``R`` + OUTPUT: an element of the quasisymmetric functions over the ring ``R`` EXAMPLES:: @@ -1328,7 +1309,7 @@ def __classcall_private__(cls, n=None): return ParkingFunctions_all() if not isinstance(n, (Integer, int)) or n < 0: - raise ValueError("%s is not a non-negative integer" % n) + raise ValueError("%s is not a nonnegative integer" % n) return ParkingFunctions_n(n) diff --git a/src/sage/combinat/partition.py b/src/sage/combinat/partition.py index e47523c15ce..8844265a3bd 100644 --- a/src/sage/combinat/partition.py +++ b/src/sage/combinat/partition.py @@ -520,7 +520,7 @@ def __init__(self, parent, mu): Initialize ``self``. We assume that ``mu`` is a weakly decreasing list of - non-negative elements in ``ZZ``. + nonnegative elements in ``ZZ``. EXAMPLES:: @@ -851,7 +851,7 @@ def _latex_(self): \end{array}$} } - sage: Partitions.options(latex="young_diagram", convention="french") + sage: Partitions.options(latex='young_diagram', convention='french') sage: Partitions.options.latex='exp_high'; latex(mu) # indirect doctest 2,1 sage: Partitions.options.latex='exp_low'; latex(mu) # indirect doctest @@ -970,7 +970,7 @@ def ferrers_diagram(self): EXAMPLES:: sage: mu = Partition([5,5,2,1]) - sage: Partitions.options(diagram_str='*', convention="english") + sage: Partitions.options(diagram_str='*', convention='english') sage: print(mu.ferrers_diagram()) ***** ***** @@ -1463,10 +1463,10 @@ def has_rectangle(self, h, w): INPUT: - - ``h`` -- An integer `h \geq 1`. The (*minimum*) height of the - rectangle. + - ``h`` -- integer `h \geq 1`; the (*minimum*) height of the + rectangle - - ``w`` -- An integer `w \geq 1`. The width of the rectangle. + - ``w`` -- integer `w \geq 1`; the width of the rectangle EXAMPLES:: @@ -1655,16 +1655,16 @@ def next_within_bounds(self, min=[], max=None, partition_type=None): INPUT: - - ``min`` -- (default ``[]``, the empty partition) The - 'minimum partition' that ``next_within_bounds(self)`` must contain. + - ``min`` -- (default: ``[]``, the empty partition) the + 'minimum partition' that ``next_within_bounds(self)`` must contain - - ``max`` -- (default ``None``) The 'maximum partition' that - ``next_within_bounds(self)`` must be contained in. If set to ``None``, - then there is no restriction. + - ``max`` -- (default: ``None``) the 'maximum partition' that + ``next_within_bounds(self)`` must be contained in; if set to ``None``, + then there is no restriction - - ``partition_type`` -- (default ``None``) The type of partitions - allowed. For example, 'strict' for strictly decreasing partitions, or - ``None`` to allow any valid partition. + - ``partition_type`` -- (default: ``None``) the type of partitions + allowed; for example, 'strict' for strictly decreasing partitions, or + ``None`` to allow any valid partition EXAMPLES:: @@ -1851,7 +1851,7 @@ def down_list(self): return list(self.down()) @combinatorial_map(name="cell poset") - def cell_poset(self, orientation="SE"): + def cell_poset(self, orientation='SE'): """ Return the Young diagram of ``self`` as a poset. The optional keyword variable ``orientation`` determines the order relation @@ -1860,10 +1860,10 @@ def cell_poset(self, orientation="SE"): The poset always uses the set of cells of the Young diagram of ``self`` as its ground set. The order relation of the poset depends on the ``orientation`` variable (which defaults to - ``"SE"``). Concretely, ``orientation`` has to be specified to - one of the strings ``"NW"``, ``"NE"``, ``"SW"``, and ``"SE"``, + ``'SE'``). Concretely, ``orientation`` has to be specified to + one of the strings ``"NW"``, ``"NE"``, ``'SW'``, and ``'SE'``, standing for "northwest", "northeast", "southwest" and - "southeast", respectively. If ``orientation`` is ``"SE"``, then + "southeast", respectively. If ``orientation`` is ``'SE'``, then the order relation of the poset is such that a cell `u` is greater or equal to a cell `v` in the poset if and only if `u` lies weakly southeast of `v` (this means that `u` can be @@ -2600,7 +2600,7 @@ def suter_diagonal_slide(self, n, exp=1): northwestern most cell in English notation) of `\lambda` is less than `n`, including the empty partition. - The map `\sigma_n` sends a partition (with non-zero entries) + The map `\sigma_n` sends a partition (with nonzero entries) `(\lambda_1, \lambda_2, \ldots, \lambda_m) \in Y_n` to the partition `(\lambda_2 + 1, \lambda_3 + 1, \ldots, \lambda_m + 1, \underbrace{1, 1, \ldots, 1}_{n - m - \lambda_1\text{ ones}})`. @@ -3142,9 +3142,7 @@ def degree(self, e): - ``e`` -- an integer `e > 1` - OUTPUT: - - A non-negative integer. + OUTPUT: nonnegative integer EXAMPLES:: @@ -3180,9 +3178,7 @@ def prime_degree(self, p): - ``p`` -- a prime integer - OUTPUT: - - A non-negative integer + OUTPUT: nonnegative integer The degree of a partition `\lambda` is the sum of the `e`-:meth:`degree` of the standard tableaux of shape `\lambda`, for @@ -3224,7 +3220,7 @@ def arm_length(self, i, j): - ``i``, ``j`` -- two integers - OUTPUT: an integer or a :class:`ValueError` + OUTPUT: integer or a :class:`ValueError` EXAMPLES:: @@ -3283,7 +3279,7 @@ def arm_cells(self, i, j): - ``i``, ``j`` -- two integers - OUTPUT: a list of pairs of integers + OUTPUT: list of pairs of integers EXAMPLES:: @@ -3314,7 +3310,7 @@ def leg_length(self, i, j): - ``i``, ``j`` -- two integers - OUTPUT: an integer or a :class:`ValueError` + OUTPUT: integer or a :class:`ValueError` EXAMPLES:: @@ -3374,7 +3370,7 @@ def leg_cells(self, i, j): - ``i``, ``j`` -- two integers - OUTPUT: a list of pairs of integers + OUTPUT: list of pairs of integers EXAMPLES:: @@ -3946,7 +3942,7 @@ def block(self, e, multicharge=(0,)): - ``e`` -- the quantum characteristic - - ``multicharge`` -- the multicharge (default `(0,)`) + - ``multicharge`` -- the multicharge (default: `(0,)`) OUTPUT: @@ -4014,12 +4010,10 @@ def defect(self, e, multicharge=(0,)): - ``e`` -- the quantum characteristic - - ``multicharge`` -- the multicharge (default `(0,)`) + - ``multicharge`` -- the multicharge (default: `(0,)`) - OUTPUT: - - - a non-negative integer, which is the defect of the block - containing the partition ``self`` + OUTPUT: nonnegative integer, which is the defect of the block + containing the partition ``self`` EXAMPLES:: @@ -4111,7 +4105,7 @@ def is_regular(self, e, multicharge=(0,)) -> bool: Return ``True`` is this is an ``e``-regular partition. A partition is `e`-regular if it does not have `e` equal - non-zero parts. + nonzero parts. EXAMPLES:: @@ -4680,11 +4674,9 @@ def k_irreducible(self, k): INPUT: - - ``k`` -- a non-negative integer - - OUTPUT: + - ``k`` -- a nonnegative integer - - a partition + OUTPUT: a partition EXAMPLES:: @@ -5357,7 +5349,7 @@ def dimension(self, smaller=None, k=1): - ``smaller`` -- a partition (default: an empty list ``[]``) - - `k` -- a positive integer (default: 1) + - ``k`` -- a positive integer (default: 1) OUTPUT: the number of such paths @@ -5505,7 +5497,7 @@ def outline(self, variable=None): INPUT: - - variable -- a variable (default: ``'x'`` in the symbolic ring) + - ``variable`` -- a variable (default: ``'x'`` in the symbolic ring) EXAMPLES:: @@ -6185,7 +6177,7 @@ def __classcall_private__(cls, n=None, **kwargs): kwargs['max_slope'] = min(0, kwargs.get('max_slope', 0)) if kwargs.get('min_slope', -float('inf')) > 0: - raise ValueError("the minimum slope must be non-negative") + raise ValueError("the minimum slope must be nonnegative") if 'outer' in kwargs: kwargs['max_length'] = min(len(kwargs['outer']), @@ -6230,8 +6222,8 @@ def __init__(self, is_infinite=False): INPUT: - - ``is_infinite`` -- (Default: ``False``) If ``True``, then the number - of partitions in this set is infinite. + - ``is_infinite`` -- boolean (default: ``False``); if ``True``, then + the number of partitions in this set is infinite EXAMPLES:: @@ -6279,13 +6271,13 @@ class options(GlobalOptions): <4,2,2,1> sage: Partitions.options(latex=lambda mu: '\\Diagram{%s}' % ','.join('%s'%m for m in mu._list)); latex(P) \Diagram{4,2,2,1} - sage: Partitions.options(display="diagram", diagram_str="#") + sage: Partitions.options(display='diagram', diagram_str='#') sage: P #### ## ## # - sage: Partitions.options(diagram_str="*", convention="french") + sage: Partitions.options(diagram_str='*', convention='french') sage: print(P.ferrers_diagram()) * ** @@ -6601,11 +6593,11 @@ def from_beta_numbers(self, beta): Return a partition corresponding to a sequence of beta numbers. A sequence of beta numbers is a strictly increasing sequence - `0 \leq b_1 < \cdots < b_k` of non-negative integers. The + `0 \leq b_1 < \cdots < b_k` of nonnegative integers. The corresponding partition `\mu = (\mu_k, \ldots, \mu_1)` is given by `\mu_i = [1,i) \setminus \{ b_1, \ldots, b_i \}`. This gives - a bijection from the set of partitions with at most `k` non-zero parts - to the set of strictly increasing sequences of non-negative integers + a bijection from the set of partitions with at most `k` nonzero parts + to the set of strictly increasing sequences of nonnegative integers of length `k`. EXAMPLES:: @@ -6876,12 +6868,12 @@ def cardinality(self, algorithm='flint'): INPUT: - - ``algorithm`` -- (default: ``'flint'``) + - ``algorithm`` -- (default: ``'flint'``) - ``'flint'`` -- use FLINT (currently the fastest) - ``'gap'`` -- use GAP (VERY *slow*) - ``'pari'`` -- use PARI. Speed seems the same as GAP until - `n` is in the thousands, in which case PARI is faster. + `n` is in the thousands, in which case PARI is faster It is possible to associate with every partition of the integer `n` a conjugacy class of permutations in the symmetric group on `n` points @@ -7610,7 +7602,7 @@ def _findlast(self, n, parts): - ``n`` -- nonnegative integer - - ``parts`` -- a sorted list of positive integers. + - ``parts`` -- a sorted list of positive integers OUTPUT: @@ -7670,9 +7662,9 @@ def _fast_iterator(self, n, parts): INPUT: - - ``n`` -- nonnegative integer. + - ``n`` -- nonnegative integer - - ``parts`` -- a list of parts to use. This list will be + - ``parts`` -- list of parts to use. This list will be destroyed, so pass things here with ``foo[:]`` (or something equivalent) if you want to preserve your list. In particular, the ``__iter__`` method needs to use ``self.parts[:]``, or else we @@ -7713,14 +7705,12 @@ def _other_iterator(self, n, parts): INPUT: - - ``n`` -- nonnegative integer. - - - ``parts`` -- a list of parts to use. + - ``n`` -- nonnegative integer - OUTPUT: + - ``parts`` -- list of parts to use - A generator object for partitions of `n` with parts in - ``parts``. + OUTPUT: a generator object for partitions of `n` with parts in + ``parts`` EXAMPLES:: @@ -7807,7 +7797,7 @@ def _repr_(self): def __contains__(self, x): """ - Checks if ``x`` is contained in ``self``. + Check if ``x`` is contained in ``self``. EXAMPLES:: @@ -7885,7 +7875,7 @@ def __classcall_private__(cls, n, ending_partition): def __init__(self, n, ending_partition): """ - Initializes ``self``. + Initialize ``self``. EXAMPLES:: @@ -7921,7 +7911,7 @@ def _repr_(self): def __contains__(self, x): """ - Checks if ``x`` is contained in ``self``. + Check if ``x`` is contained in ``self``. EXAMPLES:: @@ -8015,7 +8005,7 @@ def _repr_(self): def __contains__(self, x): """ - Checks if ``x`` is contained in ``self``. + Check if ``x`` is contained in ``self``. EXAMPLES:: @@ -9267,11 +9257,11 @@ def number_of_partitions(n, algorithm='default'): - ``n`` -- an integer - - ``algorithm`` -- (default: 'default') + - ``algorithm`` -- (default: ``'default'``) [Will be deprecated except in Partition().cardinality() ] - - ``'default'`` -- If ``k`` is not ``None``, then use Gap (very slow). - If ``k`` is ``None``, use FLINT. + - ``'default'`` -- if ``k`` is not ``None``, then use Gap (very slow); + if ``k`` is ``None``, use FLINT - ``'flint'`` -- use FLINT diff --git a/src/sage/combinat/partition_algebra.py b/src/sage/combinat/partition_algebra.py index cdc59830a28..fa3b9642366 100644 --- a/src/sage/combinat/partition_algebra.py +++ b/src/sage/combinat/partition_algebra.py @@ -1579,7 +1579,7 @@ def __init__(self, R, k, n, name=None): name = "Partition algebra A_%s(%s)" % (k, n) cclass = SetPartitionsAk(k) self._element_class = PartitionAlgebraElement_ak - PartitionAlgebra_generic.__init__(self, R, cclass, n, k, name=name, prefix="A") + PartitionAlgebra_generic.__init__(self, R, cclass, n, k, name=name, prefix='A') class PartitionAlgebraElement_bk(PartitionAlgebraElement_generic): @@ -1600,7 +1600,7 @@ def __init__(self, R, k, n, name=None): name = "Partition algebra B_%s(%s)" % (k, n) cclass = SetPartitionsBk(k) self._element_class = PartitionAlgebraElement_bk - PartitionAlgebra_generic.__init__(self, R, cclass, n, k, name=name, prefix="B") + PartitionAlgebra_generic.__init__(self, R, cclass, n, k, name=name, prefix='B') class PartitionAlgebraElement_sk(PartitionAlgebraElement_generic): @@ -1621,7 +1621,7 @@ def __init__(self, R, k, n, name=None): name = "Partition algebra S_%s(%s)" % (k, n) cclass = SetPartitionsSk(k) self._element_class = PartitionAlgebraElement_sk - PartitionAlgebra_generic.__init__(self, R, cclass, n, k, name=name, prefix="S") + PartitionAlgebra_generic.__init__(self, R, cclass, n, k, name=name, prefix='S') class PartitionAlgebraElement_pk(PartitionAlgebraElement_generic): @@ -1642,7 +1642,7 @@ def __init__(self, R, k, n, name=None): name = "Partition algebra P_%s(%s)" % (k, n) cclass = SetPartitionsPk(k) self._element_class = PartitionAlgebraElement_pk - PartitionAlgebra_generic.__init__(self, R, cclass, n, k, name=name, prefix="P") + PartitionAlgebra_generic.__init__(self, R, cclass, n, k, name=name, prefix='P') class PartitionAlgebraElement_tk(PartitionAlgebraElement_generic): @@ -1663,7 +1663,7 @@ def __init__(self, R, k, n, name=None): name = "Partition algebra T_%s(%s)" % (k, n) cclass = SetPartitionsTk(k) self._element_class = PartitionAlgebraElement_tk - PartitionAlgebra_generic.__init__(self, R, cclass, n, k, name=name, prefix="T") + PartitionAlgebra_generic.__init__(self, R, cclass, n, k, name=name, prefix='T') class PartitionAlgebraElement_rk(PartitionAlgebraElement_generic): @@ -1684,7 +1684,7 @@ def __init__(self, R, k, n, name=None): name = "Partition algebra R_%s(%s)" % (k, n) cclass = SetPartitionsRk(k) self._element_class = PartitionAlgebraElement_rk - PartitionAlgebra_generic.__init__(self, R, cclass, n, k, name=name, prefix="R") + PartitionAlgebra_generic.__init__(self, R, cclass, n, k, name=name, prefix='R') class PartitionAlgebraElement_prk(PartitionAlgebraElement_generic): @@ -1705,7 +1705,7 @@ def __init__(self, R, k, n, name=None): name = "Partition algebra PR_%s(%s)" % (k, n) cclass = SetPartitionsPRk(k) self._element_class = PartitionAlgebraElement_prk - PartitionAlgebra_generic.__init__(self, R, cclass, n, k, name=name, prefix="PR") + PartitionAlgebra_generic.__init__(self, R, cclass, n, k, name=name, prefix='PR') ########################################################## diff --git a/src/sage/combinat/partition_kleshchev.py b/src/sage/combinat/partition_kleshchev.py index 44204aad33b..2454fb10d3d 100644 --- a/src/sage/combinat/partition_kleshchev.py +++ b/src/sage/combinat/partition_kleshchev.py @@ -131,14 +131,14 @@ def conormal_cells(self, i=None): EXAMPLES:: - sage: KP = KleshchevPartitions(3, convention="regular") + sage: KP = KleshchevPartitions(3, convention='regular') sage: KP([5,4,4,3,2]).conormal_cells() {0: [(1, 4)], 1: [(5, 0), (4, 2)]} sage: KP([5,4,4,3,2]).conormal_cells(0) [(1, 4)] sage: KP([5,4,4,3,2]).conormal_cells(1) [(5, 0), (4, 2)] - sage: KP = KleshchevPartitions(3, convention="restricted") + sage: KP = KleshchevPartitions(3, convention='restricted') sage: KP([5,4,4,3,2]).conormal_cells() {0: [(1, 4), (3, 3)], 2: [(0, 5)]} """ @@ -192,7 +192,7 @@ def cogood_cells(self, i=None): EXAMPLES:: - sage: KP = KleshchevPartitions(3, convention="regular") + sage: KP = KleshchevPartitions(3, convention='regular') sage: KP([5,4,4,3,2]).cogood_cells() {0: (1, 4), 1: (4, 2)} sage: KP([5,4,4,3,2]).cogood_cells(0) @@ -435,7 +435,7 @@ def is_regular(self): A partition tuple is `e`-regular if we can get to the empty partition tuple by successively removing a sequence of good cells in the down direction. Equivalently, all partitions are `0`-regular and if `e > 0` - then a partition is `e`-regular if no `e` non-zero parts of ``self`` + then a partition is `e`-regular if no `e` nonzero parts of ``self`` are equal. EXAMPLES:: @@ -1098,7 +1098,7 @@ def f(self, i): class KleshchevPartitions(PartitionTuples): r""" - Kleshchev partitions + Kleshchev partitions. A partition (tuple) `\mu` is Kleshchev if it can be recursively obtained by adding a sequence of good nodes to the empty @@ -1426,7 +1426,7 @@ class KleshchevPartitions_all(KleshchevPartitions): def __init__(self, e, multicharge, convention): r""" - Initializes ``self``. + Initialize ``self``. EXAMPLES:: diff --git a/src/sage/combinat/partition_shifting_algebras.py b/src/sage/combinat/partition_shifting_algebras.py index 90f1f10d59f..32f29dd4d4a 100644 --- a/src/sage/combinat/partition_shifting_algebras.py +++ b/src/sage/combinat/partition_shifting_algebras.py @@ -164,7 +164,7 @@ class ShiftingOperatorAlgebra(CombinatorialFreeModule): - ``base_ring`` -- (default: ``QQ['t']``) the base ring - - ``prefix`` -- (default: ``"S"``) the label for the shifting operators + - ``prefix`` -- (default: ``'S'``) the label for the shifting operators EXAMPLES:: diff --git a/src/sage/combinat/partition_tuple.py b/src/sage/combinat/partition_tuple.py index bf40c650c33..92446f55698 100644 --- a/src/sage/combinat/partition_tuple.py +++ b/src/sage/combinat/partition_tuple.py @@ -503,36 +503,36 @@ def _repr_(self, compact=None): sage: mu=PartitionTuple(([2,1],[3,2],[1,1,1])) # indirect doctest - sage: PartitionTuples.options(display="list"); mu + sage: PartitionTuples.options(display='list'); mu ([2, 1], [3, 2], [1, 1, 1]) - sage: PartitionTuples.options(display="diagram"); mu + sage: PartitionTuples.options(display='diagram'); mu ** *** * * ** * * - sage: PartitionTuples.options(display="compact_low"); mu + sage: PartitionTuples.options(display='compact_low'); mu 1,2|2,3|1^3 - sage: PartitionTuples.options(display="compact_high"); mu + sage: PartitionTuples.options(display='compact_high'); mu 2,1|3,2|1^3 - sage: PartitionTuples.options(display="exp_low"); mu + sage: PartitionTuples.options(display='exp_low'); mu 1, 2 | 2, 3 | 1^3 - sage: PartitionTuples.options(display="exp_high"); mu + sage: PartitionTuples.options(display='exp_high'); mu 2, 1 | 3, 2 | 1^3 sage: PartitionTuples.options._reset() - sage: Partitions.options(convention="French") - sage: PartitionTuples.options(display="diagram"); mu + sage: Partitions.options(convention='French') + sage: PartitionTuples.options(display='diagram'); mu * * ** * ** *** * - sage: PartitionTuples.options(display="list"); mu + sage: PartitionTuples.options(display='list'); mu ([2, 1], [3, 2], [1, 1, 1]) - sage: PartitionTuples.options(display="compact_low"); mu + sage: PartitionTuples.options(display='compact_low'); mu 1,2|2,3|1^3 - sage: PartitionTuples.options(display="compact_high"); mu + sage: PartitionTuples.options(display='compact_high'); mu 2,1|3,2|1^3 - sage: PartitionTuples.options(display="exp_low"); mu + sage: PartitionTuples.options(display='exp_low'); mu 1, 2 | 2, 3 | 1^3 - sage: PartitionTuples.options(display="exp_high"); mu + sage: PartitionTuples.options(display='exp_high'); mu 2, 1 | 3, 2 | 1^3 sage: PartitionTuples.options._reset() """ @@ -659,7 +659,7 @@ def _latex_(self): \end{array}$} } - sage: PartitionTuples.options(latex="young_diagram", convention="french") + sage: PartitionTuples.options(latex='young_diagram', convention='french') sage: PartitionTuples.options(latex='exp_high'); latex(mu) # indirect doctest (2,1|1^{3}) sage: PartitionTuples.options(latex='exp_low'); latex(mu) # indirect doctest @@ -785,7 +785,7 @@ def diagram(self): ** * * * * - sage: PartitionTuples.options(convention="french") + sage: PartitionTuples.options(convention='french') sage: print(PartitionTuple([[3,2],[2,1],[],[1,1,1,1]]).diagram()) * * @@ -1279,13 +1279,11 @@ def arm_length(self, k,r,c): INPUT: - - ``k`` -- The component - - ``r`` -- The row - - ``c`` -- The cell + - ``k`` -- the component + - ``r`` -- the row + - ``c`` -- the cell - OUTPUT: - - - The arm length as an integer + OUTPUT: the arm length as an integer The arm of cell ``(k, r, c)`` is the number of cells in the ``k``-th component which are to the right of the cell in row ``r`` and column @@ -1311,13 +1309,11 @@ def leg_length(self, k,r,c): INPUT: - - ``k`` -- The component - - ``r`` -- The row - - ``c`` -- The cell - - OUTPUT: + - ``k`` -- the component + - ``r`` -- the row + - ``c`` -- the cell - - The leg length as an integer + OUTPUT: the leg length as an integer The leg of cell ``(k, r, c)`` is the number of cells in the ``k``-th component which are below the node in row ``r`` and column ``c``. @@ -1571,11 +1567,9 @@ def degree(self, e): INPUT: - - ``e`` -- an integer `e > 1` + - ``e`` -- integer `e > 1` - OUTPUT: - - A non-negative integer. + OUTPUT: nonnegative integer EXAMPLES:: @@ -1630,9 +1624,7 @@ def prime_degree(self, p): - ``multicharge`` -- an `l`-tuple of integers, where `l` is the :meth:`level` of ``self`` - OUTPUT: - - A non-negative integer + OUTPUT: nonnegative integer EXAMPLES:: @@ -1666,7 +1658,7 @@ def block(self, e, multicharge): - ``e`` -- the quantum characteristic - - ``multicharge`` -- the multicharge (default `(0,)`) + - ``multicharge`` -- the multicharge (default: `(0,)`) OUTPUT: @@ -1738,12 +1730,10 @@ def defect(self, e, multicharge): - ``e`` -- the quantum characteristic - - ``multicharge`` -- the multicharge (default `(0,)`) - - OUTPUT: + - ``multicharge`` -- the multicharge (default: `(0,)`) - - a non-negative integer, which is the defect of the block - containing the partition tuple ``self`` + OUTPUT: a nonnegative integer, which is the defect of the block + containing the partition tuple ``self`` EXAMPLES:: @@ -1788,9 +1778,9 @@ class PartitionTuples(UniqueRepresentation, Parent): - ``level`` -- the length of the tuple - - ``size`` -- the total number of cells + - ``size`` -- the total number of cells - - ``regular`` -- a positive integer or a tuple of non-negative + - ``regular`` -- a positive integer or a tuple of nonnegative integers; if an integer, the highest multiplicity an entry may have in a component plus `1` @@ -1845,7 +1835,7 @@ def __classcall_private__(klass, level=None, size=None, regular=None): raise ValueError('the level must be a positive integer') if size is not None and (not isinstance(size, (int, Integer)) or size < 0): - raise ValueError('the size must be a non-negative integer') + raise ValueError('the size must be a nonnegative integer') if isinstance(regular, (list, tuple)): if level is None: @@ -1856,7 +1846,7 @@ def __classcall_private__(klass, level=None, size=None, regular=None): level, regular)) if regular == 0: raise ValueError("regular must be a positive integer or a tuple " - "of non-negative integers") + "of nonnegative integers") if level is None: if size is None: if regular is None: @@ -1902,15 +1892,13 @@ def __classcall_private__(klass, level=None, size=None, regular=None): def _element_constructor_(self, mu): r""" - Constructs an element of :class:`PartitionTuple`. + Construct an element of :class:`PartitionTuple`. INPUT: - ``mu`` -- a tuple of partitions - OUTPUT: - - - The corresponding :class:`PartitionTuple` object + OUTPUT: the corresponding :class:`PartitionTuple` object TESTS:: @@ -2074,7 +2062,7 @@ class PartitionTuples_all(PartitionTuples): def __init__(self): r""" - Initializes the class. + Initialize the class. EXAMPLES:: @@ -2147,7 +2135,7 @@ class PartitionTuples_level(PartitionTuples): def __init__(self, level, category=None): r""" - Initializes this class. + Initialize this class. EXAMPLES:: @@ -2158,7 +2146,7 @@ def __init__(self, level, category=None): sage: TestSuite( PartitionTuples(level=4) ).run() # needs sage.libs.flint """ if level not in NN: - raise ValueError('level must be a non-negative integer') + raise ValueError('level must be a nonnegative integer') if category is None: category = InfiniteEnumeratedSets() super().__init__(category=category) @@ -2264,7 +2252,7 @@ def __init__(self, size): sage: TestSuite( PartitionTuples(size=6) ).run() # needs sage.libs.flint """ if size not in NN: - raise ValueError('size must be a non-negative integer') + raise ValueError('size must be a nonnegative integer') super().__init__(category=InfiniteEnumeratedSets()) self._size = size @@ -2358,7 +2346,7 @@ class PartitionTuples_level_size(PartitionTuples): def __init__(self, level, size): r""" - Initializes this class. + Initialize this class. EXAMPLES:: @@ -2366,7 +2354,7 @@ def __init__(self, level, size): sage: TestSuite( PartitionTuples(level=4, size=5) ).run() # needs sage.libs.flint sage.libs.pari """ if not (level in NN and size in NN): - raise ValueError('n and level must be non-negative integers') + raise ValueError('n and level must be nonnegative integers') super().__init__(category=FiniteEnumeratedSets()) self._level = level self._size = size @@ -2660,8 +2648,8 @@ class RegularPartitionTuples_level(PartitionTuples_level): INPUT: - - ``level`` -- a non-negative Integer; the level - - ``regular`` -- a positive integer or a tuple of non-negative + - ``level`` -- nonnegative integer; the level + - ``regular`` -- positive integer or a tuple of nonnegative integers; if an integer, the highest multiplicity an entry may have in a component plus `1` with `0` representing `\infty`-regular (equivalently, partitions without restrictions) @@ -2720,7 +2708,7 @@ def __init__(self, level, regular): sage: TestSuite(RPT).run() # needs sage.libs.flint """ if level not in NN: - raise ValueError('level must be a non-negative integer') + raise ValueError('level must be a nonnegative integer') if not isinstance(regular, tuple): # This should not happen if called from RegularPartitionTuples regular = (regular,) * level @@ -2729,7 +2717,7 @@ def __init__(self, level, regular): else: category = FiniteEnumeratedSets() if any(r not in NN for r in regular): - raise ValueError('regular must be a tuple of non-negative integers') + raise ValueError('regular must be a tuple of nonnegative integers') if len(regular) != level: raise ValueError("regular must be a tuple with length {}".format(level)) PartitionTuples_level.__init__(self, level, category=category) @@ -2887,7 +2875,7 @@ def __init__(self, size, regular): sage: TestSuite(RPT).run() # needs sage.libs.flint """ if size not in NN: - raise ValueError('size must be a non-negative integer') + raise ValueError('size must be a nonnegative integer') RegularPartitionTuples.__init__(self, regular, category=InfiniteEnumeratedSets()) self._size = size @@ -2966,9 +2954,9 @@ class RegularPartitionTuples_level_size(PartitionTuples_level_size): INPUT: - - ``level`` -- a non-negative Integer; the level - - ``size`` -- a non-negative Integer; the size - - ``regular`` -- a positive integer or a tuple of non-negative + - ``level`` -- a nonnegative integer; the level + - ``size`` -- a nonnegative integer; the size + - ``regular`` -- a positive integer or a tuple of nonnegative integers; if an integer, the highest multiplicity an entry may have in a component plus `1` with `0` representing `\infty`-regular (equivalently, partitions without restrictions) @@ -3017,7 +3005,7 @@ def __init__(self, level, size, regular): sage: TestSuite(RPT).run() # needs sage.libs.flint sage.libs.pari """ if size not in NN: - raise ValueError('size must be a non-negative integer') + raise ValueError('size must be a nonnegative integer') if not (level in ZZ and level > 0): raise ValueError('level must be a positive integer') if not isinstance(regular, tuple): @@ -3026,7 +3014,7 @@ def __init__(self, level, size, regular): if len(regular) != level: raise ValueError(f'regular must be a list with length {level}') if any(i not in NN for i in regular): - raise ValueError('regular must be a list of non-negative integers') + raise ValueError('regular must be a list of nonnegative integers') PartitionTuples_level_size.__init__(self, level, size) self._ell = regular diff --git a/src/sage/combinat/partitions.pyx b/src/sage/combinat/partitions.pyx index e193c7e5723..632280f1e6a 100644 --- a/src/sage/combinat/partitions.pyx +++ b/src/sage/combinat/partitions.pyx @@ -100,7 +100,7 @@ cdef inline ZS1_step(list P, int n, int *m, int *h): INPUT: - - ``P`` -- a list of size `n` storing a partition of `n` + - ``P`` -- list of size `n` storing a partition of `n` - ``n`` -- integer; the sum of the elements of the partition stored in ``P`` @@ -207,7 +207,7 @@ def ZS1_next(list P): INPUT: - - ``P`` -- a list encoding a partition of an integer `n` in descending order + - ``P`` -- list encoding a partition of an integer `n` in descending order (i.e., `P_i \geq P_{i+1}`) EXAMPLES:: @@ -345,7 +345,7 @@ cdef inline ZS2_step(list P, int n, int *m, int *h): INPUT: - - ``P`` -- a list of size `n` storing a partition of `n` + - ``P`` -- list of size `n` storing a partition of `n` - ``n`` -- integer; the sum of the elements of the partition stored in ``P`` @@ -447,7 +447,7 @@ def ZS2_next(list P): INPUT: - - ``P`` -- a list encoding a partition of an integer `n` in descending order + - ``P`` -- list encoding a partition of an integer `n` in descending order (i.e., `P_i \geq P_{i+1}`) EXAMPLES:: @@ -488,7 +488,7 @@ cdef inline AccelDesc_step(list P, int n, int* m, int* h): INPUT: - - ``P`` -- a list of size `n` storing a partition of `n` + - ``P`` -- list of size `n` storing a partition of `n` - ``n`` -- integer; the sum of the elements of the partition stored in ``P`` @@ -602,7 +602,7 @@ def AccelDesc_next(list P): INPUT: - - ``P`` -- a list encoding a partition of an integer `n` in descending order + - ``P`` -- list encoding a partition of an integer `n` in descending order (i.e., `P_i \geq P_{i+1}`) EXAMPLES:: @@ -702,7 +702,7 @@ def AccelAsc_next(list P): INPUT: - - ``P`` -- a list encoding a partition of an integer `n` in ascending order + - ``P`` -- list encoding a partition of an integer `n` in ascending order (i.e., `P_i \leq P_{i+1}`) EXAMPLES:: diff --git a/src/sage/combinat/perfect_matching.py b/src/sage/combinat/perfect_matching.py index 8bd01107402..7fd292a56a4 100644 --- a/src/sage/combinat/perfect_matching.py +++ b/src/sage/combinat/perfect_matching.py @@ -297,7 +297,7 @@ def loops_iterator(self, other=None): INPUT: - - ``other`` -- a perfect matching of the same set of ``self``. + - ``other`` -- a perfect matching of the same set of ``self`` (if the second argument is empty, the method :meth:`an_element` is called on the parent of the first) @@ -346,7 +346,7 @@ def loops(self, other=None): INPUT: - - ``other`` -- a perfect matching of the same set of ``self``. + - ``other`` -- a perfect matching of the same set of ``self`` (if the second argument is empty, the method :meth:`an_element` is called on the parent of the first) @@ -395,7 +395,7 @@ def loop_type(self, other=None): INPUT: - - ``other`` -- a perfect matching of the same set of ``self``. + - ``other`` -- a perfect matching of the same set of ``self`` (if the second argument is empty, the method :meth:`an_element` is called on the parent of the first) @@ -428,7 +428,7 @@ def number_of_loops(self, other=None): INPUT: - - ``other`` -- a perfect matching of the same set of ``self``. + - ``other`` -- a perfect matching of the same set of ``self`` (if the second argument is empty, the method :meth:`an_element` is called on the parent of the first) diff --git a/src/sage/combinat/permutation.py b/src/sage/combinat/permutation.py index 866e8920c61..28bfba4654f 100644 --- a/src/sage/combinat/permutation.py +++ b/src/sage/combinat/permutation.py @@ -289,7 +289,7 @@ class Permutation(CombinatorialElement): INPUT: - - ``l`` -- Can be any one of the following: + - ``l`` -- can be any one of the following: - an instance of :class:`Permutation`, @@ -308,9 +308,8 @@ class Permutation(CombinatorialElement): the permutation obtained from the pair using the inverse of the Robinson-Schensted algorithm. - - ``check`` (boolean) -- whether to check that input is correct. Slows - the function down, but ensures that nothing bad happens. This is set to - ``True`` by default. + - ``check`` -- boolean (default: ``True``); whether to check that input is + correct; slows the function down, but ensures that nothing bad happens .. WARNING:: @@ -498,14 +497,12 @@ def __init__(self, parent, l, check=True): INPUT: - - ``l`` -- a list of ``int`` variables + - ``l`` -- list of ``int`` variables - - ``check`` (boolean) -- whether to check that input is - correct. Slows the function down, but ensures that nothing bad + - ``check`` -- boolean (default: ``True``); whether to check that input + is correct. Slows the function down, but ensures that nothing bad happens. - This is set to ``True`` by default. - TESTS:: sage: Permutation([1,2,3]) @@ -1713,7 +1710,7 @@ def to_digraph(self) -> DiGraph: return DiGraph([self, enumerate(self, start=1)], format='vertices_and_edges', loops=True) - def show(self, representation="cycles", orientation="landscape", **args): + def show(self, representation='cycles', orientation='landscape', **args): r""" Display the permutation as a drawing. @@ -1721,33 +1718,33 @@ def show(self, representation="cycles", orientation="landscape", **args): - ``representation`` -- different kinds of drawings are available - - ``"cycles"`` (default) -- the permutation is displayed as a + - ``'cycles'`` -- default; the permutation is displayed as a collection of directed cycles - - ``"braid"`` -- the permutation is displayed as segments linking - each element `1, ..., n` to its image on a parallel line. + - ``'braid'`` -- the permutation is displayed as segments linking + each element `1, ..., n` to its image on a parallel line When using this drawing, it is also possible to display the permutation horizontally (``orientation = "landscape"``, default option) or vertically (``orientation = "portrait"``). - - ``"chord-diagram"`` -- the permutation is displayed as a directed - graph, all of its vertices being located on a circle. + - ``'chord-diagram'`` -- the permutation is displayed as a directed + graph, all of its vertices being located on a circle All additional arguments are forwarded to the ``show`` subcalls. EXAMPLES:: sage: P20 = Permutations(20) - sage: P20.random_element().show(representation="cycles") # needs sage.graphs sage.plot - sage: P20.random_element().show(representation="chord-diagram") # needs sage.graphs sage.plot - sage: P20.random_element().show(representation="braid") # needs sage.plot - sage: P20.random_element().show(representation="braid", # needs sage.plot + sage: P20.random_element().show(representation='cycles') # needs sage.graphs sage.plot + sage: P20.random_element().show(representation='chord-diagram') # needs sage.graphs sage.plot + sage: P20.random_element().show(representation='braid') # needs sage.plot + sage: P20.random_element().show(representation='braid', # needs sage.plot ....: orientation='portrait') TESTS:: - sage: P20.random_element().show(representation="modern_art") + sage: P20.random_element().show(representation='modern_art') Traceback (most recent call last): ... ValueError: The value of 'representation' must be equal to 'cycles', 'chord-diagram' or 'braid' @@ -1758,7 +1755,7 @@ def show(self, representation="cycles", orientation="landscape", **args): if representation == "cycles": d.show(**args) else: - d.show(layout="circular", **args) + d.show(layout='circular', **args) elif representation == "braid": from sage.plot.line import line @@ -2145,7 +2142,7 @@ def runs(self, as_tuple=False): - ``as_tuple`` -- boolean (default: ``False``); choice of output format - OUTPUT: a list of lists or a tuple of tuples + OUTPUT: list of lists or a tuple of tuples REFERENCES: @@ -2204,7 +2201,7 @@ def decreasing_runs(self, as_tuple=False): - ``as_tuple`` -- boolean (default: ``False``); choice of output format - OUTPUT: a list of lists or a tuple of tuples + OUTPUT: list of lists or a tuple of tuples .. SEEALSO:: @@ -2746,15 +2743,16 @@ def fundamental_transformation_inverse(self): def destandardize(self, weight, ordered_alphabet=None): r""" - Return destandardization of ``self`` with respect to ``weight`` and ``ordered_alphabet``. + Return destandardization of ``self`` with respect to ``weight`` and + ``ordered_alphabet``. INPUT: - - ``weight`` -- list or tuple of nonnegative integers that sum to `n` if ``self`` - is a permutation in `S_n`. + - ``weight`` -- list or tuple of nonnegative integers that sum to `n` + if ``self`` is a permutation in `S_n` - - ``ordered_alphabet`` -- (default: ``None``) a list or tuple specifying the ordered alphabet the - destandardized word is over + - ``ordered_alphabet`` -- (default: ``None``) a list or tuple + specifying the ordered alphabet the destandardized word is over OUTPUT: word over the ``ordered_alphabet`` which standardizes to ``self`` @@ -3253,17 +3251,17 @@ def descents(self, final_descent=False, side='right', positive=False, INPUT: - - ``final_descent`` -- boolean (default ``False``); + - ``final_descent`` -- boolean (default: ``False``); if ``True``, the last position of a non-empty permutation is also considered as a descent - ``side`` -- ``'right'`` (default) or ``'left'``; if ``'left'``, return the descents of the inverse permutation - - ``positive`` -- boolean (default ``False``); + - ``positive`` -- boolean (default: ``False``); if ``True``, return the positions that are not descents - - ``from_zero`` -- boolean (default ``False``); + - ``from_zero`` -- boolean (default: ``False``); if ``True``, return the positions starting from `0` - ``index_set`` -- list (default: ``[1, ..., n-1]`` where ``self`` @@ -3329,11 +3327,11 @@ def idescents(self, final_descent=False, from_zero=False): INPUT: - - ``final_descent`` -- boolean (default ``False``); + - ``final_descent`` -- boolean (default: ``False``); if ``True``, the last position of a non-empty permutation is also considered as a descent - - ``from_zero`` -- optional boolean (default ``False``); + - ``from_zero`` -- optional boolean (default: ``False``); if ``False``, return the positions starting from `1` EXAMPLES:: @@ -3975,7 +3973,7 @@ def bruhat_greater(self): # Permutohedron Order # ######################## - def permutohedron_lequal(self, p2, side="right") -> bool: + def permutohedron_lequal(self, p2, side='right') -> bool: r""" Return ``True`` if ``self`` is less or equal to ``p2`` in the permutohedron order. @@ -4053,7 +4051,7 @@ def permutohedron_lequal(self, p2, side="right") -> bool: sage: sorted( [len([b for b in Permutations(3) if a.permutohedron_lequal(b)]) ....: for a in Permutations(3)] ) [1, 2, 2, 3, 3, 6] - sage: sorted( [len([b for b in Permutations(3) if a.permutohedron_lequal(b, side="left")]) + sage: sorted( [len([b for b in Permutations(3) if a.permutohedron_lequal(b, side='left')]) ....: for a in Permutations(3)] ) [1, 2, 2, 3, 3, 6] @@ -4074,7 +4072,7 @@ def permutohedron_lequal(self, p2, side="right") -> bool: return prod.number_of_inversions() == l2 - l1 - def permutohedron_succ(self, side="right"): + def permutohedron_succ(self, side='right'): r""" Return a list of the permutations strictly greater than ``self`` in the permutohedron order such that there is no permutation @@ -4115,7 +4113,7 @@ def permutohedron_succ(self, side="right"): succ.append(P(pp)) return succ - def permutohedron_pred(self, side="right") -> list: + def permutohedron_pred(self, side='right') -> list: r""" Return a list of the permutations strictly smaller than ``self`` in the permutohedron order such that there is no permutation @@ -4155,7 +4153,7 @@ def permutohedron_pred(self, side="right") -> list: pred.append(P(pp)) return pred - def permutohedron_smaller(self, side="right") -> list: + def permutohedron_smaller(self, side='right') -> list: r""" Return a list of permutations smaller than or equal to ``self`` in the permutohedron order. @@ -4193,7 +4191,7 @@ def permutohedron_smaller(self, side="right") -> list: """ return transitive_ideal(lambda x: x.permutohedron_pred(side), self) - def permutohedron_greater(self, side="right") -> list: + def permutohedron_greater(self, side='right') -> list: r""" Return a list of permutations greater than or equal to ``self`` in the permutohedron order. @@ -4282,7 +4280,7 @@ def right_permutohedron_interval(self, other): P = Permutations() return [P(p) for p in self.right_permutohedron_interval_iterator(other)] - def permutohedron_join(self, other, side="right") -> Permutation: + def permutohedron_join(self, other, side='right') -> Permutation: r""" Return the join of the permutations ``self`` and ``other`` in the right permutohedron order (or, if ``side`` is set to @@ -4378,10 +4376,10 @@ def permutohedron_join(self, other, side="right") -> Permutation: sage: p = Permutation([3,1,2]) sage: q = Permutation([1,3,2]) - sage: p.permutohedron_join(q, side="left") + sage: p.permutohedron_join(q, side='left') [3, 2, 1] sage: r = Permutation([2,1,3]) - sage: r.permutohedron_join(p, side="left") + sage: r.permutohedron_join(p, side='left') [3, 1, 2] """ if side == "left": @@ -4402,7 +4400,7 @@ def permutohedron_join(self, other, side="right") -> Permutation: xs.append(i) return Permutations(n)(xs) - def permutohedron_meet(self, other, side="right") -> Permutation: + def permutohedron_meet(self, other, side='right') -> Permutation: r""" Return the meet of the permutations ``self`` and ``other`` in the right permutohedron order (or, if ``side`` is set to @@ -4494,10 +4492,10 @@ def permutohedron_meet(self, other, side="right") -> Permutation: sage: p = Permutation([3,1,2]) sage: q = Permutation([1,3,2]) - sage: p.permutohedron_meet(q, side="left") + sage: p.permutohedron_meet(q, side='left') [1, 2, 3] sage: r = Permutation([2,1,3]) - sage: r.permutohedron_meet(p, side="left") + sage: r.permutohedron_meet(p, side='left') [2, 1, 3] """ return self.reverse().permutohedron_join(other.reverse(), side=side).reverse() @@ -4567,7 +4565,8 @@ def simion_schmidt(self, avoid=[1,2,3]): INPUT: - - ``avoid`` -- one of the patterns ``[1,2,3]``, ``[1,3,2]``, ``[3,1,2]``, ``[3,2,1]``. + - ``avoid`` -- one of the patterns ``[1,2,3]``, ``[1,3,2]``, + ``[3,1,2]``, ``[3,2,1]`` EXAMPLES:: @@ -5281,7 +5280,7 @@ def hyperoctahedral_double_coset_type(self): # Binary operations # ##################### - def shifted_concatenation(self, other, side="right"): + def shifted_concatenation(self, other, side='right'): r""" Return the right (or left) shifted concatenation of ``self`` with a permutation ``other``. These operations are also known @@ -5290,18 +5289,18 @@ def shifted_concatenation(self, other, side="right"): INPUT: - ``other`` -- a permutation, a list, a tuple, or any iterable - representing a permutation. + representing a permutation - - ``side`` -- (default: ``"right"``) the string "left" or "right". + - ``side`` -- (default: ``'right'``) the string "left" or "right" OUTPUT: - If ``side`` is ``"right"``, the method returns the permutation + If ``side`` is ``'right'``, the method returns the permutation obtained by concatenating ``self`` with the letters of ``other`` incremented by the size of ``self``. This is what is called ``side / other`` in [LR0102066]_, and denoted as the "over" operation. - Otherwise, i. e., when ``side`` is ``"left"``, the method + Otherwise, i. e., when ``side`` is ``'left'``, the method returns the permutation obtained by concatenating the letters of ``other`` incremented by the size of ``self`` with ``self``. This is what is called ``side \ other`` in [LR0102066]_ @@ -5333,7 +5332,7 @@ def shifted_shuffle(self, other): INPUT: - ``other`` -- a permutation, a list, a tuple, or any iterable - representing a permutation. + representing a permutation OUTPUT: @@ -6387,7 +6386,7 @@ def unrank(self, r): INPUT: - - ``r`` -- an integer between ``0`` and ``self.cardinality()-1`` + - ``r`` -- integer between ``0`` and ``self.cardinality()-1`` inclusive ALGORITHM: @@ -8099,9 +8098,9 @@ def bistochastic_as_sum_of_permutations(M, check=True): INPUT: - - ``M`` -- A bistochastic matrix + - ``M`` -- a bistochastic matrix - - ``check`` (boolean) -- set to ``True`` (default) to check + - ``check`` -- boolean; set to ``True`` (default) to check that the matrix is indeed bistochastic OUTPUT: @@ -8942,7 +8941,7 @@ def bruhat_lequal(p1, p2): # Permutohedron # ################# -def permutohedron_lequal(p1, p2, side="right"): +def permutohedron_lequal(p1, p2, side='right'): r""" Return ``True`` if ``p1`` is less than or equal to ``p2`` in the permutohedron order. @@ -9053,7 +9052,7 @@ class CyclicPermutations(Permutations_mset): INPUT: - - ``mset`` -- A multiset + - ``mset`` -- a multiset EXAMPLES:: diff --git a/src/sage/combinat/permutation_cython.pyx b/src/sage/combinat/permutation_cython.pyx index e255b600d03..ae48886aabd 100644 --- a/src/sage/combinat/permutation_cython.pyx +++ b/src/sage/combinat/permutation_cython.pyx @@ -116,7 +116,7 @@ cdef int next_swap(int n, int *c, int *o) noexcept: def permutation_iterator_transposition_list(int n): """ - Returns a list of transposition indices to enumerate the + Return a list of transposition indices to enumerate the permutations on `n` letters by adjacent transpositions. Assumes zero-based lists. We artificially limit the argument to `n < 12` to avoid overflowing 32-bit pointers. @@ -267,7 +267,7 @@ cpdef map_to_list(array l, tuple values, int n): - ``values`` -- tuple; the values of the permutation - ``n`` -- int; the length of the array ``l`` - OUTPUT: a list representing the permutation + OUTPUT: list representing the permutation EXAMPLES:: diff --git a/src/sage/combinat/plane_partition.py b/src/sage/combinat/plane_partition.py index 88cf99d1e96..00aee9f56cb 100644 --- a/src/sage/combinat/plane_partition.py +++ b/src/sage/combinat/plane_partition.py @@ -56,7 +56,7 @@ class PlanePartition(ClonableArray, INPUT: - - ``PP`` -- a list of lists which represents a tableau + - ``PP`` -- list of lists which represents a tableau - ``box_size`` -- (optional) a list ``[A, B, C]`` of 3 positive integers, where ``A``, ``B``, ``C`` are the lengths of the box in the `x`-axis, `y`-axis, `z`-axis, respectively; if this is not given, it is @@ -351,7 +351,7 @@ def _repr_diagram(self, show_box=False, use_unicode=False) -> str: also shows the visible tiles on the `xy`-, `yz`-, `zx`-planes - ``use_unicode`` -- boolean (default: ``False``); use unicode - OUTPUT: a string of the 3D diagram of the plane partition + OUTPUT: string of the 3D diagram of the plane partition EXAMPLES:: @@ -1475,7 +1475,7 @@ class PlanePartitions_all(PlanePartitions, DisjointUnionEnumeratedSets): """ def __init__(self): r""" - Initializes the class of all plane partitions. + Initialize the class of all plane partitions. .. WARNING:: @@ -1534,7 +1534,7 @@ class PlanePartitions_box(PlanePartitions): """ def __init__(self, box_size): r""" - Initializes the class of plane partitions that fit in a box of a + Initialize the class of plane partitions that fit in a box of a specified size. EXAMPLES:: @@ -1730,7 +1730,7 @@ class PlanePartitions_n(PlanePartitions): """ def __init__(self, n): r""" - Initializes the class of plane partitions with ``n`` boxes. + Initialize the class of plane partitions with ``n`` boxes. .. WARNING:: diff --git a/src/sage/combinat/q_analogues.py b/src/sage/combinat/q_analogues.py index a5e8bb2e1ce..0a5d819c247 100644 --- a/src/sage/combinat/q_analogues.py +++ b/src/sage/combinat/q_analogues.py @@ -105,7 +105,7 @@ def q_factorial(n, q=None): sage: q_factorial(3, p) p^3 + 2*p^2 + 2*p + 1 - The `q`-analogue of `n!` is only defined for `n` a non-negative + The `q`-analogue of `n!` is only defined for `n` a nonnegative integer (:issue:`11411`):: sage: q_factorial(-2) @@ -289,9 +289,9 @@ def q_binomial(n, k, q=None, algorithm='auto'): Check that arbitrary polynomials work:: sage: R. = ZZ[] - sage: q_binomial(2, 1, x^2 - 1, algorithm="naive") + sage: q_binomial(2, 1, x^2 - 1, algorithm='naive') x^2 - sage: q_binomial(2, 1, x^2 - 1, algorithm="cyclotomic") + sage: q_binomial(2, 1, x^2 - 1, algorithm='cyclotomic') x^2 Check that the parent is always the parent of ``q``:: @@ -305,7 +305,7 @@ def q_binomial(n, k, q=None, algorithm='auto'): :: - sage: q_binomial(2, 1, x^2 - 1, algorithm="quantum") + sage: q_binomial(2, 1, x^2 - 1, algorithm='quantum') Traceback (most recent call last): ... ValueError: unknown algorithm 'quantum' @@ -871,9 +871,9 @@ def q_stirling_number1(n, k, q=None): INPUT: - - ``n``, ``k`` -- integers with ``1 <= k <= n`` + - ``n``, ``k`` -- integers with `1 \leq k \leq n` - - ``q`` -- optional variable (default `q`) + - ``q`` -- optional variable (default: `q`) OUTPUT: a polynomial in the variable `q` @@ -937,9 +937,9 @@ def q_stirling_number2(n, k, q=None): INPUT: - - ``n``, ``k`` -- integers with ``1 <= k <= n`` + - ``n``, ``k`` -- integers with `1 \leq k \leq n` - - ``q`` -- optional variable (default `q`) + - ``q`` -- optional variable (default: `q`) OUTPUT: a polynomial in the variable `q` @@ -1002,7 +1002,7 @@ def number_of_irreducible_polynomials(n, q=None, m=1): - ``n`` -- positive integer - ``q`` -- ``None`` (default) or a prime power - - ``m`` -- positive integer (default `1`) + - ``m`` -- positive integer (default: `1`) OUTPUT: integer or integer-valued polynomial over `\QQ` diff --git a/src/sage/combinat/q_bernoulli.pyx b/src/sage/combinat/q_bernoulli.pyx index 849a56b2f1b..c3c4af7013a 100644 --- a/src/sage/combinat/q_bernoulli.pyx +++ b/src/sage/combinat/q_bernoulli.pyx @@ -17,9 +17,9 @@ def q_bernoulli(m, p=None): INPUT: - - `m` -- a nonnegative integer + - ``m`` -- a nonnegative integer - - `p` (default: ``None``) -- an optional value for `q` + - `p` -- (default: ``None``) an optional value for `q` OUTPUT: @@ -87,7 +87,7 @@ def q_bernoulli_polynomial(m): INPUT: - - `m` -- a nonnegative integer + - ``m`` -- a nonnegative integer OUTPUT: a polynomial in one variable `x` diff --git a/src/sage/combinat/ranker.py b/src/sage/combinat/ranker.py index be78d89de53..e0a92da416a 100644 --- a/src/sage/combinat/ranker.py +++ b/src/sage/combinat/ranker.py @@ -22,15 +22,13 @@ def from_list(l): """ - Returns a ranker from the list l. + Return a ranker from the list l. INPUT: - - ``l`` -- a list + - ``l`` -- list - OUTPUT: - - - ``[rank, unrank]`` -- functions + OUTPUT: ``[rank, unrank]`` -- functions EXAMPLES:: @@ -109,7 +107,7 @@ def rank_from_list(l): def unrank_from_list(l): """ - Returns an unrank function from a list. + Return an unrank function from a list. EXAMPLES:: @@ -127,7 +125,7 @@ def unrank_from_list(l): def on_fly(): """ - Returns a pair of enumeration functions rank / unrank. + Return a pair of enumeration functions rank / unrank. rank assigns on the fly an integer, starting from 0, to any object passed as argument. The object should be hashable. unrank is the @@ -182,7 +180,7 @@ def unrank(L, i): INPUT: - - ``L`` -- a list, tuple, finite enumerated set, ... + - ``L`` -- list, tuple, finite enumerated set, etc - ``i`` -- an int or :class:`Integer` The purpose of this utility is to give a uniform idiom to recover diff --git a/src/sage/combinat/recognizable_series.py b/src/sage/combinat/recognizable_series.py index 59bf8f7826b..7d143eea4fb 100644 --- a/src/sage/combinat/recognizable_series.py +++ b/src/sage/combinat/recognizable_series.py @@ -100,7 +100,7 @@ def __init__(self, words): @classmethod def create_by_alphabet(cls, alphabet): r""" - A prefix-closed set + A prefix-closed set. This is a convenience method for the creation of prefix-closed sets by specifying an alphabet. @@ -121,7 +121,7 @@ def create_by_alphabet(cls, alphabet): def __repr__(self): r""" - A representation string of this prefix-closed set + A representation string of this prefix-closed set. OUTPUT: string @@ -142,9 +142,9 @@ def add(self, w, check=True): - ``w`` -- a word - - ``check`` -- boolean (default: ``True``). If set, then it is verified + - ``check`` -- boolean (default: ``True``); if set, then it is verified whether all proper prefixes of ``w`` are already in this - prefix-closed set. + prefix-closed set OUTPUT: diff --git a/src/sage/combinat/regular_sequence.py b/src/sage/combinat/regular_sequence.py index c4469081e7a..4e29cbf7ab6 100644 --- a/src/sage/combinat/regular_sequence.py +++ b/src/sage/combinat/regular_sequence.py @@ -98,7 +98,7 @@ def pad_right(T, length, zero=0): INPUT: - - ``T`` -- A tuple, list or other iterable + - ``T`` -- a tuple, list or other iterable - ``length`` -- a nonnegative integer @@ -570,7 +570,7 @@ def subsequence(self, a, b): - ``a`` -- a nonnegative integer - - ``b`` -- an integer + - ``b`` -- integer Alternatively, this is allowed to be a dictionary `b_j \mapsto c_j`. If so and applied on `f(n)`, @@ -853,7 +853,7 @@ def shift_left(self, b=1, **kwds): INPUT: - - ``b`` -- an integer + - ``b`` -- integer - ``minimize`` -- (default: ``None``) a boolean or ``None``. If ``True``, then :meth:`~RecognizableSeries.minimized` is called after the operation, @@ -897,7 +897,7 @@ def shift_right(self, b=1, **kwds): INPUT: - - ``b`` -- an integer + - ``b`` -- integer - ``minimize`` -- (default: ``None``) a boolean or ``None``. If ``True``, then :meth:`~RecognizableSeries.minimized` is called after the operation, @@ -1301,7 +1301,7 @@ class RegularSequenceRing(RecognizableSeriesSpace): INPUT: - - ``k`` -- an integer at least `2` specifying the base + - ``k`` -- integer at least `2` specifying the base - ``coefficient_ring`` -- a (semi-)ring @@ -1356,7 +1356,7 @@ def __init__(self, k, *args, **kwds): INPUT: - - ``k`` -- an integer at least `2` specifying the base + - ``k`` -- integer at least `2` specifying the base Other input arguments are passed on to :meth:`~sage.combinat.recognizable_series.RecognizableSeriesSpace.__init__`. @@ -1566,7 +1566,7 @@ def guess(self, f, n_verify=100, max_exponent=10, sequence=None): Implicitly, the algorithm also maintains a `d \times n_\mathrm{verify}` matrix ``A`` (where ``d`` is the dimension of the right vector valued sequence) whose columns are the current right vector valued sequence evaluated at - the non-negative integers less than `n_\mathrm{verify}` and ensures that this + the nonnegative integers less than `n_\mathrm{verify}` and ensures that this matrix has full row rank. EXAMPLES: @@ -1875,7 +1875,7 @@ def some_inverse_U_matrix(lines): # see :issue:`35748` for details. for m_indices in cantor_product(xsrange(n_verify), repeat=d, min_slope=1): # Iterate over all increasing lists of length d consisting - # of non-negative integers less than `n_verify`. + # of nonnegative integers less than `n_verify`. U = Matrix(domain, d, d, [values(m, lines) for m in m_indices]).transpose() try: @@ -2005,7 +2005,7 @@ def from_recurrence(self, *args, **kwds): If the recurrence relations are represented by symbolic equations, then the following arguments are required: - - ``equations`` -- A list of equations where the elements have + - ``equations`` -- a list of equations where the elements have either the form - `f(k^M n + r) = c_{r,l} f(k^m n + l) + c_{r,l + 1} f(k^m n @@ -2235,7 +2235,7 @@ def from_recurrence(self, *args, **kwds): sage: (S - T).is_trivial_zero() # long time True - Zero-sequence with non-zero initial values:: + Zero-sequence with nonzero initial values:: sage: Seq2.from_recurrence([ ....: f(2*n) == 0, f(2*n + 1) == 0, @@ -2273,7 +2273,7 @@ def from_recurrence(self, *args, **kwds): True Connection between the Stern--Brocot sequence and the number - of non-zero elements in the generalized Pascal's triangle (see + of nonzero elements in the generalized Pascal's triangle (see [LRS2017]_):: sage: U = Seq2.from_recurrence(M=1, m=0, @@ -2335,9 +2335,9 @@ def __init__(self, k, coefficient_ring): INPUT: - - ``k`` -- an integer at least `2` specifying the base + - ``k`` -- integer at least `2` specifying the base - - ``coefficient_ring`` -- a ring. + - ``coefficient_ring`` -- a ring These are the same parameters used when creating a :class:`RegularSequenceRing`. @@ -2997,14 +2997,14 @@ def parse_direct_arguments(self, M, m, coeffs, initial_values): sage: RP.parse_direct_arguments(1, 1/2, {}, {}) Traceback (most recent call last): ... - ValueError: 1/2 is not a non-negative integer. + ValueError: 1/2 is not a nonnegative integer. :: sage: RP.parse_direct_arguments(1, -1, {}, {}) Traceback (most recent call last): ... - ValueError: -1 is not a non-negative integer. + ValueError: -1 is not a nonnegative integer. :: @@ -3067,7 +3067,7 @@ def parse_direct_arguments(self, M, m, coeffs, initial_values): raise ValueError("%s is not a positive integer." % (M,)) from None if m not in ZZ or m < 0: - raise ValueError("%s is not a non-negative integer." + raise ValueError("%s is not a nonnegative integer." % (m,)) from None if M <= m: raise ValueError("%s is not larger than %s." @@ -3141,7 +3141,7 @@ def parameters(self, M, m, coeffs, initial_values, offset=0, inhomogeneities={}) ``n``-th value of the sequence - ``inhomogeneities`` -- a dictionary mapping integers ``r`` - to the inhomogeneity `g_r` as given in [HKL2022]_, Corollary D. + to the inhomogeneity `g_r` as given in [HKL2022]_, Corollary D EXAMPLES:: @@ -3336,7 +3336,7 @@ def values(self, *, M, m, l, u, ll, coeffs, determine the linear representation - ``inhomogeneities`` -- a dictionary mapping integers ``r`` - to the inhomogeneity `g_r` as given in [HKL2022]_, Corollary D. + to the inhomogeneity `g_r` as given in [HKL2022]_, Corollary D OUTPUT: @@ -3692,7 +3692,7 @@ def v_eval_n(self, recurrence_rules, n): - ``recurrence_rules`` -- a namedtuple generated by :meth:`parameters` - - ``n`` -- an integer + - ``n`` -- integer OUTPUT: a vector @@ -3750,7 +3750,7 @@ def matrix(self, recurrence_rules, rem, correct_offset=True): - ``recurrence_rules`` -- a namedtuple generated by :meth:`parameters` - - ``rem`` -- an integer between ``0`` and ``k - 1`` + - ``rem`` -- integer between `0` and `k - 1` - ``correct_offset`` -- boolean (default: ``True``); if ``True``, then the resulting linear representation has no diff --git a/src/sage/combinat/ribbon_tableau.py b/src/sage/combinat/ribbon_tableau.py index db82cbfd660..939c7551511 100644 --- a/src/sage/combinat/ribbon_tableau.py +++ b/src/sage/combinat/ribbon_tableau.py @@ -58,7 +58,7 @@ class RibbonTableau(SkewTableau): 1 0 1 In the previous example, each ribbon is uniquely determined by a - non-zero entry. The 0 entries are used to fill in the rest of the + nonzero entry. The 0 entries are used to fill in the rest of the skew shape. .. NOTE:: @@ -164,14 +164,14 @@ class RibbonTableaux(UniqueRepresentation, Parent): INPUT(Optional): - - ``shape`` -- skew shape as a list of lists or an object of type + - ``shape`` -- skew shape as a list of lists or an object of type SkewPartition - - ``length`` -- integer, ``shape`` is partitioned into ribbons of + - ``length`` -- integer; ``shape`` is partitioned into ribbons of length ``length`` - - ``weight`` -- list of integers, computed from the values of - non-zero entries labeling the ribbons + - ``weight`` -- list of integers; computed from the values of + nonzero entries labeling the ribbons EXAMPLES:: @@ -415,7 +415,7 @@ def insertion_tableau(skp, perm, evaluation, tableau, length): - ``skp`` -- skew partitions - - ``perm, evaluation`` -- non-negative integers + - ``perm, evaluation`` -- nonnegative integers - ``tableau`` -- skew tableau @@ -482,7 +482,7 @@ def count_rec(nexts, current, part, weight, length): - ``nexts, current, part`` -- skew partitions - - ``weight`` -- non-negative integer list + - ``weight`` -- nonnegative integer list - ``length`` -- integer @@ -518,7 +518,7 @@ def list_rec(nexts, current, part, weight, length): - ``nexts, current, part`` -- skew partitions - - ``weight`` -- non-negative integer list + - ``weight`` -- nonnegative integer list - ``length`` -- integer @@ -575,7 +575,7 @@ def spin_rec(t, nexts, current, part, weight, length): INPUT: - - ``weight`` -- list of non-negative integers + - ``weight`` -- list of nonnegative integers - ``length`` -- the length of the ribbons we're tiling with @@ -620,7 +620,7 @@ def spin_rec(t, nexts, current, part, weight, length): def spin_polynomial_square(part, weight, length): r""" - Returns the spin polynomial associated with ``part``, ``weight``, and + Return the spin polynomial associated with ``part``, ``weight``, and ``length``, with the substitution `t \to t^2` made. EXAMPLES:: @@ -658,7 +658,7 @@ def spin_polynomial_square(part, weight, length): def spin_polynomial(part, weight, length): """ - Returns the spin polynomial associated to ``part``, ``weight``, and + Return the spin polynomial associated to ``part``, ``weight``, and ``length``. EXAMPLES:: diff --git a/src/sage/combinat/rooted_tree.py b/src/sage/combinat/rooted_tree.py index 5a1debeca6c..3678d44cf70 100644 --- a/src/sage/combinat/rooted_tree.py +++ b/src/sage/combinat/rooted_tree.py @@ -425,11 +425,11 @@ def single_graft(self, x, grafting_function, path_prefix=()): INPUT: - - `x` -- a rooted tree + - ``x`` -- a rooted tree - - ``grafting_function`` -- a list of paths in ``self`` + - ``grafting_function`` -- list of paths in ``self`` - - ``path_prefix`` -- optional tuple (default ``()``) + - ``path_prefix`` -- optional tuple (default: ``()``) The ``path_prefix`` argument is only used for internal recursion. @@ -808,10 +808,10 @@ class LabelledRootedTree(AbstractLabelledClonableTree, RootedTree): INPUT: - - ``children`` -- a list or tuple or more generally any iterable + - ``children`` -- list or tuple or more generally any iterable of trees or objects convertible to trees - - ``label`` -- any hashable Sage object (default is ``None``) + - ``label`` -- any hashable Sage object (default: ``None``) .. NOTE:: @@ -1042,7 +1042,7 @@ def _an_element_(self): t = LT([], label=3) t1 = LT([t, t], label=42) t2 = LT([[]], label=5) - return LT([t, t1, t2], label="alpha") + return LT([t, t1, t2], label='alpha') def unlabelled_trees(self): """ diff --git a/src/sage/combinat/rsk.py b/src/sage/combinat/rsk.py index 9a430c0fd36..26c94405a22 100644 --- a/src/sage/combinat/rsk.py +++ b/src/sage/combinat/rsk.py @@ -3070,7 +3070,7 @@ def RSK(obj1=None, obj2=None, insertion=InsertionRules.RSK, check_standard=False - ``RSK.rules.EG`` (or ``'EG'``) -- Edelman-Greene insertion (only for reduced words of permutations/elements of a type `A` Coxeter group) (:class:`~sage.combinat.rsk.RuleEG`) - - ``RSK.rules.Hecke`` (or ``'hecke'``) -- Hecke insertion (only + - ``RSK.rules.Hecke`` -- (or ``'hecke'``) Hecke insertion (only guaranteed for generalized permutations whose top row is strictly increasing) (:class:`~sage.combinat.rsk.RuleHecke`) - ``RSK.rules.dualRSK`` (or ``'dualRSK'``) -- Dual RSK insertion diff --git a/src/sage/combinat/schubert_polynomial.py b/src/sage/combinat/schubert_polynomial.py index 63fd2a9065e..efd11f1e0f3 100644 --- a/src/sage/combinat/schubert_polynomial.py +++ b/src/sage/combinat/schubert_polynomial.py @@ -158,7 +158,7 @@ def expand(self): p = R(p) return p - def divided_difference(self, i, algorithm="sage"): + def divided_difference(self, i, algorithm='sage'): r""" Return the ``i``-th divided difference operator, applied to ``self``. diff --git a/src/sage/combinat/set_partition.py b/src/sage/combinat/set_partition.py index 6b6c00cd445..433429e79b5 100644 --- a/src/sage/combinat/set_partition.py +++ b/src/sage/combinat/set_partition.py @@ -650,7 +650,7 @@ def check(self): def set_latex_options(self, **kwargs): r""" - Set the latex options for use in the ``_latex_`` function + Set the latex options for use in the ``_latex_`` function. - ``tikz_scale`` -- (default: 1) scale for use with tikz package @@ -667,7 +667,7 @@ def set_latex_options(self, **kwargs): - ``show_labels`` -- boolean (default: ``True``); if ``True`` shows labels (*only works with plots*) - - ``radius`` -- (default: ``"1cm"``) radius of circle for cyclic + - ``radius`` -- (default: ``'1cm'``) radius of circle for cyclic plot - *only works with cyclic plot* - ``angle`` -- (default: 0) angle for linear plot @@ -943,15 +943,15 @@ def to_permutation(self): """ return Permutation(tuple(map(tuple, self.standard_form()))) - def to_restricted_growth_word(self, bijection="blocks"): + def to_restricted_growth_word(self, bijection='blocks'): r""" Convert a set partition of `\{1,...,n\}` to a word of length `n` - with letters in the non-negative integers such that each + with letters in the nonnegative integers such that each letter is at most 1 larger than all the letters before. INPUT: - - ``bijection`` (default: ``blocks``) -- defines the map from + - ``bijection`` -- (default: ``blocks``) defines the map from set partitions to restricted growth functions. These are currently: @@ -1005,7 +1005,7 @@ def to_restricted_growth_word(self, bijection="blocks"): def to_restricted_growth_word_blocks(self): r""" Convert a set partition of `\{1,...,n\}` to a word of length `n` - with letters in the non-negative integers such that each + with letters in the nonnegative integers such that each letter is at most 1 larger than all the letters before. The word is obtained by sorting the blocks by their minimal @@ -1035,7 +1035,7 @@ def to_restricted_growth_word_blocks(self): def to_restricted_growth_word_intertwining(self): r""" Convert a set partition of `\{1,...,n\}` to a word of length `n` - with letters in the non-negative integers such that each + with letters in the nonnegative integers such that each letter is at most 1 larger than all the letters before. The `i`-th letter of the word is the numbers of crossings of @@ -1090,7 +1090,7 @@ def closers(self): """ return sorted([max(B) for B in self]) - def to_rook_placement(self, bijection="arcs"): + def to_rook_placement(self, bijection='arcs'): r""" Return a set of pairs defining a placement of non-attacking rooks on a triangular board. @@ -1100,7 +1100,7 @@ def to_rook_placement(self, bijection="arcs"): INPUT: - - ``bijection`` (default: ``arcs``) -- defines the bijection + - ``bijection`` -- (default: ``arcs``) defines the bijection from set partitions to rook placements. These are currently: @@ -1152,7 +1152,7 @@ def to_rook_placement_gamma(self): rook, which are not yet attacked by another rook, equals the index of the block to which `n+1-i` belongs. - OUTPUT: a list of coordinates + OUTPUT: list of coordinates .. SEEALSO:: @@ -1226,7 +1226,7 @@ def to_rook_placement_rho(self): One can show that the precisely those rows which correspond to openers of the set partition remain empty. - OUTPUT: a list of coordinates + OUTPUT: list of coordinates .. SEEALSO:: @@ -1285,7 +1285,7 @@ def to_rook_placement_psi(self): Return the rook diagram obtained by placing rooks according to Yip's bijection psi. - OUTPUT: a list of coordinates + OUTPUT: list of coordinates .. SEEALSO:: @@ -2125,17 +2125,17 @@ def _element_constructor_(self, s, check=True): Element = SetPartition - def from_restricted_growth_word(self, w, bijection="blocks"): + def from_restricted_growth_word(self, w, bijection='blocks'): r""" - Convert a word of length `n` with letters in the non-negative + Convert a word of length `n` with letters in the nonnegative integers such that each letter is at most 1 larger than all the letters before to a set partition of `\{1,...,n\}`. INPUT: - - ``w`` -- a restricted growth word. + - ``w`` -- a restricted growth word - - ``bijection`` (default: ``blocks``) -- defines the map from + - ``bijection`` -- (default: ``blocks``) defines the map from restricted growth functions to set partitions. These are currently: @@ -2168,7 +2168,7 @@ def from_restricted_growth_word(self, w, bijection="blocks"): def from_restricted_growth_word_blocks(self, w): r""" - Convert a word of length `n` with letters in the non-negative + Convert a word of length `n` with letters in the nonnegative integers such that each letter is at most 1 larger than all the letters before to a set partition of `\{1,...,n\}`. @@ -2177,7 +2177,7 @@ def from_restricted_growth_word_blocks(self, w): INPUT: - - ``w`` -- a restricted growth word. + - ``w`` -- a restricted growth word OUTPUT: a set partition @@ -2201,7 +2201,7 @@ def from_restricted_growth_word_blocks(self, w): def from_restricted_growth_word_intertwining(self, w): r""" - Convert a word of length `n` with letters in the non-negative + Convert a word of length `n` with letters in the nonnegative integers such that each letter is at most 1 larger than all the letters before to a set partition of `\{1,...,n\}`. @@ -2212,7 +2212,7 @@ def from_restricted_growth_word_intertwining(self, w): INPUT: - - ``w`` -- a restricted growth word. + - ``w`` -- a restricted growth word OUTPUT: a set partition @@ -2244,7 +2244,7 @@ def from_restricted_growth_word_intertwining(self, w): C = [i + 1] + C return self.element_class(self, R) - def from_rook_placement(self, rooks, bijection="arcs", n=None): + def from_rook_placement(self, rooks, bijection='arcs', n=None): r""" Convert a rook placement of the triangular grid to a set partition of `\{1,...,n\}`. @@ -2255,10 +2255,10 @@ def from_rook_placement(self, rooks, bijection="arcs", n=None): INPUT: - - ``rooks`` -- a list of pairs `(i,j)` satisfying + - ``rooks`` -- list of pairs `(i,j)` satisfying `0 < i < j < n+1`. - - ``bijection`` (default: ``arcs``) -- defines the map from + - ``bijection`` -- (default: ``arcs``) defines the map from rook placements to set partitions. These are currently: - ``arcs``: :meth:`from_arcs`. @@ -2322,11 +2322,11 @@ def from_arcs(self, arcs, n): INPUT: - - ``n`` -- an integer specifying the size of the set - partition to be produced. + - ``n`` -- integer specifying the size of the set + partition to be produced - - ``arcs`` -- a list of pairs specifying which elements are - in the same block. + - ``arcs`` -- list of pairs specifying which elements are + in the same block .. SEEALSO:: @@ -2357,10 +2357,10 @@ def from_rook_placement_gamma(self, rooks, n): INPUT: - - ``n`` -- an integer specifying the size of the set - partition to be produced. + - ``n`` -- integer specifying the size of the set + partition to be produced - - ``rooks`` -- a list of pairs `(i,j)` such that `0 < i < j < n+1`. + - ``rooks`` -- list of pairs `(i,j)` such that `0 < i < j < n+1`. OUTPUT: a set partition @@ -2411,10 +2411,10 @@ def from_rook_placement_rho(self, rooks, n): INPUT: - - ``n`` -- an integer specifying the size of the set - partition to be produced. + - ``n`` -- integer specifying the size of the set + partition to be produced - - ``rooks`` -- a list of pairs `(i,j)` such that `0 < i < j < n+1`. + - ``rooks`` -- list of pairs `(i,j)` such that `0 < i < j < n+1`. OUTPUT: a set partition @@ -2475,11 +2475,10 @@ def from_rook_placement_psi(self, rooks, n): INPUT: - - ``n`` -- an integer specifying the size of the set - partition to be produced. + - ``n`` -- integer specifying the size of the set + partition to be produced - - ``rooks`` -- a list of pairs `(i,j)` such that `0 < i < j < - n+1`. + - ``rooks`` -- list of pairs `(i,j)` such that `0 < i < j < n+1` OUTPUT: a set partition diff --git a/src/sage/combinat/set_partition_ordered.py b/src/sage/combinat/set_partition_ordered.py index 782b13df638..37faaec29be 100644 --- a/src/sage/combinat/set_partition_ordered.py +++ b/src/sage/combinat/set_partition_ordered.py @@ -330,7 +330,7 @@ def sum(osps): INPUT: - - ``osps`` -- a list (or iterable) of ordered set partitions + - ``osps`` -- list (or iterable) of ordered set partitions EXAMPLES:: @@ -938,7 +938,7 @@ def __classcall_private__(cls, s=None, c=None): return OrderedSetPartitions_all() if isinstance(s, (int, Integer)): if s < 0: - raise ValueError("s must be non-negative") + raise ValueError("s must be nonnegative") s = frozenset(range(1, s + 1)) else: s = frozenset(s) diff --git a/src/sage/combinat/shard_order.py b/src/sage/combinat/shard_order.py index e8a55fcdb49..3bc9d2fe5cf 100644 --- a/src/sage/combinat/shard_order.py +++ b/src/sage/combinat/shard_order.py @@ -45,7 +45,7 @@ class ShardPosetElement(tuple): - ``p`` -- the permutation itself as a tuple - ``runs`` -- the decreasing runs as a tuple of tuples - - ``run_indices`` -- a list ``integer -> index of the run`` + - ``run_indices`` -- list; ``integer -> index of the run`` - ``dpg`` -- the transitive closure of the shard preorder graph - ``spg`` -- the transitive reduction of the shard preorder graph @@ -60,7 +60,7 @@ class ShardPosetElement(tuple): """ def __new__(cls, p): r""" - Initialization of the underlying tuple + Initialization of the underlying tuple. TESTS:: diff --git a/src/sage/combinat/shifted_primed_tableau.py b/src/sage/combinat/shifted_primed_tableau.py index 1a2df46478b..7a62719c979 100644 --- a/src/sage/combinat/shifted_primed_tableau.py +++ b/src/sage/combinat/shifted_primed_tableau.py @@ -1533,7 +1533,7 @@ def __ge__(self, other): def is_unprimed(self): """ - Checks if ``self`` is an unprimed element. + Check if ``self`` is an unprimed element. TESTS:: @@ -1546,7 +1546,7 @@ def is_unprimed(self): def is_primed(self): """ - Checks if ``self`` is a primed element. + Check if ``self`` is a primed element. TESTS:: @@ -1644,7 +1644,7 @@ def decrease_one(self): class ShiftedPrimedTableaux(UniqueRepresentation, Parent): r""" - Returns the combinatorial class of shifted primed tableaux subject + Return the combinatorial class of shifted primed tableaux subject to the constraints given by the arguments. A primed tableau is a tableau of shifted shape on the alphabet @@ -1869,9 +1869,7 @@ def _element_constructor_(self, T): - ``T`` -- data which can be interpreted as a primed tableau - OUTPUT: - - - the corresponding primed tableau object + OUTPUT: the corresponding primed tableau object EXAMPLES:: diff --git a/src/sage/combinat/shuffle.py b/src/sage/combinat/shuffle.py index 846a214e30d..4b183ee8981 100644 --- a/src/sage/combinat/shuffle.py +++ b/src/sage/combinat/shuffle.py @@ -81,7 +81,7 @@ def __init__(self, l1, l2, element_constructor=None): sage: from sage.combinat.shuffle import ShuffleProduct sage: SP = ShuffleProduct([1,2],[4,5,7,8,9]) - sage: TestSuite(SP).run(skip="_test_an_element") + sage: TestSuite(SP).run(skip='_test_an_element') """ self._l1 = l1 self._l2 = l2 @@ -140,7 +140,7 @@ def __eq__(self, other): def __ne__(self, other): """ - Test for unequality + Test for unequality. EXAMPLES:: @@ -213,7 +213,7 @@ def __init__(self, l1, l2, element_constructor=None): sage: X = SetShuffleProduct({(1,2,3), (2,3,4)}, {(5,)}) sage: X # random Shuffle set product of: [(2, 3, 4), (1, 2, 3)] and [(5,)] - sage: TestSuite(X).run(skip="_test_an_element") + sage: TestSuite(X).run(skip='_test_an_element') sage: list(SetShuffleProduct({(1,2,3), (2,3,4)}, {(5,)})) # random [[2, 3, 4, 5], [2, 5, 3, 4], [5, 2, 3, 4], [2, 3, 5, 4], @@ -353,7 +353,7 @@ def __init__(self, l1, l2, element_constructor=None): sage: SP = ShuffleProduct([1,2,3],[4,5]) sage: SP Shuffle product of: [1, 2, 3] and [4, 5] - sage: TestSuite(SP).run(skip="_test_an_element") + sage: TestSuite(SP).run(skip='_test_an_element') sage: list(ShuffleProduct(Word("aa"), Word("bbb"), Word)) [word: aabbb, word: baabb, word: ababb, word: bbaab, word: babab, word: abbab, @@ -567,7 +567,7 @@ def __init__(self, w1, w2, r, element_constructor=None, add=operator.add): sage: from sage.combinat.shuffle import ShuffleProduct_overlapping_r sage: w, u = map(Words(range(20)), [[2, 9], [9, 1]]) sage: S = ShuffleProduct_overlapping_r(w,u,1) - sage: TestSuite(S).run(skip="_test_an_element") + sage: TestSuite(S).run(skip='_test_an_element') """ self.r = r self.add = add @@ -777,7 +777,7 @@ def __init__(self, w1, w2, element_constructor=None, add=operator.add): sage: from sage.combinat.shuffle import ShuffleProduct_overlapping sage: w, u = map(Words(range(20)), [[2, 9], [9, 1]]) sage: S = ShuffleProduct_overlapping(w,u) - sage: TestSuite(S).run(skip="_test_an_element") + sage: TestSuite(S).run(skip='_test_an_element') """ self._add = add diff --git a/src/sage/combinat/sidon_sets.py b/src/sage/combinat/sidon_sets.py index 9ba6bdb5c71..e2c85f74633 100644 --- a/src/sage/combinat/sidon_sets.py +++ b/src/sage/combinat/sidon_sets.py @@ -31,12 +31,10 @@ def sidon_sets(N, g=1): INPUT: - - `N` -- A positive integer. - - `g` -- A positive integer (default: `1`). + - ``N`` -- positive integer + - ``g`` -- positive integer (default: `1`) - OUTPUT: - - - A Sage set with categories whose element are also set of integers. + OUTPUT: a Sage set with categories whose element are also set of integers EXAMPLES:: diff --git a/src/sage/combinat/similarity_class_type.py b/src/sage/combinat/similarity_class_type.py index 20a64355f63..0677600f177 100644 --- a/src/sage/combinat/similarity_class_type.py +++ b/src/sage/combinat/similarity_class_type.py @@ -215,9 +215,9 @@ def fq(n, q=None): INPUT: - - ``n`` -- a non-negative integer + - ``n`` -- nonnegative integer - - ``q`` -- an integer or an indeterminate + - ``q`` -- integer or an indeterminate OUTPUT: a rational function in ``q`` @@ -253,13 +253,11 @@ def primitives(n, invertible=False, q=None): - ``n`` -- a positive integer - - ``invertible`` -- boolean; if set, only number of non-zero classes is returned + - ``invertible`` -- boolean; if set, only number of nonzero classes is returned - - ``q`` -- an integer or an indeterminate + - ``q`` -- integer or an indeterminate - OUTPUT: - - - a rational function of the variable ``q`` + OUTPUT: a rational function of the variable ``q`` EXAMPLES:: @@ -290,9 +288,9 @@ def order_of_general_linear_group(n, q=None): INPUT: - - ``n`` -- a non-negative integer + - ``n`` -- a nonnegative integer - - ``q`` -- an integer or an indeterminate + - ``q`` -- integer or an indeterminate EXAMPLES:: @@ -336,7 +334,7 @@ def centralizer_group_cardinality(la, q=None): - ``lambda`` -- a partition - - ``q`` -- an integer or an indeterminate + - ``q`` -- integer or an indeterminate OUTPUT: a polynomial function of ``q`` @@ -582,7 +580,7 @@ def centralizer_group_card(self, q=None): INPUT: - - ``q`` -- an integer or an indeterminate + - ``q`` -- integer or an indeterminate EXAMPLES:: @@ -761,7 +759,7 @@ class SimilarityClassType(CombinatorialElement): INPUT: - - ``tau`` -- a list of primary similarity class types or a square matrix + - ``tau`` -- list of primary similarity class types or a square matrix over a finite field EXAMPLES:: @@ -866,7 +864,7 @@ def centralizer_group_card(self, q=None): INPUT: - - ``q`` -- an integer or an indeterminate + - ``q`` -- integer or an indeterminate EXAMPLES:: @@ -902,10 +900,10 @@ def number_of_classes(self, invertible=False, q=None): INPUT: - - ``invertible`` -- Boolean; return number of invertible classes if set + - ``invertible`` -- boolean; return number of invertible classes if set to ``True`` - - ``q`` -- An integer or an indeterminate + - ``q`` -- integer or an indeterminate EXAMPLES:: @@ -984,7 +982,7 @@ def class_card(self, q=None): INPUT: - - ``q`` -- an integer or an indeterminate + - ``q`` -- integer or an indeterminate EXAMPLES:: @@ -1005,7 +1003,7 @@ def number_of_matrices(self, invertible=False, q=None): INPUT: - - ``invertible`` -- A boolean; return the number of invertible + - ``invertible`` -- a boolean; return the number of invertible matrices if set EXAMPLES:: @@ -1025,7 +1023,7 @@ def number_of_matrices(self, invertible=False, q=None): def statistic(self, func, q=None): r""" - Return + Return. .. MATH:: @@ -1038,7 +1036,7 @@ def statistic(self, func, q=None): - ``func`` -- a function that takes a partition to a polynomial in ``q`` - - ``q`` -- an integer or an indeterminate + - ``q`` -- integer or an indeterminate EXAMPLES:: @@ -1094,7 +1092,7 @@ class SimilarityClassTypes(UniqueRepresentation, Parent): INPUT: - - ``n`` -- a non-negative integer + - ``n`` -- nonnegative integer - ``min`` -- a primary similarity class type EXAMPLES: @@ -1162,7 +1160,7 @@ def _element_constructor_(self, tau): INPUT: - - ``tau`` -- a list of primary similarity class types + - ``tau`` -- list of primary similarity class types EXAMPLES:: @@ -1232,7 +1230,7 @@ def size(self): """ return self._n - def sum(self, stat, sumover="matrices", invertible=False, q=None): + def sum(self, stat, sumover='matrices', invertible=False, q=None): r""" Return the sum of a local statistic over all types. @@ -1250,10 +1248,10 @@ def sum(self, stat, sumover="matrices", invertible=False, q=None): \sum n_{\tau(g)}(q) where `\tau(g)` denotes the type of a matrix `g`, and the sum is over - all `n \times n` matrices if ``sumover`` is set to ``"matrices"``, is + all `n \times n` matrices if ``sumover`` is set to ``'matrices'``, is over all `n \times n` similarity classes if ``sumover`` is set to - ``"classes"``, and over all `n \times n` types if ``sumover`` is set - to ``"types"``. If ``invertible`` is set to ``True``, then the sum is + ``'classes'``, and over all `n \times n` types if ``sumover`` is set + to ``'types'``. If ``invertible`` is set to ``True``, then the sum is only over invertible matrices or classes. INPUT: @@ -1262,11 +1260,11 @@ def sum(self, stat, sumover="matrices", invertible=False, q=None): of ``q`` - ``sumover`` -- can be one of the following: - * ``"matrices"`` - * ``"classes"`` - * ``"types"`` + * ``'matrices'`` + * ``'classes'`` + * ``'types'`` - - ``q`` -- an integer or an indeterminate + - ``q`` -- integer or an indeterminate OUTPUT: a function of ``q`` diff --git a/src/sage/combinat/six_vertex_model.py b/src/sage/combinat/six_vertex_model.py index 365cc0dd360..879418f18d9 100644 --- a/src/sage/combinat/six_vertex_model.py +++ b/src/sage/combinat/six_vertex_model.py @@ -361,13 +361,13 @@ class SixVertexModel(UniqueRepresentation, Parent): There are also the following predefined boundary conditions: - * ``'ice'`` -- The top and bottom boundary conditions are outward and the + * ``'ice'`` -- the top and bottom boundary conditions are outward and the left and right boundary conditions are inward; this gives the square ice model. Also called domain wall boundary conditions. - * ``'domain wall'`` -- Same as ``'ice'``. - * ``'alternating'`` -- The boundary conditions alternate between inward + * ``'domain wall'`` -- same as ``'ice'``. + * ``'alternating'`` -- the boundary conditions alternate between inward and outward. - * ``'free'`` -- There are no boundary conditions. + * ``'free'`` -- there are no boundary conditions. EXAMPLES: diff --git a/src/sage/combinat/skew_partition.py b/src/sage/combinat/skew_partition.py index b78e6b84d1f..696f54db79e 100644 --- a/src/sage/combinat/skew_partition.py +++ b/src/sage/combinat/skew_partition.py @@ -392,7 +392,7 @@ def ferrers_diagram(self): *** *** * - sage: SkewPartitions.options(diagram_str='#', convention="French") + sage: SkewPartitions.options(diagram_str='#', convention='French') sage: print(SkewPartition([[5,4,3,1],[3,1]]).diagram()) # ### @@ -441,7 +441,7 @@ def _ascii_art_(self): [ * * * * ] [ ** ** * * * * * * ] [ ***, * , * , **, ** , *, * , * , * ] - sage: SkewPartitions.options(diagram_str='#', convention="French") + sage: SkewPartitions.options(diagram_str='#', convention='French') sage: ascii_art(SkewPartitions(3).list()) [ # # # # ] [ # # ## ## # # # # ] @@ -816,7 +816,7 @@ def inner_corners(self): icorners += [(nn, 0)] return icorners - def cell_poset(self, orientation="SE"): + def cell_poset(self, orientation='SE'): """ Return the Young diagram of ``self`` as a poset. The optional keyword variable ``orientation`` determines the order relation @@ -825,10 +825,10 @@ def cell_poset(self, orientation="SE"): The poset always uses the set of cells of the Young diagram of ``self`` as its ground set. The order relation of the poset depends on the ``orientation`` variable (which defaults to - ``"SE"``). Concretely, ``orientation`` has to be specified to - one of the strings ``"NW"``, ``"NE"``, ``"SW"``, and ``"SE"``, + ``'SE'``). Concretely, ``orientation`` has to be specified to + one of the strings ``"NW"``, ``"NE"``, ``'SW'``, and ``'SE'``, standing for "northwest", "northeast", "southwest" and - "southeast", respectively. If ``orientation`` is ``"SE"``, then + "southeast", respectively. If ``orientation`` is ``'SE'``, then the order relation of the poset is such that a cell `u` is greater or equal to a cell `v` in the poset if and only if `u` lies weakly southeast of `v` (this means that `u` can be @@ -1054,7 +1054,7 @@ def to_list(self): """ return [list(r) for r in list(self)] - def to_dag(self, format="string"): + def to_dag(self, format='string'): """ Return a directed acyclic graph corresponding to the skew partition ``self``. @@ -1081,7 +1081,7 @@ def to_dag(self, format="string"): ('1,1', '1,2', None)] sage: dag.vertices(sort=True) ['0,1', '0,2', '1,1', '1,2', '2,0'] - sage: dag = SkewPartition([[3, 2, 1], [1, 1]]).to_dag(format="tuple") + sage: dag = SkewPartition([[3, 2, 1], [1, 1]]).to_dag(format='tuple') sage: dag.edges(sort=True) [((0, 1), (0, 2), None), ((0, 1), (1, 1), None)] sage: dag.vertices(sort=True) @@ -1436,7 +1436,7 @@ class options(GlobalOptions): Changing the ``convention`` for skew partitions also changes the ``convention`` option for partitions and tableaux and vice versa:: - sage: SkewPartitions.options(display="diagram", convention='French') + sage: SkewPartitions.options(display='diagram', convention='French') sage: SP * * @@ -1470,15 +1470,15 @@ class options(GlobalOptions): values=dict(lists='displayed as a pair of lists', quotient='displayed as a quotient of partitions', diagram='as a skew Ferrers diagram'), - alias=dict(array="diagram", ferrers_diagram="diagram", - young_diagram="diagram", pair="lists"), + alias=dict(array='diagram', ferrers_diagram="diagram", + young_diagram='diagram', pair='lists'), case_sensitive=False) latex = dict(default="young_diagram", description='Specifies how skew partitions should be latexed', values=dict(diagram='latex as a skew Ferrers diagram', young_diagram='latex as a skew Young diagram', marked='latex as a partition where the skew shape is marked'), - alias=dict(array="diagram", ferrers_diagram="diagram"), + alias=dict(array='diagram', ferrers_diagram='diagram'), case_sensitive=False) diagram_str = dict(link_to=(Partitions.options,'diagram_str')) latex_diagram_str = dict(link_to=(Partitions.options,'latex_diagram_str')) @@ -1571,9 +1571,9 @@ def from_row_and_column_length(self, rowL, colL): INPUT: - - ``rowL`` -- A composition or a list of positive integers + - ``rowL`` -- a composition or a list of positive integers - - ``colL`` -- A composition or a list of positive integers + - ``colL`` -- a composition or a list of positive integers OUTPUT: @@ -1716,9 +1716,9 @@ class SkewPartitions_n(SkewPartitions): INPUT: - - ``n`` -- a non-negative integer + - ``n`` -- a nonnegative integer - - ``overlap`` -- an integer (default: `0`) + - ``overlap`` -- integer (default: `0`) Caveat: this set is stable under conjugation only for ``overlap`` equal to 0 or 1. What exactly happens for negative overlaps is not yet @@ -1768,8 +1768,8 @@ def __init__(self, n, overlap): INPUT: - - ``n`` -- a non-negative integer - - ``overlap`` -- an integer + - ``n`` -- a nonnegative integer + - ``overlap`` -- integer TESTS:: diff --git a/src/sage/combinat/skew_tableau.py b/src/sage/combinat/skew_tableau.py index 5b4c69aced5..4c6169eb81b 100644 --- a/src/sage/combinat/skew_tableau.py +++ b/src/sage/combinat/skew_tableau.py @@ -683,7 +683,7 @@ def is_semistandard(self): def to_tableau(self): """ - Returns a tableau with the same filling. This only works if the + Return a tableau with the same filling. This only works if the inner shape of the skew tableau has size zero. EXAMPLES:: @@ -1273,7 +1273,7 @@ def standardization(self, check=True): INPUT: - - ``check`` -- (Default: ``True``) Check to make sure ``self`` is + - ``check`` -- (default: ``True``) check to make sure ``self`` is semistandard. Set to ``False`` to avoid this check. EXAMPLES:: @@ -1340,17 +1340,17 @@ def bender_knuth_involution(self, k, rows=None, check=True): INPUT: - - ``k`` -- an integer + - ``k`` -- integer - - ``rows`` -- (Default ``None``) When set to ``None``, the method + - ``rows`` -- (default: ``None``) when set to ``None``, the method computes the `k`-th Bender--Knuth involution as defined above. When an iterable, this computes the composition of the `k`-th Bender--Knuth switches at row `i` over all `i` in ``rows``. When set to an integer `i`, the method computes the `k`-th Bender--Knuth switch at row `i`. Note the indexing of the rows starts with `1`. - - ``check`` -- (Default: ``True``) Check to make sure ``self`` is - semistandard. Set to ``False`` to avoid this check. + - ``check`` -- (default: ``True``) check to make sure ``self`` is + semistandard; set to ``False`` to avoid this check OUTPUT: @@ -1753,7 +1753,7 @@ def cells_containing(self, i): def is_k_tableau(self, k): r""" - Checks whether ``self`` is a valid skew weak `k`-tableau. + Check whether ``self`` is a valid skew weak `k`-tableau. EXAMPLES:: @@ -1841,7 +1841,7 @@ def _element_constructor_(self, st): def __contains__(self, x): """ - Checks if ``x`` is a skew tableau. + Check if ``x`` is a skew tableau. EXAMPLES:: @@ -2215,7 +2215,7 @@ def __iter__(self): [[None, 1, 3], [None, 2], [4]], [[None, 2, 4], [None, 3], [1]]] """ - dag = self.skp.to_dag(format="tuple") + dag = self.skp.to_dag(format='tuple') le_list = list(dag.topological_sort_generator()) empty = [[None] * row_length for row_length in self.skp.outer()] @@ -2601,9 +2601,9 @@ class SemistandardSkewTableaux_shape(SemistandardSkewTableaux): INPUT: - - ``p`` -- A skew partition + - ``p`` -- a skew partition - - ``max_entry`` -- The max entry; defaults to the size of ``p``. + - ``max_entry`` -- the max entry; defaults to the size of ``p`` .. WARNING:: diff --git a/src/sage/combinat/sloane_functions.py b/src/sage/combinat/sloane_functions.py index 4bc9e1cca78..14568d0f7be 100644 --- a/src/sage/combinat/sloane_functions.py +++ b/src/sage/combinat/sloane_functions.py @@ -456,7 +456,7 @@ def __init__(self): INPUT: - - ``n`` -- non negative integer + - ``n`` -- nonnegative integer EXAMPLES:: @@ -561,11 +561,9 @@ def __init__(self): INPUT: - - ``n`` -- non negative integer + - ``n`` -- nonnegative integer - OUTPUT: - - - ``integer`` -- function value + OUTPUT: integer -- function value EXAMPLES:: @@ -613,11 +611,9 @@ def __init__(self): INPUT: - - ``n`` -- non negative integer - - OUTPUT: + - ``n`` -- nonnegative integer - - ``integer`` -- function value + OUTPUT: integer -- function value EXAMPLES:: @@ -713,9 +709,7 @@ def __init__(self): - ``n`` -- positive integer - OUTPUT: - - - ``integer`` -- function value + OUTPUT: integer -- function value EXAMPLES:: @@ -816,11 +810,9 @@ def __init__(self): INPUT: - - ``n`` -- non negative integer + - ``n`` -- nonnegative integer - OUTPUT: - - - ``integer`` -- function value + OUTPUT: integer -- function value EXAMPLES:: @@ -873,11 +865,9 @@ def __init__(self): INPUT: - - ``n`` -- non negative integer - - OUTPUT: + - ``n`` -- nonnegative integer - - ``integer`` -- function value + OUTPUT: integer -- function value EXAMPLES:: @@ -938,11 +928,9 @@ def __init__(self): INPUT: - - ``n`` -- non negative integer + - ``n`` -- nonnegative integer - OUTPUT: - - - ``integer`` -- function value + OUTPUT: integer -- function value EXAMPLES:: @@ -1015,11 +1003,9 @@ def __init__(self): INPUT: - - ``n`` -- non negative integer - - OUTPUT: + - ``n`` -- nonnegative integer - - ``integer`` -- function value + OUTPUT: integer -- function value EXAMPLES:: @@ -1061,7 +1047,7 @@ def _repr_(self): def s2(self, n, k): """ - Returns the Stirling number S2(n,k) of the 2nd kind. + Return the Stirling number S2(n,k) of the 2nd kind. EXAMPLES:: @@ -1093,11 +1079,9 @@ def __init__(self): INPUT: - - ``n`` -- non negative integer + - ``n`` -- nonnegative integer - OUTPUT: - - - ``integer`` -- function value + OUTPUT: integer -- function value EXAMPLES:: @@ -1165,11 +1149,9 @@ def __init__(self): INPUT: - - ``n`` -- non negative integer - - OUTPUT: + - ``n`` -- nonnegative integer - - ``integer`` -- function value + OUTPUT: integer -- function value EXAMPLES:: @@ -1224,11 +1206,9 @@ def __init__(self): INPUT: - - ``n`` -- non negative integer + - ``n`` -- nonnegative integer - OUTPUT: - - - ``integer`` -- function value + OUTPUT: integer -- function value EXAMPLES:: @@ -1275,11 +1255,9 @@ def __init__(self): INPUT: - - ``n`` -- non negative integer - - OUTPUT: + - ``n`` -- nonnegative integer - - ``integer`` -- function value + OUTPUT: integer -- function value EXAMPLES:: @@ -1330,11 +1308,9 @@ def __init__(self): INPUT: - - ``n`` -- non negative integer + - ``n`` -- nonnegative integer - OUTPUT: - - - ``integer`` -- function value + OUTPUT: integer -- function value EXAMPLES:: @@ -1386,11 +1362,9 @@ def __init__(self): INPUT: - - ``n`` -- non negative integer - - OUTPUT: + - ``n`` -- nonnegative integer - - ``integer`` -- function value + OUTPUT: integer -- function value EXAMPLES:: @@ -1443,9 +1417,7 @@ def __init__(self): - ``n`` -- integer - OUTPUT: - - - ``integer`` -- function value + OUTPUT: integer -- function value EXAMPLES:: @@ -1497,11 +1469,9 @@ def __init__(self): INPUT: - - ``n`` -- non negative integer - - OUTPUT: + - ``n`` -- nonnegative integer - - ``integer`` -- function value + OUTPUT: integer -- function value EXAMPLES:: @@ -1555,11 +1525,9 @@ def __init__(self): INPUT: - - ``n`` -- non negative integer + - ``n`` -- nonnegative integer - OUTPUT: - - - ``integer`` -- function value + OUTPUT: integer -- function value EXAMPLES:: @@ -1610,11 +1578,9 @@ def __init__(self): INPUT: - - ``n`` -- non negative integer - - OUTPUT: + - ``n`` -- nonnegative integer - - ``integer`` -- function value + OUTPUT: integer -- function value EXAMPLES:: @@ -1663,11 +1629,9 @@ def __init__(self): INPUT: - - ``n`` -- non negative integer + - ``n`` -- nonnegative integer - OUTPUT: - - - ``integer`` -- function value + OUTPUT: integer -- function value EXAMPLES:: @@ -1720,11 +1684,9 @@ def __init__(self): INPUT: - - ``n`` -- non negative integer - - OUTPUT: + - ``n`` -- nonnegative integer - - ``integer`` -- function value + OUTPUT: integer -- function value EXAMPLES:: @@ -1776,11 +1738,9 @@ def __init__(self): INPUT: - - ``n`` -- non negative integer + - ``n`` -- nonnegative integer - OUTPUT: - - - ``integer`` -- function value + OUTPUT: integer -- function value EXAMPLES:: @@ -1829,11 +1789,9 @@ def __init__(self): INPUT: - - ``n`` -- non negative integer - - OUTPUT: + - ``n`` -- nonnegative integer - - ``integer`` -- function value + OUTPUT: integer -- function value EXAMPLES:: @@ -1884,11 +1842,9 @@ def __init__(self): INPUT: - - ``n`` -- non negative integer + - ``n`` -- nonnegative integer - OUTPUT: - - - ``integer`` -- function value + OUTPUT: integer -- function value EXAMPLES:: @@ -1933,11 +1889,9 @@ def __init__(self): INPUT: - - ``n`` -- non negative integer - - OUTPUT: + - ``n`` -- nonnegative integer - - ``integer`` -- function value + OUTPUT: integer -- function value EXAMPLES:: @@ -2000,11 +1954,9 @@ def __init__(self): INPUT: - - ``n`` -- non negative integer + - ``n`` -- nonnegative integer - OUTPUT: - - - ``integer`` -- function value + OUTPUT: integer -- function value EXAMPLES:: @@ -2053,11 +2005,9 @@ def __init__(self): INPUT: - - ``n`` -- non negative integer - - OUTPUT: + - ``n`` -- nonnegative integer - - ``integer`` -- function value + OUTPUT: integer -- function value EXAMPLES:: @@ -2102,11 +2052,9 @@ def __init__(self): INPUT: - - ``n`` -- non negative integer + - ``n`` -- nonnegative integer - OUTPUT: - - - ``integer`` -- function value + OUTPUT: integer -- function value EXAMPLES:: @@ -2155,11 +2103,9 @@ def __init__(self): INPUT: - - ``n`` -- non negative integer - - OUTPUT: + - ``n`` -- nonnegative integer - - ``integer`` -- function value + OUTPUT: integer -- function value EXAMPLES:: @@ -2208,11 +2154,9 @@ def __init__(self): INPUT: - - ``n`` -- non negative integer + - ``n`` -- nonnegative integer - OUTPUT: - - - ``integer`` -- function value + OUTPUT: integer -- function value EXAMPLES:: @@ -2262,11 +2206,9 @@ def __init__(self): INPUT: - - ``n`` -- non negative integer - - OUTPUT: + - ``n`` -- nonnegative integer - - ``integer`` -- function value + OUTPUT: integer -- function value EXAMPLES:: @@ -2324,11 +2266,9 @@ def __init__(self): INPUT: - - ``n`` -- non negative integer + - ``n`` -- nonnegative integer - OUTPUT: - - - ``integer`` -- function value + OUTPUT: integer -- function value EXAMPLES:: @@ -2384,11 +2324,9 @@ def __init__(self): INPUT: - - ``n`` -- non negative integer - - OUTPUT: + - ``n`` -- nonnegative integer - - ``integer`` -- function value + OUTPUT: integer -- function value EXAMPLES:: @@ -2450,11 +2388,9 @@ def __init__(self): INPUT: - - ``n`` -- non negative integer + - ``n`` -- nonnegative integer - OUTPUT: - - - ``integer`` -- function value + OUTPUT: integer -- function value EXAMPLES:: @@ -2506,11 +2442,9 @@ def __init__(self): INPUT: - - ``n`` -- non negative integer - - OUTPUT: + - ``n`` -- nonnegative integer - - ``integer`` -- function value + OUTPUT: integer -- function value EXAMPLES:: @@ -2600,11 +2534,9 @@ def __init__(self): INPUT: - - ``n`` -- non negative integer + - ``n`` -- nonnegative integer - OUTPUT: - - - ``integer`` -- function value + OUTPUT: integer -- function value EXAMPLES:: @@ -2661,11 +2593,9 @@ def __init__(self): INPUT: - - ``n`` -- non negative integer - - OUTPUT: + - ``n`` -- nonnegative integer - - ``integer`` -- function value + OUTPUT: integer -- function value EXAMPLES:: @@ -2717,11 +2647,9 @@ def __init__(self): INPUT: - - ``n`` -- non negative integer + - ``n`` -- nonnegative integer - OUTPUT: - - - ``integer`` -- function value + OUTPUT: integer -- function value EXAMPLES:: @@ -2806,11 +2734,9 @@ def __init__(self): INPUT: - - ``n`` -- non negative integer - - OUTPUT: + - ``n`` -- nonnegative integer - - ``integer`` -- function value + OUTPUT: integer -- function value EXAMPLES:: @@ -2864,11 +2790,9 @@ def __init__(self): INPUT: - - ``n`` -- non negative integer + - ``n`` -- nonnegative integer - OUTPUT: - - - ``integer`` -- function value + OUTPUT: integer -- function value EXAMPLES:: @@ -2930,11 +2854,9 @@ def __init__(self): INPUT: - - ``n`` -- non negative integer - - OUTPUT: + - ``n`` -- nonnegative integer - - ``integer`` -- function value + OUTPUT: integer -- function value EXAMPLES:: @@ -2999,11 +2921,9 @@ def __init__(self): INPUT: - - ``n`` -- non negative integer + - ``n`` -- nonnegative integer - OUTPUT: - - - ``integer`` -- function value + OUTPUT: integer -- function value EXAMPLES:: @@ -3055,11 +2975,9 @@ def __init__(self): INPUT: - - ``n`` -- non negative integer - - OUTPUT: + - ``n`` -- nonnegative integer - - ``integer`` -- function value + OUTPUT: integer -- function value EXAMPLES:: @@ -3147,11 +3065,9 @@ def __init__(self): INPUT: - - ``n`` -- non negative integer + - ``n`` -- nonnegative integer - OUTPUT: - - - ``integer`` -- function value + OUTPUT: integer -- function value EXAMPLES:: @@ -3239,11 +3155,9 @@ def __init__(self): INPUT: - - ``n`` -- non negative integer - - OUTPUT: + - ``n`` -- nonnegative integer - - ``integer`` -- function value + OUTPUT: integer -- function value EXAMPLES:: @@ -3293,11 +3207,9 @@ def __init__(self): INPUT: - - ``n`` -- non negative integer + - ``n`` -- nonnegative integer - OUTPUT: - - - ``integer`` -- function value + OUTPUT: integer -- function value EXAMPLES:: @@ -3350,11 +3262,9 @@ def __init__(self): INPUT: - - ``n`` -- non negative integer - - OUTPUT: + - ``n`` -- nonnegative integer - - ``integer`` -- function value + OUTPUT: integer -- function value EXAMPLES:: @@ -3405,11 +3315,9 @@ def __init__(self): INPUT: - - ``n`` -- non negative integer + - ``n`` -- nonnegative integer - OUTPUT: - - - ``integer`` -- function value + OUTPUT: integer -- function value EXAMPLES:: @@ -3488,11 +3396,9 @@ def __init__(self): INPUT: - - ``n`` -- non negative integer - - OUTPUT: + - ``n`` -- nonnegative integer - - ``integer`` -- function value + OUTPUT: integer -- function value EXAMPLES:: @@ -3543,15 +3449,13 @@ def _eval(self, n): class A000961(SloaneSequence): def __init__(self): r""" - Prime powers + Prime powers. INPUT: - - ``n`` -- non negative integer + - ``n`` -- nonnegative integer - OUTPUT: - - - ``integer`` -- function value + OUTPUT: integer -- function value EXAMPLES:: @@ -3632,15 +3536,13 @@ def list(self, n): class A005117(SloaneSequence): def __init__(self): r""" - Square-free numbers + Square-free numbers. INPUT: - - ``n`` -- non negative integer - - OUTPUT: + - ``n`` -- nonnegative integer - - ``integer`` -- function value + OUTPUT: integer -- function value EXAMPLES:: @@ -3726,11 +3628,9 @@ def __init__(self): INPUT: - - ``n`` -- non negative integer + - ``n`` -- nonnegative integer - OUTPUT: - - - ``integer`` -- function value + OUTPUT: integer -- function value EXAMPLES:: @@ -3816,11 +3716,9 @@ def __init__(self): INPUT: - - ``n`` -- non negative integer - - OUTPUT: + - ``n`` -- nonnegative integer - - ``integer`` -- function value + OUTPUT: integer -- function value EXAMPLES:: @@ -3878,11 +3776,9 @@ def __init__(self): INPUT: - - ``n`` -- non negative integer + - ``n`` -- nonnegative integer - OUTPUT: - - - ``integer`` -- function value + OUTPUT: integer -- function value EXAMPLES:: @@ -3934,7 +3830,7 @@ def _precompute(self, how_many=500): def fib(self): """ - Returns a generator over all Fibonacci numbers, starting with 0. + Return a generator over all Fibonacci numbers, starting with 0. EXAMPLES:: @@ -3980,11 +3876,9 @@ def __init__(self): INPUT: - - ``n`` -- non negative integer - - OUTPUT: + - ``n`` -- nonnegative integer - - ``integer`` -- function value + OUTPUT: integer -- function value EXAMPLES:: @@ -4034,11 +3928,9 @@ def __init__(self): INPUT: - - ``n`` -- non negative integer + - ``n`` -- nonnegative integer - OUTPUT: - - - ``integer`` -- function value + OUTPUT: integer -- function value EXAMPLES:: @@ -4087,11 +3979,9 @@ def __init__(self): INPUT: - - ``n`` -- non negative integer - - OUTPUT: + - ``n`` -- nonnegative integer - - ``integer`` -- function value + OUTPUT: integer -- function value EXAMPLES:: @@ -4140,11 +4030,9 @@ def __init__(self): INPUT: - - ``n`` -- non negative integer + - ``n`` -- nonnegative integer - OUTPUT: - - - ``integer`` -- function value + OUTPUT: integer -- function value EXAMPLES:: @@ -4195,11 +4083,9 @@ def __init__(self): INPUT: - - ``n`` -- non negative integer - - OUTPUT: + - ``n`` -- nonnegative integer - - ``integer`` -- function value + OUTPUT: integer -- function value EXAMPLES:: @@ -4250,11 +4136,9 @@ def __init__(self): INPUT: - - ``n`` -- non negative integer + - ``n`` -- nonnegative integer - OUTPUT: - - - ``integer`` -- function value + OUTPUT: integer -- function value EXAMPLES:: @@ -4303,11 +4187,9 @@ def __init__(self): INPUT: - - ``n`` -- non negative integer - - OUTPUT: + - ``n`` -- nonnegative integer - - ``integer`` -- function value + OUTPUT: integer -- function value EXAMPLES:: @@ -4361,11 +4243,9 @@ def __init__(self): INPUT: - - ``n`` -- non negative integer + - ``n`` -- nonnegative integer - OUTPUT: - - - ``integer`` -- function value + OUTPUT: integer -- function value EXAMPLES:: @@ -4414,11 +4294,9 @@ def __init__(self): INPUT: - - ``n`` -- non negative integer - - OUTPUT: + - ``n`` -- nonnegative integer - - ``integer`` -- function value + OUTPUT: integer -- function value EXAMPLES:: @@ -4468,11 +4346,9 @@ def __init__(self): INPUT: - - ``n`` -- non negative integer + - ``n`` -- nonnegative integer - OUTPUT: - - - ``integer`` -- function value + OUTPUT: integer -- function value EXAMPLES:: @@ -4525,11 +4401,9 @@ def __init__(self): INPUT: - - ``n`` -- non negative integer - - OUTPUT: + - ``n`` -- nonnegative integer - - ``integer`` -- function value + OUTPUT: integer -- function value EXAMPLES:: @@ -4582,11 +4456,9 @@ def __init__(self): INPUT: - - ``n`` -- non negative integer + - ``n`` -- nonnegative integer - OUTPUT: - - - ``integer`` -- function value + OUTPUT: integer -- function value EXAMPLES:: @@ -4638,11 +4510,9 @@ def __init__(self): INPUT: - - ``n`` -- non negative integer - - OUTPUT: + - ``n`` -- nonnegative integer - - ``integer`` -- function value + OUTPUT: integer -- function value EXAMPLES:: @@ -4692,11 +4562,9 @@ def __init__(self): INPUT: - - ``n`` -- non negative integer + - ``n`` -- nonnegative integer - OUTPUT: - - - ``integer`` -- function value + OUTPUT: integer -- function value EXAMPLES:: @@ -4745,11 +4613,9 @@ def __init__(self): INPUT: - - ``n`` -- non negative integer - - OUTPUT: + - ``n`` -- nonnegative integer - - ``integer`` -- function value + OUTPUT: integer -- function value EXAMPLES:: @@ -4848,11 +4714,9 @@ def __init__(self): INPUT: - - ``n`` -- non negative integer + - ``n`` -- nonnegative integer - OUTPUT: - - - ``integer`` -- function value + OUTPUT: integer -- function value EXAMPLES:: @@ -4900,11 +4764,9 @@ def __init__(self): INPUT: - - ``n`` -- non negative integer - - OUTPUT: + - ``n`` -- nonnegative integer - - ``integer`` -- function value + OUTPUT: integer -- function value EXAMPLES:: @@ -4952,11 +4814,9 @@ def __init__(self): INPUT: - - ``n`` -- non negative integer + - ``n`` -- nonnegative integer - OUTPUT: - - - ``integer`` -- function value + OUTPUT: integer -- function value EXAMPLES:: @@ -5004,11 +4864,9 @@ def __init__(self): INPUT: - - ``n`` -- non negative integer - - OUTPUT: + - ``n`` -- nonnegative integer - - ``integer`` -- function value + OUTPUT: integer -- function value EXAMPLES:: @@ -5125,11 +4983,9 @@ def __init__(self): INPUT: - - ``n`` -- non negative integer + - ``n`` -- nonnegative integer - OUTPUT: - - - ``integer`` -- function value + OUTPUT: integer -- function value EXAMPLES:: @@ -5178,11 +5034,9 @@ def __init__(self): INPUT: - - ``n`` -- non negative integer - - OUTPUT: + - ``n`` -- nonnegative integer - - ``integer`` -- function value + OUTPUT: integer -- function value EXAMPLES:: @@ -5236,11 +5090,9 @@ def __init__(self): INPUT: - - ``n`` -- non negative integer + - ``n`` -- nonnegative integer - OUTPUT: - - - ``integer`` -- function value + OUTPUT: integer -- function value EXAMPLES:: @@ -5298,9 +5150,7 @@ def __init__(self): - ``n`` -- positive integer >= 2 - OUTPUT: - - - ``integer`` -- function value + OUTPUT: integer -- function value EXAMPLES:: @@ -5356,11 +5206,9 @@ def __init__(self): INPUT: - - ``n`` -- positive integer >= 3 + - ``n`` -- positive integer `\geq 3` - OUTPUT: - - - ``integer`` -- function value + OUTPUT: integer -- function value EXAMPLES:: @@ -5441,11 +5289,9 @@ def __init__(self): INPUT: - - ``n`` -- non negative integer - - OUTPUT: + - ``n`` -- nonnegative integer - - ``integer`` -- function value + OUTPUT: integer -- function value EXAMPLES:: @@ -5505,11 +5351,9 @@ def __init__(self): INPUT: - - ``n`` -- non negative integer + - ``n`` -- nonnegative integer - OUTPUT: - - - ``integer`` -- function value + OUTPUT: integer -- function value EXAMPLES:: @@ -5570,11 +5414,9 @@ def __init__(self): INPUT: - - ``n`` -- non negative integer - - OUTPUT: + - ``n`` -- nonnegative integer - - ``integer`` -- function value + OUTPUT: integer -- function value EXAMPLES:: @@ -5643,11 +5485,9 @@ def __init__(self): INPUT: - - ``n`` -- non negative integer + - ``n`` -- nonnegative integer - OUTPUT: - - - ``integer`` -- function value + OUTPUT: integer -- function value EXAMPLES:: @@ -5716,11 +5556,9 @@ def __init__(self): INPUT: - - ``n`` -- non negative integer - - OUTPUT: + - ``n`` -- nonnegative integer - - ``integer`` -- function value + OUTPUT: integer -- function value EXAMPLES:: @@ -5789,11 +5627,9 @@ def __init__(self): INPUT: - - ``n`` -- non negative integer + - ``n`` -- nonnegative integer - OUTPUT: - - - ``integer`` -- function value + OUTPUT: integer -- function value EXAMPLES:: @@ -5864,11 +5700,9 @@ def __init__(self): INPUT: - - ``n`` -- non negative integer - - OUTPUT: + - ``n`` -- nonnegative integer - - ``integer`` -- function value + OUTPUT: integer -- function value EXAMPLES:: @@ -5929,11 +5763,9 @@ def __init__(self): INPUT: - - ``n`` -- non negative integer + - ``n`` -- nonnegative integer - OUTPUT: - - - ``integer`` -- function value + OUTPUT: integer -- function value EXAMPLES:: @@ -5991,11 +5823,9 @@ def __init__(self): INPUT: - - ``n`` -- non negative integer - - OUTPUT: + - ``n`` -- nonnegative integer - - ``integer`` -- function value + OUTPUT: integer -- function value EXAMPLES:: @@ -6051,11 +5881,9 @@ def __init__(self): INPUT: - - ``n`` -- non negative integer + - ``n`` -- nonnegative integer - OUTPUT: - - - ``integer`` -- function value + OUTPUT: integer -- function value EXAMPLES:: @@ -6104,11 +5932,9 @@ def __init__(self): INPUT: - - ``n`` -- non negative integer - - OUTPUT: + - ``n`` -- nonnegative integer - - ``integer`` -- function value + OUTPUT: integer -- function value EXAMPLES:: @@ -6158,11 +5984,9 @@ def __init__(self): INPUT: - - ``n`` -- non negative integer + - ``n`` -- nonnegative integer - OUTPUT: - - - ``integer`` -- function value + OUTPUT: integer -- function value EXAMPLES:: @@ -6221,11 +6045,9 @@ def __init__(self): INPUT: - - ``n`` -- non negative integer - - OUTPUT: + - ``n`` -- nonnegative integer - - ``integer`` -- function value + OUTPUT: integer -- function value EXAMPLES:: @@ -6278,11 +6100,9 @@ def __init__(self): INPUT: - - ``n`` -- non negative integer + - ``n`` -- nonnegative integer - OUTPUT: - - - ``integer`` -- function value + OUTPUT: integer -- function value EXAMPLES:: @@ -6332,11 +6152,9 @@ def __init__(self): INPUT: - - ``n`` -- non negative integer - - OUTPUT: + - ``n`` -- nonnegative integer - - ``integer`` -- function value + OUTPUT: integer -- function value EXAMPLES:: @@ -6450,11 +6268,9 @@ def __init__(self): INPUT: - - ``n`` -- non negative integer + - ``n`` -- nonnegative integer - OUTPUT: - - - ``integer`` -- function value + OUTPUT: integer -- function value EXAMPLES:: @@ -6513,11 +6329,9 @@ def __init__(self): INPUT: - - ``n`` -- non negative integer - - OUTPUT: + - ``n`` -- nonnegative integer - - ``integer`` -- function value + OUTPUT: integer -- function value EXAMPLES:: @@ -6570,7 +6384,7 @@ def g(self,k): class A001221(SloaneSequence): def __init__(self): r""" - Number of different prime divisors of `n` + Number of different prime divisors of `n`. Also called omega(n) or `\omega(n)`. Maximal number of terms in any factorization of `n`. Number of prime powers @@ -6578,11 +6392,9 @@ def __init__(self): INPUT: - - ``n`` -- non negative integer + - ``n`` -- nonnegative integer - OUTPUT: - - - ``integer`` -- function value + OUTPUT: integer -- function value EXAMPLES:: @@ -6640,11 +6452,9 @@ def __init__(self): INPUT: - - ``n`` -- non negative integer - - OUTPUT: + - ``n`` -- nonnegative integer - - ``integer`` -- function value + OUTPUT: integer -- function value EXAMPLES:: @@ -6702,9 +6512,7 @@ class A046660(SloaneSequence): - ``n`` -- positive integer - OUTPUT: - - - ``integer`` -- function value + OUTPUT: integer -- function value EXAMPLES:: @@ -6756,11 +6564,9 @@ def __init__(self): INPUT: - - ``n`` -- non negative integer - - OUTPUT: + - ``n`` -- nonnegative integer - - ``integer`` -- function value + OUTPUT: integer -- function value EXAMPLES:: @@ -6822,11 +6628,9 @@ def __init__(self): INPUT: - - ``n`` -- non negative integer + - ``n`` -- nonnegative integer - OUTPUT: - - - ``integer`` -- function value + OUTPUT: integer -- function value EXAMPLES:: @@ -6922,11 +6726,9 @@ def __init__(self): INPUT: - - ``n`` -- non negative integer - - OUTPUT: + - ``n`` -- nonnegative integer - - ``integer`` -- function value + OUTPUT: integer -- function value EXAMPLES:: @@ -7048,7 +6850,7 @@ def is_powerful(self, n) -> bool: INPUT: - - `n` -- integer + - ``n`` -- integer OUTPUT: ``True`` if `n` is a powerful number, else ``False`` @@ -7080,11 +6882,9 @@ def __init__(self): INPUT: - - ``n`` -- non negative integer - - OUTPUT: + - ``n`` -- nonnegative integer - - ``integer`` -- function value + OUTPUT: integer -- function value EXAMPLES:: @@ -7249,11 +7049,9 @@ def __init__(self): INPUT: - - ``n`` -- non negative integer + - ``n`` -- nonnegative integer - OUTPUT: - - - ``integer`` -- function value + OUTPUT: integer -- function value EXAMPLES:: @@ -7298,11 +7096,9 @@ def __init__(self): INPUT: - - ``n`` -- non negative integer - - OUTPUT: + - ``n`` -- nonnegative integer - - ``integer`` -- function value + OUTPUT: integer -- function value EXAMPLES:: @@ -7348,11 +7144,9 @@ def __init__(self): INPUT: - - ``n`` -- non negative integer + - ``n`` -- nonnegative integer - OUTPUT: - - - ``integer`` -- function value + OUTPUT: integer -- function value EXAMPLES:: @@ -7401,11 +7195,9 @@ def __init__(self): INPUT: - - ``n`` -- non negative integer - - OUTPUT: + - ``n`` -- nonnegative integer - - ``integer`` -- function value + OUTPUT: integer -- function value EXAMPLES:: @@ -7448,11 +7240,9 @@ def __init__(self): INPUT: - - ``n`` -- non negative integer + - ``n`` -- nonnegative integer - OUTPUT: - - - ``integer`` -- function value + OUTPUT: integer -- function value EXAMPLES:: @@ -7500,11 +7290,9 @@ def __init__(self): INPUT: - - ``n`` -- non negative integer - - OUTPUT: + - ``n`` -- nonnegative integer - - ``integer`` -- function value + OUTPUT: integer -- function value EXAMPLES:: @@ -7548,11 +7336,9 @@ def __init__(self): INPUT: - - ``n`` -- non negative integer + - ``n`` -- nonnegative integer - OUTPUT: - - - ``integer`` -- function value + OUTPUT: integer -- function value EXAMPLES:: @@ -7596,11 +7382,9 @@ def __init__(self): INPUT: - - ``n`` -- non negative integer - - OUTPUT: + - ``n`` -- nonnegative integer - - ``integer`` -- function value + OUTPUT: integer -- function value EXAMPLES:: @@ -7646,11 +7430,9 @@ def __init__(self): INPUT: - - ``n`` -- non negative integer + - ``n`` -- nonnegative integer - OUTPUT: - - - ``integer`` -- function value + OUTPUT: integer -- function value EXAMPLES:: @@ -7698,11 +7480,9 @@ def __init__(self): INPUT: - - ``n`` -- non negative integer - - OUTPUT: + - ``n`` -- nonnegative integer - - ``integer`` -- function value + OUTPUT: integer -- function value EXAMPLES:: @@ -7780,11 +7560,9 @@ def __init__(self): INPUT: - - ``n`` -- non negative integer + - ``n`` -- nonnegative integer - OUTPUT: - - - ``integer`` -- function value + OUTPUT: integer -- function value EXAMPLES:: @@ -7835,11 +7613,9 @@ def __init__(self): INPUT: - - ``n`` -- non negative integer - - OUTPUT: + - ``n`` -- nonnegative integer - - ``integer`` -- function value + OUTPUT: integer -- function value EXAMPLES:: @@ -7892,11 +7668,9 @@ def __init__(self): INPUT: - - ``n`` -- non negative integer + - ``n`` -- nonnegative integer - OUTPUT: - - - ``integer`` -- function value + OUTPUT: integer -- function value EXAMPLES:: @@ -7943,11 +7717,9 @@ def __init__(self): INPUT: - - ``n`` -- non negative integer - - OUTPUT: + - ``n`` -- nonnegative integer - - ``integer`` -- function value + OUTPUT: integer -- function value EXAMPLES:: @@ -8001,11 +7773,9 @@ def __init__(self): INPUT: - - ``n`` -- non negative integer + - ``n`` -- nonnegative integer - OUTPUT: - - - ``integer`` -- function value + OUTPUT: integer -- function value EXAMPLES:: @@ -8049,11 +7819,9 @@ def __init__(self): INPUT: - - ``n`` -- non negative integer - - OUTPUT: + - ``n`` -- nonnegative integer - - ``integer`` -- function value + OUTPUT: integer -- function value EXAMPLES:: @@ -8135,11 +7903,9 @@ def __init__(self): INPUT: - - ``n`` -- non negative integer + - ``n`` -- nonnegative integer - OUTPUT: - - - ``integer`` -- function value + OUTPUT: integer -- function value EXAMPLES:: @@ -8219,11 +7985,9 @@ def __init__(self): INPUT: - - ``n`` -- non negative integer - - OUTPUT: + - ``n`` -- nonnegative integer - - ``integer`` -- function value + OUTPUT: integer -- function value EXAMPLES:: @@ -8303,7 +8067,7 @@ def perm_mh(m, h): INPUT: - ``m`` -- positive integer - - ``h`` -- non negative integer + - ``h`` -- nonnegative integer OUTPUT: permanent of the `m \times (m+h)` matrix, etc. @@ -8346,9 +8110,7 @@ class A079922(SloaneSequence): - ``n`` -- positive integer - OUTPUT: - - - ``integer`` -- function value + OUTPUT: integer -- function value EXAMPLES:: @@ -8416,9 +8178,7 @@ class A079923(SloaneSequence): - ``n`` -- positive integer - OUTPUT: - - - ``integer`` -- function value + OUTPUT: integer -- function value EXAMPLES:: @@ -8492,11 +8252,9 @@ class A109814(SloaneSequence): INPUT: - - ``n`` -- non negative integer + - ``n`` -- nonnegative integer - OUTPUT: - - - ``integer`` -- function value + OUTPUT: integer -- function value EXAMPLES:: @@ -8577,11 +8335,9 @@ def __init__(self): INPUT: - - ``n`` -- non negative integer - - OUTPUT: + - ``n`` -- nonnegative integer - - ``integer`` -- function value + OUTPUT: integer -- function value EXAMPLES:: @@ -8685,7 +8441,7 @@ def is_number_of_the_third_kind(self, n) -> bool: INPUT: - - `n` -- positive integer + - ``n`` -- positive integer OUTPUT: ``True`` if `n` is not prime and not a power of 2 @@ -8727,11 +8483,9 @@ def __init__(self): INPUT: - - ``n`` -- non negative integer - - OUTPUT: + - ``n`` -- nonnegative integer - - ``integer`` -- function value + OUTPUT: integer -- function value EXAMPLES:: @@ -8816,11 +8570,9 @@ def __init__(self): INPUT: - - ``n`` -- non negative integer + - ``n`` -- nonnegative integer - OUTPUT: - - - ``integer`` -- function value + OUTPUT: integer -- function value EXAMPLES:: @@ -8935,11 +8687,9 @@ def __init__(self): INPUT: - - ``n`` -- non negative integer - - OUTPUT: + - ``n`` -- nonnegative integer - - ``integer`` -- `B_n` + OUTPUT: integer -- `B_n` EXAMPLES:: @@ -8989,11 +8739,9 @@ def __init__(self): INPUT: - - ``n`` -- non negative integer + - ``n`` -- nonnegative integer - OUTPUT: - - - ``integer`` -- `C_n` + OUTPUT: integer -- `C_n` EXAMPLES:: @@ -9034,11 +8782,9 @@ def __init__(self): r""" INPUT: - - ``n`` -- non negative integer - - OUTPUT: + - ``n`` -- nonnegative integer - - ``integer`` -- function value + OUTPUT: integer -- function value EXAMPLES:: diff --git a/src/sage/combinat/specht_module.py b/src/sage/combinat/specht_module.py index a0c6dad9172..6a1e26a6093 100644 --- a/src/sage/combinat/specht_module.py +++ b/src/sage/combinat/specht_module.py @@ -1069,7 +1069,7 @@ def specht_module_spanning_set(D, SGA=None): INPUT: - - ``D`` -- a list of cells ``(r,c)`` for row ``r`` and column ``c`` + - ``D`` -- list of cells ``(r,c)`` for row ``r`` and column ``c`` - ``SGA`` -- optional; a symmetric group algebra EXAMPLES:: diff --git a/src/sage/combinat/subset.py b/src/sage/combinat/subset.py index 57ea1f5393d..23fc7322cdc 100644 --- a/src/sage/combinat/subset.py +++ b/src/sage/combinat/subset.py @@ -50,7 +50,7 @@ def Subsets(s, k=None, submultiset=False): r""" Return the combinatorial class of the subsets of the finite set ``s``. The set can be given as a list, Set or any iterable - convertible to a set. Alternatively, a non-negative integer `n` + convertible to a set. Alternatively, a nonnegative integer `n` can be provided in place of ``s``; in this case, the result is the combinatorial class of the subsets of the set `\{1,2,\dots,n\}` (i.e. of the Sage ``range(1,n+1)``). @@ -153,7 +153,7 @@ def Subsets(s, k=None, submultiset=False): if isinstance(s, (int, Integer)): if s < 0: - raise ValueError("s must be non-negative") + raise ValueError("s must be nonnegative") from sage.sets.integer_range import IntegerRange s = IntegerRange(1,s+1) @@ -254,7 +254,7 @@ def underlying_set(self): def __eq__(self, other): r""" - Equality test + Equality test. TESTS:: @@ -271,7 +271,7 @@ def __eq__(self, other): def __ne__(self, other): r""" - Difference test + Difference test. TESTS:: @@ -357,7 +357,7 @@ def cardinality(self): def first(self): """ - Returns the first subset of ``s``. Since we aren't restricted to + Return the first subset of ``s``. Since we aren't restricted to subsets of a certain size, this is always the empty set. EXAMPLES:: @@ -524,7 +524,7 @@ def _element_constructor_(self,X): def _an_element_(self): """ - Returns an example of subset. + Return an example of subset. EXAMPLES:: @@ -605,7 +605,7 @@ def __init__(self, s, k): Subsets_s.__init__(self, s) self._k = Integer(k) if self._k < 0: - raise ValueError("the integer k (={}) should be non-negative".format(k)) + raise ValueError("the integer k (={}) should be nonnegative".format(k)) def _repr_(self): """ @@ -632,7 +632,7 @@ def __contains__(self, value): def __eq__(self, other): r""" - Equality test + Equality test. TESTS:: @@ -647,7 +647,7 @@ def __eq__(self, other): def __ne__(self, other): r""" - Difference test + Difference test. TESTS:: @@ -858,7 +858,7 @@ def unrank(self, r): def an_element(self): """ - Returns an example of subset. + Return an example of subset. EXAMPLES:: diff --git a/src/sage/combinat/subsets_hereditary.py b/src/sage/combinat/subsets_hereditary.py index 33b576e3cf1..b02cf538f42 100644 --- a/src/sage/combinat/subsets_hereditary.py +++ b/src/sage/combinat/subsets_hereditary.py @@ -26,12 +26,12 @@ def subsets_with_hereditary_property(f, X, max_obstruction_size=None, ncpus=1): INPUT: - - ``f`` -- a boolean function which takes as input a list of elements from - ``X``. + - ``f`` -- boolean function which takes as input a list of elements from + ``X`` - - ``X`` -- a list/iterable. + - ``X`` -- list/iterable - - ``max_obstruction_size`` (integer) -- if you know that there is + - ``max_obstruction_size`` -- integer; if you know that there is a `k` such that `f(S)` is true if and only if `f(S')` is true for all `S'\subseteq S` with `S'\leq k`, set ``max_obstruction_size=k``. It may dramatically decrease the diff --git a/src/sage/combinat/subsets_pairwise.py b/src/sage/combinat/subsets_pairwise.py index ed5613157f2..019f89625f1 100644 --- a/src/sage/combinat/subsets_pairwise.py +++ b/src/sage/combinat/subsets_pairwise.py @@ -124,7 +124,7 @@ def __eq__(self, other): def __contains__(self, subset): """ - Membership testing + Membership testing. Returns whether subset is a subset of ``self._ambient``, and ``predicate(x,y)`` holds for every ``x,y`` in ``self``. @@ -163,7 +163,7 @@ def post_process(self, subset_rest): def children(self, subset_rest): """ - Returns the children of a node in the tree. + Return the children of a node in the tree. TESTS:: diff --git a/src/sage/combinat/subword_complex.py b/src/sage/combinat/subword_complex.py index 3c9e14823bd..f26fd87cdb2 100644 --- a/src/sage/combinat/subword_complex.py +++ b/src/sage/combinat/subword_complex.py @@ -158,7 +158,7 @@ class SubwordComplexFacet(Simplex, Element): def __init__(self, parent, positions, facet_test=True): r""" - Initializes a facet of the subword complex ``parent``. + Initialize a facet of the subword complex ``parent``. EXAMPLES:: @@ -400,7 +400,7 @@ def kappa_preimage(self): N = len(W.long_element(as_word=True)) root_conf = self._root_configuration_indices() return [~w for w in W - if all(w.action_on_root_indices(i, side="left") < N + if all(w.action_on_root_indices(i, side='left') < N for i in root_conf)] def is_vertex(self): @@ -525,7 +525,7 @@ def extended_weight_configuration(self, coefficients=None): INPUT: - - coefficients -- (optional) a list of coefficients used to + - ``coefficients`` -- (optional) a list of coefficients used to scale the fundamental weights .. SEEALSO:: @@ -654,7 +654,7 @@ def brick_vector(self, coefficients=None): INPUT: - - coefficients -- (optional) a list of coefficients used to + - ``coefficients`` -- (optional) a list of coefficients used to scale the fundamental weights .. SEEALSO:: @@ -956,11 +956,11 @@ def plot(self, list_colors=None, labels=[], thickness=3, fontsize=14, if type in ['B', 'C']: L += line(pseudolines_type_B[pseudoline], color=list_colors[pseudoline], - thickness=thickness, linestyle="--") + thickness=thickness, linestyle='--') for root_label in root_labels: L += text(root_label[0], root_label[1], rgbcolor=[0, 0, 0], fontsize=fontsize, vertical_alignment="center", - horizontal_alignment="right") + horizontal_alignment='right') if len(labels) < last + 1: labels = list(range(1, last + 2)) for pseudoline_label in pseudoline_labels: @@ -968,7 +968,7 @@ def plot(self, list_colors=None, labels=[], thickness=3, fontsize=14, color=list_colors[pseudoline_label[0]], fontsize=fontsize, vertical_alignment=pseudoline_label[2], - horizontal_alignment="right") + horizontal_alignment='right') if labels is not False: for pseudoline in range(last): L += text(labels[pseudoline], @@ -976,7 +976,7 @@ def plot(self, list_colors=None, labels=[], thickness=3, fontsize=14, shift[1] + permutation.inverse()(pseudoline + 1) - 1), color=list_colors[pseudoline], fontsize=fontsize, vertical_alignment="center", - horizontal_alignment="left") + horizontal_alignment='left') L.axes(False) return L @@ -1063,7 +1063,7 @@ class SubwordComplex(UniqueRepresentation, SimplicialComplex): # standard functions @staticmethod - def __classcall__(cls, Q, w, algorithm="inductive"): + def __classcall__(cls, Q, w, algorithm='inductive'): r""" Making the input hashable. @@ -1085,17 +1085,17 @@ def __classcall__(cls, Q, w, algorithm="inductive"): Q = tuple(Q) return super().__classcall__(cls, Q, w, algorithm=algorithm) - def __init__(self, Q, w, algorithm="inductive"): + def __init__(self, Q, w, algorithm='inductive'): r""" Initialize the subword complex `\mathcal{SC}(Q,w)`. INPUT: - - ``Q`` -- word on the simple generators of the Coxeter group. - - ``w`` -- element of the Coxeter group. - - ``algorithm`` -- (default: ``"inductive"``) choice of the + - ``Q`` -- word on the simple generators of the Coxeter group + - ``w`` -- element of the Coxeter group + - ``algorithm`` -- (default: ``'inductive'``) choice of the algorithm to generate the subword complex. Options are - ``"inductive"`` or ``"greedy"``. The second option is + ``'inductive'`` or ``'greedy'``. The second option is recommended when `|Q|` is closed to `\ell(w) + \mathrm{rank}(W)`. EXAMPLES:: @@ -1415,7 +1415,7 @@ def __iter__(self): """ return iter(self.facets()) - def greedy_facet(self, side="positive"): + def greedy_facet(self, side='positive'): r""" Return the negative (or positive) greedy facet of ``self``. @@ -1427,17 +1427,17 @@ def greedy_facet(self, side="positive"): sage: W = ReflectionGroup(['A',2]) sage: w = W.from_reduced_word([1,2,1]) sage: SC = SubwordComplex([1,2,1,2,1], w) - sage: SC.greedy_facet(side="positive") + sage: SC.greedy_facet(side='positive') (0, 1) - sage: SC.greedy_facet(side="negative") + sage: SC.greedy_facet(side='negative') (3, 4) sage: W = CoxeterGroup(['A',2]) sage: w = W.from_reduced_word([1,2,1]) sage: SC = SubwordComplex([1,2,1,2,1], w) - sage: SC.greedy_facet(side="positive") + sage: SC.greedy_facet(side='positive') (0, 1) - sage: SC.greedy_facet(side="negative") + sage: SC.greedy_facet(side='negative') (3, 4) """ return self.element_class(self, _greedy_facet(self.word(), @@ -1565,7 +1565,7 @@ def is_root_independent(self): True """ from sage.matrix.constructor import matrix - M = matrix(self.greedy_facet(side="negative").root_configuration()) + M = matrix(self.greedy_facet(side='negative').root_configuration()) return M.rank() == max(M.ncols(), M.nrows()) @cached_method @@ -1681,7 +1681,7 @@ def brick_vectors(self, coefficients=None): INPUT: - - coefficients -- (optional) a list of coefficients used to + - ``coefficients`` -- (optional) a list of coefficients used to scale the fundamental weights .. SEEALSO:: @@ -1746,7 +1746,7 @@ def brick_polytope(self, coefficients=None): INPUT: - - coefficients -- (optional) a list of coefficients used to + - ``coefficients`` -- (optional) a list of coefficients used to scale the fundamental weights .. SEEALSO:: @@ -1825,10 +1825,10 @@ def cover_relations(self, label=False): INPUT: - - label -- boolean (default ``False``) whether or not to label + - ``label`` -- boolean (default: ``False``); whether or not to label the cover relations by the position of flip - OUTPUT: a list of pairs of facets + OUTPUT: list of pairs of facets EXAMPLES:: @@ -1851,7 +1851,7 @@ def cover_relations(self, label=False): ((2, 3), (3, 4))] """ N = len(self.group().long_element(as_word=True)) - F = self.greedy_facet(side="positive") + F = self.greedy_facet(side='positive') Fs = {F} seen = {F} covers = [] @@ -1946,7 +1946,7 @@ def increasing_flip_poset(self): return Poset(((), cov), facade=True) -def _greedy_facet(Q, w, side="negative", n=None, pos=0, l=None, elems=[]): +def _greedy_facet(Q, w, side='negative', n=None, pos=0, l=None, elems=[]): r""" Return the (positive or negative) *greedy facet* of the subword complex `SC(Q, w)`. @@ -1956,14 +1956,12 @@ def _greedy_facet(Q, w, side="negative", n=None, pos=0, l=None, elems=[]): - ``Q`` -- a word - ``w`` -- an element in the Coxeter group - ``side`` -- optional, either ``'negative'`` (default) or ``'positive'`` - - ``n`` -- an integer (default: the length of `Q`) - - ``pos`` -- an integer (default: 0) - - ``l`` -- an integer (default: the length of `w`) - - ``elems`` -- a list (optional) + - ``n`` -- integer (default: the length of `Q`) + - ``pos`` -- integer (default: 0) + - ``l`` -- integer (default: the length of `w`) + - ``elems`` -- list (optional) - OUTPUT: - - - a set + OUTPUT: a set EXAMPLES:: @@ -2028,7 +2026,7 @@ def _extended_root_configuration_indices(W, Q, F): - ``Q`` -- a word representing an element of `W` - ``F`` -- a facet of the subword complex - OUTPUT: a list of root indices + OUTPUT: list of root indices EXAMPLES:: @@ -2055,7 +2053,7 @@ def _extended_root_configuration_indices(W, Q, F): pi = W.one() for i, wi in enumerate(Q): V_roots.append(pi.action_on_root_indices(W.simple_root_index(wi), - side="left")) + side='left')) if i not in F: pi = pi.apply_simple_reflection_right(wi) return V_roots @@ -2098,7 +2096,7 @@ def _greedy_flip_algorithm(Q, w): [0, 2, 1, 0, 5]]) """ W = w.parent() - F = _greedy_facet(Q, w, side="positive") + F = _greedy_facet(Q, w, side='positive') R = _extended_root_configuration_indices(W, Q, F) facet_list = [F] extended_root_conf_indices_list = [R] @@ -2108,7 +2106,7 @@ def _greedy_flip_algorithm(Q, w): has_new_child = False for i in sorted(F): if (not has_new_child) and (i >= next_index): - j = _flip_c(W, F, R, i, side="positive") + j = _flip_c(W, F, R, i, side='positive') if j != i: flip_to_ancestors.append(j) next_index = i + 1 @@ -2118,6 +2116,6 @@ def _greedy_flip_algorithm(Q, w): if not has_new_child: i = flip_to_ancestors.pop() if i != -1: - j = _flip_c(W, F, R, i, side="negative") + j = _flip_c(W, F, R, i, side='negative') next_index = j + 1 return facet_list, extended_root_conf_indices_list diff --git a/src/sage/combinat/subword_complex_c.pyx b/src/sage/combinat/subword_complex_c.pyx index a3d02a29bb3..173c6521d78 100644 --- a/src/sage/combinat/subword_complex_c.pyx +++ b/src/sage/combinat/subword_complex_c.pyx @@ -1,7 +1,7 @@ # sage.doctest: needs sage.modules cpdef int _flip_c(W, set positions, list extended_root_conf_indices, - int i, side="both") noexcept: + int i, side='both') noexcept: r""" Flip a facet. @@ -57,7 +57,7 @@ cpdef int _flip_c(W, set positions, list extended_root_conf_indices, if j != i: t = R[min(r, r_minus)] for k in range(min(i, j) + 1, max(i, j) + 1): - extended_root_conf_indices[k] = t.action_on_root_indices(extended_root_conf_indices[k], side="left") + extended_root_conf_indices[k] = t.action_on_root_indices(extended_root_conf_indices[k], side='left') return j diff --git a/src/sage/combinat/super_tableau.py b/src/sage/combinat/super_tableau.py index ffcdb0fc374..280654fcc5e 100644 --- a/src/sage/combinat/super_tableau.py +++ b/src/sage/combinat/super_tableau.py @@ -184,13 +184,13 @@ def check(self): Traceback (most recent call last): ... ValueError: the entries of a semistandard super tableau must be - non-negative primed integers + nonnegative primed integers """ super().check() for row in self: if not all(isinstance(c, PrimedEntry) and c > 0 for c in row): raise ValueError("the entries of a semistandard super tableau" - " must be non-negative primed integers") + " must be nonnegative primed integers") if any(row[c] > row[c + 1] for c in range(len(row) - 1)): raise ValueError("the entries in each row of a semistandard" " super tableau must be weakly increasing") @@ -419,7 +419,7 @@ class SemistandardSuperTableaux_all(SemistandardSuperTableaux): def __init__(self): r""" - Initializes the class of all semistandard super tableaux. + Initialize the class of all semistandard super tableaux. TESTS:: @@ -455,7 +455,7 @@ class StandardSuperTableaux(SemistandardSuperTableaux, Parent): INPUT: - - ``n`` -- a non-negative integer or a partition. + - ``n`` -- a nonnegative integer or a partition EXAMPLES:: @@ -519,12 +519,12 @@ def __classcall_private__(cls, n=None): sage: StandardSuperTableaux(-1) Traceback (most recent call last): ... - ValueError: the argument must be a non-negative integer or a + ValueError: the argument must be a nonnegative integer or a partition sage: StandardSuperTableaux([[1]]) Traceback (most recent call last): ... - ValueError: the argument must be a non-negative integer or a + ValueError: the argument must be a nonnegative integer or a partition """ from sage.combinat.partition import _Partitions @@ -541,7 +541,7 @@ def __classcall_private__(cls, n=None): "partitions is not implemented yet") if not isinstance(n, (int, Integer)) or n < 0: - raise ValueError("the argument must be a non-negative integer" + raise ValueError("the argument must be a nonnegative integer" " or a partition") return StandardSuperTableaux_size(n) @@ -601,7 +601,7 @@ class StandardSuperTableaux_all(StandardSuperTableaux, def __init__(self): r""" - Initializes the class of all standard super tableaux. + Initialize the class of all standard super tableaux. TESTS:: @@ -654,7 +654,7 @@ class StandardSuperTableaux_size(StandardSuperTableaux, def __init__(self, n): r""" - Initializes the class of all standard super tableaux of size ``n``. + Initialize the class of all standard super tableaux of size ``n``. TESTS:: @@ -735,7 +735,7 @@ class StandardSuperTableaux_shape(StandardSuperTableaux): def __init__(self, p): r""" - Initializes the class of all standard super tableaux of a given shape. + Initialize the class of all standard super tableaux of a given shape. TESTS:: diff --git a/src/sage/combinat/superpartition.py b/src/sage/combinat/superpartition.py index e16e87fa9f0..0afd86a6281 100644 --- a/src/sage/combinat/superpartition.py +++ b/src/sage/combinat/superpartition.py @@ -121,7 +121,7 @@ class SuperPartition(ClonableArray, @staticmethod def __classcall_private__(cls, lst): r""" - Construct a superpartition in the correct parent + Construct a superpartition in the correct parent. EXAMPLES:: @@ -323,7 +323,7 @@ def to_composition(self) -> Composition: sage: SuperPartition([[2,1,0],[3,3]]).to_composition() [2, 1, 0, 3, 3] sage: SuperPartition([[2,1,0],[3,3]]).to_composition().parent() - Compositions of non-negative integers + Compositions of nonnegative integers """ return Composition(self[0] + self[1]) @@ -332,9 +332,7 @@ def to_partition(self) -> Partition: Concatenate and sort the antisymmetric and symmetric parts to a partition. - OUTPUT: - - - a partition + OUTPUT: a partition EXAMPLES:: @@ -351,9 +349,7 @@ def antisymmetric_part(self) -> list: r""" The antisymmetric part as a list of strictly decreasing integers. - OUTPUT: - - - a list + OUTPUT: list EXAMPLES:: @@ -370,9 +366,7 @@ def symmetric_part(self) -> list: r""" The symmetric part as a list of weakly decreasing integers. - OUTPUT: - - - a list + OUTPUT: list EXAMPLES:: @@ -392,9 +386,7 @@ def bosonic_degree(self) -> int: The *bosonic degree* is the sum of the sizes of the antisymmetric and symmetric parts. - OUTPUT: - - - an integer + OUTPUT: integer EXAMPLES:: @@ -413,9 +405,7 @@ def fermionic_degree(self) -> int: The *fermionic degree* is the length of the antisymmetric part. - OUTPUT: - - - an integer + OUTPUT: integer EXAMPLES:: @@ -433,9 +423,7 @@ def bi_degree(self) -> tuple: Return the bidegree of ``self``, which is a pair consisting of the bosonic and fermionic degree. - OUTPUT: - - - a tuple of two integers + OUTPUT: a tuple of two integers EXAMPLES:: @@ -451,9 +439,7 @@ def length(self) -> int: Return the length of ``self``, which is the sum of the lengths of the antisymmetric and symmetric part. - OUTPUT: - - - an integer + OUTPUT: integer EXAMPLES:: @@ -468,9 +454,7 @@ def bosonic_length(self) -> int: r""" Return the length of the partition of the symmetric part. - OUTPUT: - - - an integer + OUTPUT: integer EXAMPLES:: @@ -485,9 +469,7 @@ def shape_circled_diagram(self) -> Partition: r""" A concatenated partition with an extra cell for each antisymmetric part - OUTPUT: - - - a partition + OUTPUT: a partition EXAMPLES:: @@ -512,11 +494,9 @@ def from_circled_diagram(shape, corners) -> SuperPartition: INPUT: - ``shape`` -- a partition or list of integers - - ``corners`` -- a list of removable cells of ``shape`` - - OUTPUT: + - ``corners`` -- list of removable cells of ``shape`` - - a :class:`SuperPartition` + OUTPUT: a :class:`SuperPartition` EXAMPLES:: @@ -541,9 +521,7 @@ def to_circled_diagram(self) -> list: and a list of removable cells of the partition indicating the location of the circled cells - OUTPUT: - - - a list consisting of a partition and a list of pairs of integers + OUTPUT: list consisting of a partition and a list of pairs of integers EXAMPLES:: @@ -566,9 +544,7 @@ def conjugate(self) -> SuperPartition: The *conjugate* of a super partition is defined by conjugating the circled diagram. - OUTPUT: - - - a :class:`SuperPartition` + OUTPUT: a :class:`SuperPartition` EXAMPLES:: @@ -588,9 +564,7 @@ def zee(self) -> Integer: Return the centralizer size of a permutation of cycle type symmetric part of ``self``. - OUTPUT: - - - a positive integer + OUTPUT: a positive integer EXAMPLES:: @@ -608,9 +582,7 @@ def sign(self) -> int: Return the sign of a permutation of cycle type the symmetric part of ``self``. - OUTPUT: - - - either `1` or `-1` + OUTPUT: either `1` or `-1` EXAMPLES:: @@ -659,9 +631,7 @@ def add_horizontal_border_strip_star(self, h) -> list: - ``h`` -- number of cells in the horizontal strip - OUTPUT: - - - a list of super partitions + OUTPUT: list of super partitions EXAMPLES:: @@ -707,9 +677,7 @@ def add_horizontal_border_strip_star_bar(self, h) -> list: - ``h`` -- number of cells in the horizontal strip - OUTPUT: - - - a list of super partitions + OUTPUT: list of super partitions EXAMPLES:: @@ -783,7 +751,7 @@ class SuperPartitions(UniqueRepresentation, Parent): INPUT: - - ``n`` -- an integer (optional: default ``None``) + - ``n`` -- integer (default: ``None``) - ``m`` -- if ``n`` is specified, an integer (optional: default ``None``) Super partitions are the indexing set for symmetric functions diff --git a/src/sage/combinat/symmetric_group_algebra.py b/src/sage/combinat/symmetric_group_algebra.py index 963dc8a221b..e33992ffafd 100644 --- a/src/sage/combinat/symmetric_group_algebra.py +++ b/src/sage/combinat/symmetric_group_algebra.py @@ -246,7 +246,7 @@ def __init__(self, R, W, category): sage: S = SymmetricGroup(4) sage: SGA = S.algebra(QQ) - sage: TestSuite(SGA).run(skip="_test_cellular") + sage: TestSuite(SGA).run(skip='_test_cellular') sage: SGA._test_cellular() # long time Checking that coercion works between equivalent indexing sets:: @@ -1985,7 +1985,7 @@ def seminormal_basis(self, mult='l2r'): INPUT: - - ``mult`` -- string (default: ``'l2r'``). If set to ``'r2l'``, + - ``mult`` -- string (default: ``'l2r'``); if set to ``'r2l'``, this causes the method to return the list of the antipodes (:meth:`antipode`) of all `\epsilon(T, S)` instead of the `\epsilon(T, S)` themselves. @@ -2031,7 +2031,7 @@ def dft(self, form=None, mult='l2r'): INPUT: - - ``mult`` -- string (default: `l2r`). If set to `r2l`, + - ``mult`` -- string (default: `l2r`); if set to `r2l`, this causes the method to use the antipodes (:meth:`antipode`) of the seminormal basis instead of the seminormal basis. @@ -2075,7 +2075,7 @@ def _dft_seminormal(self, mult='l2r'): INPUT: - - ``mult`` -- string (default: `l2r`). If set to `r2l`, + - ``mult`` -- string (default: `l2r`); if set to `r2l`, this causes the method to use the antipodes (:meth:`antipode`) of the seminormal basis instead of the seminormal basis. @@ -2136,7 +2136,7 @@ def epsilon_ik(self, itab, ktab, star=0, mult='l2r'): - ``star`` -- integer (default: `0`). - - ``mult`` -- string (default: `l2r`). If set to `r2l`, + - ``mult`` -- string (default: `l2r`); if set to `r2l`, this causes the method to return the antipode (:meth:`antipode`) of `\epsilon(I, K)` instead of `\epsilon(I, K)` itself. @@ -2608,15 +2608,15 @@ def a(tableau, star=0, base_ring=QQ): INPUT: - ``tableau`` -- Young tableau which contains every integer - from `1` to its size precisely once. + from `1` to its size precisely once - - ``star`` -- nonnegative integer (default: `0`). When this + - ``star`` -- nonnegative integer (default: `0`); when this optional variable is set, the method computes not the row projection operator of ``tableau``, but the row projection operator of the restriction of ``tableau`` to the entries ``1, 2, ..., tableau.size() - star`` instead. - - ``base_ring`` -- commutative ring (default: ``QQ``). When this + - ``base_ring`` -- commutative ring (default: ``QQ``); when this optional variable is set, the row projection operator is computed over a user-determined base ring instead of `\QQ`. (Note that symmetric group algebras currently don't preserve @@ -3147,7 +3147,7 @@ def _to_sga(self, ind): from sage.combinat.rsk import RSK_inverse S = ind[1] T = ind[2] - w = RSK_inverse(T, S, output="permutation") + w = RSK_inverse(T, S, output='permutation') return self._algebra.kazhdan_lusztig_basis_element(w) @@ -3340,7 +3340,7 @@ def __init__(self, R, n, q=None): """ HeckeAlgebraSymmetricGroup_generic.__init__(self, R, n, q) self._name += " on the T basis" - self.print_options(prefix="T") + self.print_options(prefix='T') def t_action_on_basis(self, perm, i): r""" diff --git a/src/sage/combinat/symmetric_group_representations.py b/src/sage/combinat/symmetric_group_representations.py index 99b72335964..1d659d285ed 100644 --- a/src/sage/combinat/symmetric_group_representations.py +++ b/src/sage/combinat/symmetric_group_representations.py @@ -45,7 +45,7 @@ from sage.sets.finite_enumerated_set import FiniteEnumeratedSets lazy_import("sage.combinat.yang_baxter_graph", "YangBaxterGraph_partition") -lazy_import("sage.groups.perm_gps.constructor", "PermutationGroupElement", as_="PermutationConstructor") +lazy_import("sage.groups.perm_gps.constructor", "PermutationGroupElement", as_='PermutationConstructor') lazy_import("sage.symbolic.ring", "SR") @@ -62,11 +62,11 @@ def SymmetricGroupRepresentation(partition, implementation="specht", - ``partition`` -- a partition of a positive integer - - ``implementation`` -- string (default: ``"specht"``), one of: + - ``implementation`` -- string (default: ``'specht'``); one of: - * ``"seminormal"`` -- for Young's seminormal representation - * ``"orthogonal"`` -- for Young's orthogonal representation - * ``"specht"`` -- for Specht's representation + * ``'seminormal'`` -- for Young's seminormal representation + * ``'orthogonal'`` -- for Young's orthogonal representation + * ``'specht'`` -- for Specht's representation - ``ring`` -- the ring over which the representation is defined @@ -179,7 +179,7 @@ def SymmetricGroupRepresentation(partition, implementation="specht", return Rep(partition) -def SymmetricGroupRepresentations(n, implementation="specht", ring=None, +def SymmetricGroupRepresentations(n, implementation='specht', ring=None, cache_matrices=True): r""" Irreducible representations of the symmetric group. @@ -188,11 +188,11 @@ def SymmetricGroupRepresentations(n, implementation="specht", ring=None, - ``n`` -- positive integer - - ``implementation`` -- string (default: ``"specht"``), one of: + - ``implementation`` -- string (default: ``'specht'``); one of: - * ``"seminormal"`` -- for Young's seminormal representation - * ``"orthogonal"`` -- for Young's orthogonal representation - * ``"specht"`` -- for Specht's representation + * ``'seminormal'`` -- for Young's seminormal representation + * ``'orthogonal'`` -- for Young's orthogonal representation + * ``'specht'`` -- for Specht's representation - ``ring`` -- the ring over which the representation is defined diff --git a/src/sage/combinat/t_sequences.py b/src/sage/combinat/t_sequences.py index 8fc314236cc..966e7b05f80 100644 --- a/src/sage/combinat/t_sequences.py +++ b/src/sage/combinat/t_sequences.py @@ -58,7 +58,7 @@ def _nonperiodic_autocorrelation(sequences, j): - ``sequences`` -- either a single sequence or a list of sequences for which we want to compute the nonperiodic autocorrelation - - ``j`` -- integer, the parameter `j` used when calculating the nonperiodic + - ``j`` -- integer; the parameter `j` used when calculating the nonperiodic autocorrelation """ if not isinstance(sequences[0], list): @@ -81,10 +81,10 @@ def is_skew(seq, verbose=False): INPUT: - - ``seq`` -- the sequence that should be checked. + - ``seq`` -- the sequence that should be checked - - ``verbose`` -- a boolean (default false). If true the function will be verbose - when the sequences do not satisfy the contraints. + - ``verbose`` -- boolean (default: ``False``); if ``True`` the function + will be verbose when the sequences do not satisfy the contraints EXAMPLES:: @@ -127,10 +127,10 @@ def is_symmetric(seq, verbose=False) -> bool: INPUT: - - ``seq`` -- the sequence that should be checked. + - ``seq`` -- the sequence that should be checked - - ``verbose`` -- a boolean (default false). If true the function will be verbose - when the sequences do not satisfy the contraints. + - ``verbose`` -- boolean (default: ``False``); if true the function will be + verbose when the sequences do not satisfy the contraints. EXAMPLES:: @@ -177,10 +177,10 @@ def is_T_sequences_set(sequences, verbose=False): INPUT: - - ``sequences`` -- a list of four sequences. + - ``sequences`` -- list of four sequences - - ``verbose`` -- a boolean (default false). If true the function will be verbose - when the sequences do not satisfy the contraints. + - ``verbose`` -- boolean (default: ``False``); if true the function will be + verbose when the sequences do not satisfy the contraints EXAMPLES:: @@ -249,10 +249,10 @@ def turyn_sequences_smallcases(l, existence=False): INPUT: - - ``l`` -- integer, the length of the Turyn sequences. + - ``l`` -- integer; the length of the Turyn sequences - - ``existence`` -- boolean (default: ``False``). If true, only return whether the - Turyn sequences are available for the given length. + - ``existence`` -- boolean (default: ``False``); if true, only return + whether the Turyn sequences are available for the given length EXAMPLES: @@ -579,13 +579,13 @@ def base_sequences_construction(turyn_type_seqs, check=True): INPUT: - - ``turyn_type_seqs`` -- The list of 4 Turyn type sequences that should be - used to construct the base sequences. + - ``turyn_type_seqs`` -- the list of 4 Turyn type sequences that should be + used to construct the base sequences - ``check`` -- boolean (default: ``True``); check that the resulting sequences are base sequences before returning them - OUTPUT: a list containing the four base sequences + OUTPUT: list containing the four base sequences EXAMPLES:: @@ -640,10 +640,10 @@ def is_base_sequences_tuple(base_sequences, verbose=False): INPUT: - - ``base_sequences`` -- The list of 4 sequences that should be checked. + - ``base_sequences`` -- the list of 4 sequences that should be checked - - ``verbose`` -- a boolean (default false). If true the function will be verbose - when the sequences do not satisfy the contraints. + - ``verbose`` -- boolean (default: ``False``); if ``True`` the function + will be verbose when the sequences do not satisfy the contraints EXAMPLES:: @@ -715,10 +715,10 @@ def turyn_type_sequences_smallcases(n, existence=False): INPUT: - - ``n`` -- integer, the length of the Turyn type sequences. + - ``n`` -- integer; the length of the Turyn type sequences - - ``existence`` -- boolean (default: ``False``). If true, only return whether the - Turyn type sequences are available for the given length. + - ``existence`` -- boolean (default: ``False``); if ``True``, only return + whether the Turyn type sequences are available for the given length EXAMPLES: @@ -812,9 +812,9 @@ def base_sequences_smallcases(n, p, existence=False, check=True): INPUT: - - ``n`` -- integer, the length of the last two base sequences + - ``n`` -- integer; the length of the last two base sequences - - ``p`` -- integer, `n+p` will be the length of the first two base + - ``p`` -- integer; `n+p` will be the length of the first two base sequences - ``existence`` -- boolean (default: ``False``); if ``True``, the function diff --git a/src/sage/combinat/tableau.py b/src/sage/combinat/tableau.py index 3af583842d5..fa196c33e12 100644 --- a/src/sage/combinat/tableau.py +++ b/src/sage/combinat/tableau.py @@ -126,9 +126,7 @@ class Tableau(ClonableList, metaclass=InheritComparisonClasscallMetaclass): - ``t`` -- a Tableau, a list of iterables, or an empty list - OUTPUT: - - - A Tableau object constructed from ``t``. + OUTPUT: a Tableau object constructed from ``t`` A tableau is abstractly a mapping from the cells in a partition to arbitrary objects (called entries). It is often represented as a @@ -467,12 +465,12 @@ def _ascii_art_(self): [ 1 ] [ 1 3 1 2 2 ] [ 1 2 3, 2 , 3 , 3 ] - sage: Tableaux.options(ascii_art="compact") + sage: Tableaux.options(ascii_art='compact') sage: ascii_art(list(StandardTableaux(3))) [ |1| ] [ |1|3| |1|2| |2| ] [ |1|2|3|, |2| , |3| , |3| ] - sage: Tableaux.options(convention="french", ascii_art="table") + sage: Tableaux.options(convention='french', ascii_art='table') sage: ascii_art(list(StandardTableaux(3))) [ +---+ ] [ | 3 | ] @@ -481,12 +479,12 @@ def _ascii_art_(self): [ +---+---+---+ +---+---+ +---+---+ +---+ ] [ | 1 | 2 | 3 | | 1 | 3 | | 1 | 2 | | 1 | ] [ +---+---+---+, +---+---+, +---+---+, +---+ ] - sage: Tableaux.options(ascii_art="repr") + sage: Tableaux.options(ascii_art='repr') sage: ascii_art(list(StandardTableaux(3))) [ 3 ] [ 2 3 2 ] [ 1 2 3, 1 3, 1 2, 1 ] - sage: Tableaux.options(convention="russian", ascii_art="table") + sage: Tableaux.options(convention='russian', ascii_art='table') sage: ascii_art(list(StandardTableaux(3))) [ / \ / \ ] [ / 3 / \ 3 \ ] @@ -495,7 +493,7 @@ def _ascii_art_(self): [ / \ / \ / \ / \ / \ / \ / \ ] [ \ 1 / \ 1 / \ 1 / \ 1 / ] [ \ / , \ / , \ / , \ / ] - sage: Tableaux.options(ascii_art="repr") + sage: Tableaux.options(ascii_art='repr') sage: ascii_art(list(StandardTableaux(3))) [ 3 3 ] [ 2 2 3 3 2 2 ] @@ -818,9 +816,7 @@ def __call__(self, *cell): - ``cell`` -- a pair of integers, tuple, or list specifying a cell in the tableau - OUTPUT: - - - The value in the corresponding cell. + OUTPUT: the value in the corresponding cell EXAMPLES:: @@ -1264,12 +1260,12 @@ def to_sign_matrix(self, max_entry=None): A sign matrix is an `m \times n` matrix of 0's, 1's and -1's such that the partial sums of each column is either 0 or 1 and the partial sums of - each row is non-negative. [Ava2007]_ + each row is nonnegative. [Ava2007]_ INPUT: - - ``max_entry`` -- A non-negative integer, the maximum allowable number in - the tableau. Defaults to the largest entry in the tableau if not specified. + - ``max_entry`` -- a nonnegative integer, the maximum allowable number in + the tableau. Defaults to the largest entry in the tableau if not specified EXAMPLES:: @@ -1296,14 +1292,14 @@ def to_sign_matrix(self, max_entry=None): sage: s.to_sign_matrix(6) Traceback (most recent call last): ... - ValueError: the entries must be non-negative integers + ValueError: the entries must be nonnegative integers """ from sage.rings.integer_ring import ZZ from sage.sets.positive_integers import PositiveIntegers PI = PositiveIntegers() for row in self: if any(c not in PI for c in row): - raise ValueError("the entries must be non-negative integers") + raise ValueError("the entries must be nonnegative integers") from sage.matrix.matrix_space import MatrixSpace if max_entry is None: max_entry = max([max(c) for c in self]) @@ -1333,14 +1329,12 @@ def schuetzenberger_involution(self, n=None, check=True): INPUT: - - ``n`` -- an integer specifying the maximal letter in the + - ``n`` -- integer specifying the maximal letter in the alphabet (optional) - - ``check`` -- (Default: ``True``) Check to make sure ``self`` is + - ``check`` -- (default: ``True``) Check to make sure ``self`` is semistandard. Set to ``False`` to avoid this check. (optional) - OUTPUT: - - - a tableau, the Schuetzenberger involution of ``self`` + OUTPUT: a tableau, the Schuetzenberger involution of ``self`` EXAMPLES:: @@ -1400,14 +1394,12 @@ def evacuation(self, n=None, check=True): INPUT: - - ``n`` -- an integer specifying the maximal letter in the + - ``n`` -- integer specifying the maximal letter in the alphabet (optional) - - ``check`` -- (Default: ``True``) Check to make sure ``self`` is + - ``check`` -- (default: ``True``) Check to make sure ``self`` is semistandard. Set to ``False`` to avoid this check. (optional) - OUTPUT: - - - a tableau, the evacuation of ``self`` + OUTPUT: a tableau, the evacuation of ``self`` EXAMPLES:: @@ -1434,7 +1426,7 @@ def evacuation(self, n=None, check=True): """ return self.schuetzenberger_involution(n, check) - @combinatorial_map(name="standardization") + @combinatorial_map(name='standardization') def standardization(self, check=True): r""" Return the standardization of ``self``, assuming ``self`` is a @@ -1453,8 +1445,8 @@ def standardization(self, check=True): INPUT: - - ``check`` -- (Default: ``True``) Check to make sure ``self`` is - semistandard. Set to ``False`` to avoid this check. + - ``check`` -- (default: ``True``) check to make sure ``self`` is + semistandard; set to ``False`` to avoid this check EXAMPLES:: @@ -1509,17 +1501,17 @@ def bender_knuth_involution(self, k, rows=None, check=True): INPUT: - - ``k`` -- an integer + - ``k`` -- integer - - ``rows`` -- (Default ``None``) When set to ``None``, the method + - ``rows`` -- (default: ``None``) when set to ``None``, the method computes the `k`-th Bender--Knuth involution as defined above. When an iterable, this computes the composition of the `k`-th Bender--Knuth switches at row `i` over all `i` in ``rows``. When set to an integer `i`, the method computes the `k`-th Bender--Knuth switch at row `i`. Note the indexing of the rows starts with `1`. - - ``check`` -- (Default: ``True``) Check to make sure ``self`` is - semistandard. Set to ``False`` to avoid this check. + - ``check`` -- (default: ``True``) check to make sure ``self`` is + semistandard; Set to ``False`` to avoid this check OUTPUT: @@ -2081,7 +2073,7 @@ def k_weight(self, k): def is_k_tableau(self, k): r""" - Checks whether ``self`` is a valid weak `k`-tableau. + Check whether ``self`` is a valid weak `k`-tableau. EXAMPLES:: @@ -2464,7 +2456,7 @@ def reverse_bump(self, loc): INPUT: - - ``loc`` -- Can be either of the following: + - ``loc`` -- can be either of the following: - The coordinates ``(r, c)`` of the square to reverse-bump (which must be a corner of the tableau); @@ -3941,8 +3933,8 @@ def residue(self, k, e, multicharge=(0,)): INPUT: - - ``k`` -- an integer in `\{1, 2, \ldots, n\}` - - ``e`` -- an integer in `\{0, 2, 3, 4, 5, \ldots\}` + - ``k`` -- integer in `\{1, 2, \ldots, n\}` + - ``e`` -- integer in `\{0, 2, 3, 4, 5, \ldots\}` - ``multicharge`` -- (default: ``[0]``) a list of length 1 Here `n` is its size of ``self``. @@ -3984,7 +3976,7 @@ def residue_sequence(self, e, multicharge=(0,)): INPUT: - - ``e`` -- an integer in `\{0, 2, 3, 4, 5, \ldots\}` + - ``e`` -- integer in `\{0, 2, 3, 4, 5, \ldots\}` - ``multicharge`` -- (default: ``[0]``) a sequence of integers of length 1 @@ -4407,9 +4399,7 @@ class SemistandardTableau(Tableau): - ``t`` -- a tableau, a list of iterables, or an empty list - OUTPUT: - - - A SemistandardTableau object constructed from ``t``. + OUTPUT: a SemistandardTableau object constructed from ``t`` A semistandard tableau is a tableau whose entries are positive integers, which are weakly increasing in rows and strictly increasing down columns. @@ -4550,7 +4540,7 @@ def check(self): for row in self: if any(c not in PI for c in row): - raise ValueError("the entries of a semistandard tableau must be non-negative integers") + raise ValueError("the entries of a semistandard tableau must be nonnegative integers") if any(row[c] > row[c+1] for c in range(len(row)-1)): raise ValueError("the entries in each row of a semistandard tableau must be weakly increasing") @@ -5066,7 +5056,7 @@ def from_chain(chain): return T.element_class(T, res) -def from_shape_and_word(shape, w, convention="French"): +def from_shape_and_word(shape, w, convention='French'): r""" Return a tableau from a shape and word. @@ -5076,15 +5066,15 @@ def from_shape_and_word(shape, w, convention="French"): - ``w`` -- a word whose length equals that of the partition - - ``convention`` -- a string which can take values ``"French"`` or - ``"English"``; the default is ``"French"`` + - ``convention`` -- a string which can take values ``'French'`` or + ``'English'``; the default is ``'French'`` OUTPUT: A tableau, whose shape is ``shape`` and whose reading word is ``w``. - If the ``convention`` is specified as ``"French"``, the reading word is to be read + If the ``convention`` is specified as ``'French'``, the reading word is to be read starting from the top row in French convention (= the bottom row in English - convention). If the ``convention`` is specified as ``"English"``, the reading word + convention). If the ``convention`` is specified as ``'English'``, the reading word is to be read starting with the top row in English convention. EXAMPLES:: @@ -5098,7 +5088,7 @@ def from_shape_and_word(shape, w, convention="French"): sage: from_shape_and_word(shape, word) [[1, 3], [2], [4]] sage: word = Word(flatten(t)) - sage: from_shape_and_word(shape, word, convention="English") + sage: from_shape_and_word(shape, word, convention='English') [[1, 3], [2], [4]] """ res = [] @@ -5217,7 +5207,7 @@ def check(self): sage: IncreasingTableau([[0,1]]) # indirect doctest Traceback (most recent call last): ... - ValueError: the entries of an increasing tableau must be non-negative integers + ValueError: the entries of an increasing tableau must be nonnegative integers """ if not self: # Empty tableau, so trivially an increasing tableau @@ -5234,7 +5224,7 @@ def check(self): for row in self: if any(c not in PI for c in row): raise ValueError("the entries of an increasing tableau" - " must be non-negative integers") + " must be nonnegative integers") if any(row[c] >= row[c+1] for c in range(len(row)-1)): raise ValueError("the entries in each row of an increasing" " tableau must be strictly increasing") @@ -5449,7 +5439,7 @@ class Tableaux(UniqueRepresentation, Parent): INPUT: - - ``n`` (optional) -- a non-negative integer + - ``n`` -- optional; a nonnegative integer OUTPUT: @@ -5500,7 +5490,7 @@ class Tableaux(UniqueRepresentation, Parent): sage: Tableaux(t) Traceback (most recent call last): ... - ValueError: the argument to Tableaux() must be a non-negative integer + ValueError: the argument to Tableaux() must be a nonnegative integer sage: Tableaux(3)([[1, 1]]) Traceback (most recent call last): ... @@ -5555,7 +5545,7 @@ def __classcall_private__(cls, *args, **kwargs): return Tableaux_all() else: if not isinstance(n, (int, Integer)) or n < 0: - raise ValueError("the argument to Tableaux() must be a non-negative integer") + raise ValueError("the argument to Tableaux() must be a nonnegative integer") return Tableaux_size(n) Element = Tableau @@ -5635,7 +5625,7 @@ class options(GlobalOptions): values=dict(list='print tableaux as lists', diagram='display as Young diagram (similar to :meth:`~sage.combinat.tableau.Tableau.pp()`', compact='minimal length string representation'), - alias=dict(array="diagram", ferrers_diagram="diagram", young_diagram="diagram"), + alias=dict(array='diagram', ferrers_diagram='diagram', young_diagram='diagram'), case_sensitive=False) ascii_art = dict(default="repr", description='Controls the ascii art output for tableaux', @@ -5646,7 +5636,7 @@ class options(GlobalOptions): latex = dict(default="diagram", description='Controls the way in which tableaux are latexed', values=dict(list='as a list', diagram='as a Young diagram'), - alias=dict(array="diagram", ferrers_diagram="diagram", young_diagram="diagram"), + alias=dict(array='diagram', ferrers_diagram='diagram', young_diagram='diagram'), case_sensitive=False) convention = dict(default="English", description='Sets the convention used for displaying tableaux and partitions', @@ -5656,21 +5646,19 @@ class options(GlobalOptions): Russian='use the Russian convention', ), case_sensitive=False) - notation = dict(alt_name="convention") + notation = dict(alt_name='convention') def _element_constructor_(self, t): r""" - Constructs an object from ``t`` as an element of ``self``, if + Construct an object from ``t`` as an element of ``self``, if possible. This is inherited by all Tableaux, SemistandardTableaux, and StandardTableaux classes. INPUT: - - ``t`` -- Data which can be interpreted as a tableau + - ``t`` -- data which can be interpreted as a tableau - OUTPUT: - - - The corresponding tableau object + OUTPUT: the corresponding tableau object TESTS:: @@ -5734,7 +5722,7 @@ class Tableaux_all(Tableaux): def __init__(self): r""" - Initializes the class of all tableaux + Initialize the class of all tableaux. TESTS:: @@ -5772,7 +5760,7 @@ class Tableaux_size(Tableaux): def __init__(self, n): r""" - Initializes the class of tableaux of size ``n``. + Initialize the class of tableaux of size `n`. TESTS:: @@ -5845,11 +5833,11 @@ class SemistandardTableaux(Tableaux): Keyword arguments: - - ``size`` -- The size of the tableaux - - ``shape`` -- The shape of the tableaux - - ``eval`` -- The weight (also called content or evaluation) of + - ``size`` -- the size of the tableaux + - ``shape`` -- the shape of the tableaux + - ``eval`` -- the weight (also called content or evaluation) of the tableaux - - ``max_entry`` -- A maximum entry for the tableaux. This can be a + - ``max_entry`` -- a maximum entry for the tableaux. This can be a positive integer or infinity (``oo``). If ``size`` or ``shape`` are specified, ``max_entry`` defaults to be ``size`` or the size of ``shape``. @@ -6055,7 +6043,7 @@ def __classcall_private__(cls, *args, **kwargs): if not isinstance(size, (int, Integer)): raise ValueError("size must be an integer") if size < 0: - raise ValueError("size must be non-negative") + raise ValueError("size must be nonnegative") if shape is not None: from sage.combinat.skew_partition import SkewPartitions @@ -6284,7 +6272,7 @@ class SemistandardTableaux_all(SemistandardTableaux, DisjointUnionEnumeratedSets def __init__(self, max_entry=None): r""" - Initializes the class of all semistandard tableaux. + Initialize the class of all semistandard tableaux. .. WARNING:: @@ -6444,7 +6432,7 @@ class SemistandardTableaux_shape_inf(SemistandardTableaux): def __init__(self, p): r""" - Initializes the class of semistandard tableaux of shape ``p`` and no + Initialize the class of semistandard tableaux of shape ``p`` and no maximum entry. .. WARNING:: @@ -6532,7 +6520,7 @@ class SemistandardTableaux_size(SemistandardTableaux): def __init__(self, n, max_entry=None): r""" - Initializes the class of semistandard tableaux of size ``n``. + Initialize the class of semistandard tableaux of size `n`. .. WARNING:: @@ -6731,12 +6719,12 @@ class SemistandardTableaux_shape(SemistandardTableaux): INPUT: - ``p`` -- a partition - - ``max_entry`` -- the max entry; defaults to the size of ``p`` + - ``max_entry`` -- the max entry; defaults to the size of `p` """ def __init__(self, p, max_entry=None): r""" - Initializes the class of semistandard tableaux of shape ``p``, with a + Initialize the class of semistandard tableaux of shape `p`, with a given ``max_entry``. .. WARNING:: @@ -6948,7 +6936,7 @@ class SemistandardTableaux_shape_weight(SemistandardTableaux_shape): def __init__(self, p, mu): r""" - Initializes the class of all semistandard tableaux of shape ``p`` and + Initialize the class of all semistandard tableaux of shape ``p`` and weight ``mu``. .. WARNING:: @@ -7065,7 +7053,7 @@ class SemistandardTableaux_size_weight(SemistandardTableaux): def __init__(self, n, mu): r""" - Initializes the class of semistandard tableaux of size ``n`` and + Initialize the class of semistandard tableaux of size ``n`` and weight ``mu``. .. WARNING:: @@ -7152,14 +7140,12 @@ class RowStandardTableaux(Tableaux): INPUT: - - either a non-negative integer (possibly specified with the keyword + - either a nonnegative integer (possibly specified with the keyword ``n``) or a partition - OUTPUT: - - - with no argument, the class of all standard tableaux + OUTPUT: with no argument, the class of all standard tableaux - - with a non-negative integer argument, ``n``, the class of all standard + - with a nonnegative integer argument, ``n``, the class of all standard tableaux of size ``n`` - with a partition argument, the class of all standard tableaux of that @@ -7244,11 +7230,11 @@ def __classcall_private__(cls, *args, **kwargs): sage: RowStandardTableaux(-1) Traceback (most recent call last): ... - ValueError: the argument must be a non-negative integer or a partition + ValueError: the argument must be a nonnegative integer or a partition sage: RowStandardTableaux([[1]]) Traceback (most recent call last): ... - ValueError: the argument must be a non-negative integer or a partition + ValueError: the argument must be a nonnegative integer or a partition """ from sage.combinat.partition import _Partitions from sage.combinat.skew_partition import SkewPartitions @@ -7272,7 +7258,7 @@ def __classcall_private__(cls, *args, **kwargs): raise NotImplementedError("row standard skew tableaux not yet implemented") if not isinstance(n, (int, Integer)) or n < 0: - raise ValueError("the argument must be a non-negative integer or a partition") + raise ValueError("the argument must be a nonnegative integer or a partition") return RowStandardTableaux_size(n) @@ -7315,7 +7301,7 @@ class RowStandardTableaux_all(RowStandardTableaux, DisjointUnionEnumeratedSets): def __init__(self): r""" - Initializes the class of all standard tableaux. + Initialize the class of all standard tableaux. .. WARNING:: @@ -7380,7 +7366,7 @@ class RowStandardTableaux_size(RowStandardTableaux, DisjointUnionEnumeratedSets) def __init__(self, n): r""" - Initializes the class of all row standard tableaux of size ``n``. + Initialize the class of all row standard tableaux of size ``n``. .. WARNING:: @@ -7450,7 +7436,7 @@ class RowStandardTableaux_shape(RowStandardTableaux): def __init__(self, p): r""" - Initializes the class of all row standard tableaux of a given shape. + Initialize the class of all row standard tableaux of a given shape. .. WARNING:: @@ -7566,14 +7552,12 @@ class StandardTableaux(SemistandardTableaux): INPUT: - - Either a non-negative integer (possibly specified with the keyword ``n``) + - Either a nonnegative integer (possibly specified with the keyword ``n``) or a partition. - OUTPUT: - - - With no argument, the class of all standard tableaux + OUTPUT: with no argument, the class of all standard tableaux - - With a non-negative integer argument, ``n``, the class of all standard + - With a nonnegative integer argument, ``n``, the class of all standard tableaux of size ``n`` - With a partition argument, the class of all standard tableaux of that @@ -7646,11 +7630,11 @@ def __classcall_private__(cls, *args, **kwargs): sage: StandardTableaux(-1) Traceback (most recent call last): ... - ValueError: the argument must be a non-negative integer or a partition + ValueError: the argument must be a nonnegative integer or a partition sage: StandardTableaux([[1]]) Traceback (most recent call last): ... - ValueError: the argument must be a non-negative integer or a partition + ValueError: the argument must be a nonnegative integer or a partition """ from sage.combinat.partition import _Partitions from sage.combinat.skew_partition import SkewPartitions @@ -7673,7 +7657,7 @@ def __classcall_private__(cls, *args, **kwargs): return StandardSkewTableaux(n) if not isinstance(n, (int, Integer)) or n < 0: - raise ValueError("the argument must be a non-negative integer or a partition") + raise ValueError("the argument must be a nonnegative integer or a partition") return StandardTableaux_size(n) @@ -7718,7 +7702,7 @@ class StandardTableaux_all(StandardTableaux, DisjointUnionEnumeratedSets): def __init__(self): r""" - Initializes the class of all standard tableaux. + Initialize the class of all standard tableaux. TESTS:: @@ -7770,7 +7754,7 @@ class StandardTableaux_size(StandardTableaux, DisjointUnionEnumeratedSets): def __init__(self, n): r""" - Initializes the class of all standard tableaux of size ``n``. + Initialize the class of all standard tableaux of size `n`. .. WARNING:: @@ -7957,7 +7941,7 @@ class StandardTableaux_shape(StandardTableaux): def __init__(self, p): r""" - Initializes the class of all semistandard tableaux of a given shape. + Initialize the class of all semistandard tableaux of a given shape. .. WARNING:: @@ -8587,7 +8571,7 @@ def __classcall_private__(cls, *args, **kwargs): # Consistency checks if size is not None: if size not in NonNegativeIntegers(): - raise ValueError("size must be a non-negative integer") + raise ValueError("size must be a nonnegative integer") size = Integer(size) if shape is not None: @@ -8621,7 +8605,7 @@ def __classcall_private__(cls, *args, **kwargs): if not is_inf and not isinstance(max_entry, (int, Integer)): raise ValueError("max_entry must be an integer or PlusInfinity") elif max_entry < 0: - raise ValueError("max_entry must be non-negative") + raise ValueError("max_entry must be nonnegative") if size is not None and shape is not None: if sum(shape) != size: @@ -8856,7 +8840,7 @@ class IncreasingTableaux_all(IncreasingTableaux, DisjointUnionEnumeratedSets): def __init__(self, max_entry=None): r""" - Initializes the class of all increasing tableaux. + Initialize the class of all increasing tableaux. .. WARNING:: @@ -8911,7 +8895,7 @@ class IncreasingTableaux_size_inf(IncreasingTableaux): def __init__(self, n): r""" - Initializes the class of increasing tableaux of size ``n`` with no + Initialize the class of increasing tableaux of size `n` with no maximum entry. .. WARNING:: @@ -8992,7 +8976,7 @@ class IncreasingTableaux_shape_inf(IncreasingTableaux): def __init__(self, p): r""" - Initializes the class of increasing tableaux of shape ``p`` and no + Initialize the class of increasing tableaux of shape `p` and no maximum entry. .. WARNING:: @@ -9074,7 +9058,7 @@ class IncreasingTableaux_size(IncreasingTableaux): def __init__(self, n, max_entry=None): r""" - Initializes the class of increasing tableaux of size ``n``. + Initialize the class of increasing tableaux of size `n`. .. WARNING:: @@ -9194,7 +9178,7 @@ class IncreasingTableaux_shape(IncreasingTableaux): def __init__(self, p, max_entry=None): r""" - Initializes the class of increasing tableaux of shape ``p``, with a + Initialize the class of increasing tableaux of shape `p`, with a given ``max_entry``. .. WARNING:: @@ -9313,7 +9297,7 @@ class IncreasingTableaux_shape_weight(IncreasingTableaux_shape): def __init__(self, p, wt): r""" - Initializes the class of all increasing tableaux of shape ``p`` and + Initialize the class of all increasing tableaux of shape ``p`` and weight ``mu``. .. WARNING:: @@ -9457,7 +9441,7 @@ class IncreasingTableaux_size_weight(IncreasingTableaux): def __init__(self, n, wt): r""" - Initializes the class of increasing tableaux of size ``n`` and + Initialize the class of increasing tableaux of size `n` and weight ``wt``. .. WARNING:: diff --git a/src/sage/combinat/tableau_residues.py b/src/sage/combinat/tableau_residues.py index db94461f6ef..7ff1b1a7286 100644 --- a/src/sage/combinat/tableau_residues.py +++ b/src/sage/combinat/tableau_residues.py @@ -437,7 +437,7 @@ def swap_residues(self, i, j): INPUT: - - ``i`` and ``j`` -- two integers between `1` and the length of + - ``i``, ``j`` -- two integers between `1` and the length of the residue sequence If residue sequence ``self`` is of the form `(r_1, \ldots, r_n)`, and @@ -792,8 +792,8 @@ def cell_residue(self, *args): INPUT: - - ``r`` and ``c`` -- the row and column indices in level one - - ``k``, ``r`` and ``c`` -- the component, row and column indices + - ``r``, ``c`` -- the row and column indices in level one + - ``k``, ``r``, ``c`` -- the component, row and column indices in higher levels EXAMPLES:: diff --git a/src/sage/combinat/tableau_tuple.py b/src/sage/combinat/tableau_tuple.py index 004988ff261..5c5984d39bc 100644 --- a/src/sage/combinat/tableau_tuple.py +++ b/src/sage/combinat/tableau_tuple.py @@ -251,12 +251,10 @@ class TableauTuple(CombinatorialElement): INPUT: - - ``t`` -- a list or tuple of :class:`Tableau`, a list or tuple of lists + - ``t`` -- list or tuple of :class:`Tableau`, a list or tuple of lists of lists - OUTPUT: - - - The Tableau tuple object constructed from ``t``. + OUTPUT: the Tableau tuple object constructed from ``t`` A :class:`TableauTuple` is a tuple of tableau of shape a :class:`PartitionTuple`. These combinatorial objects are useful is @@ -538,7 +536,7 @@ def _latex_(self): \lr{6}&\lr{7}\\\cline{1-2} \end{array}$} } \Bigg) - sage: TableauTuples.options(convention="french") + sage: TableauTuples.options(convention='french') sage: latex(t) # indirect doctest \Bigg( {\def\lr#1{\multicolumn{1}{|@{\hspace{.6ex}}c@{\hspace{.6ex}}|}{\raisebox{-.3ex}{$#1$}}} \raisebox{-.6ex}{$\begin{array}[t]{*{2}c}\cline{1-1} @@ -622,9 +620,7 @@ def __call__(self, *cell): - ``cell`` -- a triple of integers, tuple, or list specifying a cell in ``self`` - OUTPUT: - - - The value in the corresponding cell. + OUTPUT: the value in the corresponding cell EXAMPLES:: @@ -733,7 +729,7 @@ def pp(self): 4 5 4 5 8 14 6 9 - sage: TableauTuples.options(convention="french") + sage: TableauTuples.options(convention='french') sage: t.pp() 9 6 @@ -1307,7 +1303,7 @@ def content(self, k, multicharge): INPUT: - - ``k`` -- an integer in `\{1, 2, \ldots, n\}` + - ``k`` -- integer in `\{1, 2, \ldots, n\}` - ``multicharge`` -- a sequence of integers of length `l` Here `l` is the :meth:`~TableauTuple.level` and `n` is the @@ -1354,9 +1350,9 @@ def residue(self, k, e, multicharge): INPUT: - - ``k`` -- an integer in `\{1, 2, \ldots, n\}` - - ``e`` -- an integer in `\{0, 2, 3, 4, 5, \ldots\}` - - ``multicharge`` -- a list of integers of length `l` + - ``k`` -- integer in `\{1, 2, \ldots, n\}` + - ``e`` -- integer in `\{0, 2, 3, 4, 5, \ldots\}` + - ``multicharge`` -- list of integers of length `l` Here `l` is the :meth:`~TableauTuple.level` and `n` is the :meth:`~TableauTuple.size` of ``self``. @@ -1410,9 +1406,7 @@ class RowStandardTableauTuple(TableauTuple, metaclass=ClasscallMetaclass): - ``t`` -- a tableau, a list of (standard) tableau or an equivalent list - OUTPUT: - - - A :class:`RowStandardTableauTuple` object constructed from ``t``. + OUTPUT: a :class:`RowStandardTableauTuple` object constructed from ``t`` .. NOTE:: @@ -1536,7 +1530,7 @@ def __classcall_private__(self, t): def __init__(self, parent, t, check=True): r""" - Initializes a row standard tableau tuple. + Initialize a row standard tableau tuple. EXAMPLES:: @@ -1787,9 +1781,7 @@ class StandardTableauTuple(RowStandardTableauTuple): - ``t`` -- a tableau, a list of (standard) tableau or an equivalent list - OUTPUT: - - - A :class:`StandardTableauTuple` object constructed from ``t``. + OUTPUT: a :class:`StandardTableauTuple` object constructed from ``t`` .. NOTE:: @@ -1918,7 +1910,7 @@ def __classcall_private__(self, t): def __init__(self, parent, t, check=True): r""" - Initializes a standard tableau tuple. + Initialize a standard tableau tuple. EXAMPLES:: @@ -2050,15 +2042,13 @@ class TableauTuples(UniqueRepresentation, Parent): - ``level`` -- the level of the tableau tuples (positive integer) - - ``size`` -- the size of the tableau tuples (non-negative integer) + - ``size`` -- the size of the tableau tuples (nonnegative integer) It is not necessary to use the keywords. If they are not specified then the first integer argument specifies the ``level`` and the second the ``size`` of the tableaux. - OUTPUT: - - - The corresponding class of tableau tuples. + OUTPUT: the corresponding class of tableau tuples The entries of a tableau can be any sage object. Because of this, no enumeration of the set of :class:`TableauTuples` is possible. @@ -2191,7 +2181,7 @@ def __classcall_private__(cls, level=None, size=None): raise ValueError('the level must be a positive integer') if not (size is None or size in NN): - raise ValueError('the size must be a non-negative integer') + raise ValueError('the size must be a nonnegative integer') # now that the inputs appear to make sense, return the appropriate class @@ -2211,18 +2201,16 @@ def __classcall_private__(cls, level=None, size=None): def _element_constructor_(self, t): r""" - Constructs an object from t as an element of ``self``, if possible. + Construct an object from t as an element of ``self``, if possible. This is inherited by all :class:`TableauTuples`, :class:`StandardTableauTuples`, and :class:`StandardTableauTuples` classes. INPUT: - - ``t`` -- Data which can be interpreted as a tableau + - ``t`` -- data which can be interpreted as a tableau - OUTPUT: - - - The corresponding tableau object + OUTPUT: the corresponding tableau object EXAMPLES:: @@ -2378,7 +2366,7 @@ class TableauTuples_all(TableauTuples): def __init__(self): r""" - Initializes the class of all tableaux. + Initialize the class of all tableaux. EXAMPLES:: @@ -2421,7 +2409,7 @@ class TableauTuples_level(TableauTuples): def __init__(self, level): r""" - Initializes the class of tableaux of level ``level``. + Initialize the class of tableaux of level ``level``. EXAMPLES:: @@ -2502,7 +2490,7 @@ class TableauTuples_size(TableauTuples): def __init__(self, size): """ - Initializes the class of tableaux of size ``size``. + Initialize the class of tableaux of size ``size``. EXAMPLES:: @@ -2583,7 +2571,7 @@ class TableauTuples_level_size(TableauTuples): def __init__(self, level, size): r""" - Initializes the class of tableaux of size ``size``. + Initialize the class of tableaux of size ``size``. EXAMPLES:: @@ -2679,9 +2667,9 @@ class RowStandardTableauTuples(TableauTuples): - ``level`` -- the :meth:`~TableauTuples.level` of the tuples of tableaux - - ``size`` -- the :meth:`~TableauTuples.size` of the tuples of tableaux + - ``size`` -- the :meth:`~TableauTuples.size` of the tuples of tableaux - - ``shape`` -- a list or a partition tuple specifying the :meth:`shape` of + - ``shape`` -- list or a partition tuple specifying the :meth:`shape` of the row standard tableau tuples It is not necessary to use the keywords. If they are not used then the @@ -2825,7 +2813,7 @@ def __classcall_private__(cls, *args, **kwargs): raise ValueError('the level must be a positive integer') if size is not None and (not isinstance(size, (int, Integer)) or size < 0): - raise ValueError('the size must be a non-negative integer') + raise ValueError('the size must be a nonnegative integer') if shape is not None: try: @@ -2980,7 +2968,7 @@ class RowStandardTableauTuples_all(RowStandardTableauTuples, DisjointUnionEnumer def __init__(self): r""" - Initializes the class of all row standard tableaux. + Initialize the class of all row standard tableaux. .. WARNING:: @@ -3031,7 +3019,7 @@ class RowStandardTableauTuples_level(RowStandardTableauTuples, DisjointUnionEnum def __init__(self, level): r""" - Initializes the class of row standard tableaux of level + Initialize the class of row standard tableaux of level ``level`` of arbitrary ``size``. .. WARNING:: @@ -3129,7 +3117,7 @@ class RowStandardTableauTuples_size(RowStandardTableauTuples, DisjointUnionEnume def __init__(self, size): r""" - Initializes the class of row standard tableaux of size ``size`` of + Initialize the class of row standard tableaux of size ``size`` of arbitrary level. .. WARNING:: @@ -3229,7 +3217,7 @@ class RowStandardTableauTuples_level_size(RowStandardTableauTuples, DisjointUnio def __init__(self, level, size): r""" - Initializes the class of row standard tableaux of level ``level`` + Initialize the class of row standard tableaux of level ``level`` and size ``size``. .. WARNING:: @@ -3345,7 +3333,7 @@ class RowStandardTableauTuples_shape(RowStandardTableauTuples): def __init__(self, shape): r""" - Initializes the class of row standard tableaux of shape ``p`` + Initialize the class of row standard tableaux of shape ``p`` and no maximum entry. .. WARNING:: @@ -3973,9 +3961,9 @@ class StandardTableauTuples(RowStandardTableauTuples): - ``level`` -- the :meth:`~TableauTuples.level` of the tuples of tableaux - - ``size`` -- the :meth:`~TableauTuples.size` of the tuples of tableaux + - ``size`` -- the :meth:`~TableauTuples.size` of the tuples of tableaux - - ``shape`` -- a list or a partition tuple specifying the :meth:`shape` of + - ``shape`` -- list or a partition tuple specifying the :meth:`shape` of the standard tableau tuples It is not necessary to use the keywords. If they are not used then the first @@ -4115,7 +4103,7 @@ def __classcall_private__(cls, *args, **kwargs): raise ValueError('the level must be a positive integer') if size is not None and (not isinstance(size, (int, Integer)) or size < 0): - raise ValueError('the size must be a non-negative integer') + raise ValueError('the size must be a nonnegative integer') if shape is not None: try: @@ -4269,7 +4257,7 @@ class StandardTableauTuples_all(StandardTableauTuples, DisjointUnionEnumeratedSe def __init__(self): r""" - Initializes the class of all standard tableaux. Input is not + Initialize the class of all standard tableaux. Input is not checked; please use :class:`StandardTableauTuples` to ensure the options are properly parsed. @@ -4462,7 +4450,7 @@ class StandardTableauTuples_size(StandardTableauTuples, DisjointUnionEnumeratedS def __init__(self, size): r""" - Initializes the class of semistandard tableaux of size ``size`` of + Initialize the class of semistandard tableaux of size ``size`` of arbitrary level. Input is not checked; please use :class:`StandardTableauTuples` to ensure the options are properly parsed. @@ -4589,7 +4577,7 @@ class StandardTableauTuples_level_size(StandardTableauTuples, DisjointUnionEnume def __init__(self, level, size): r""" - Initializes the class of semistandard tableaux of level ``level`` and + Initialize the class of semistandard tableaux of level ``level`` and size ``size``. Input is not checked; please use :class:`StandardTableauTuples` to ensure the options are properly parsed. @@ -4732,7 +4720,7 @@ class StandardTableauTuples_shape(StandardTableauTuples): def __init__(self, shape): r""" - Initializes the class of semistandard tableaux of shape ``p`` and no + Initialize the class of semistandard tableaux of shape ``p`` and no maximum entry. Input is not checked; please use :class:`StandardTableauTuples` to ensure the options are properly parsed. @@ -5330,9 +5318,7 @@ def _add_entry_fast(T, cell, m): - ``cell`` -- the cell - ``m`` -- the entry to add - OUTPUT: - - - a list of lists of lists representing the tableau tuple + OUTPUT: list of lists of lists representing the tableau tuple .. WARNING:: diff --git a/src/sage/combinat/tamari_lattices.py b/src/sage/combinat/tamari_lattices.py index 862eb73dcae..7497bd2e503 100644 --- a/src/sage/combinat/tamari_lattices.py +++ b/src/sage/combinat/tamari_lattices.py @@ -66,9 +66,7 @@ def paths_in_triangle(i, j, a, b) -> list[tuple[int, ...]]: - `i` and `j` -- nonnegative integers with `1 \geq \frac{j}{b} \geq \frac{i}{a} \geq 0` - OUTPUT: - - - a list of paths + OUTPUT: list of paths EXAMPLES:: @@ -110,11 +108,9 @@ def swap(p, i, m=1) -> tuple[int, ...]: - ``p`` -- a Dyck path in the `(a \times b)`-rectangle - - ``i`` -- an integer between `0` and `a+b-1` - - OUTPUT: + - ``i`` -- integer between `0` and `a+b-1` - - a Dyck path in the `(a \times b)`-rectangle + OUTPUT: a Dyck path in the `(a \times b)`-rectangle EXAMPLES:: @@ -171,7 +167,7 @@ def GeneralizedTamariLattice(a, b, m=1): - `a` and `b` -- integers with `a \geq b` - - `m` -- a nonnegative rational number such that `a \geq b m` + - ``m`` -- a nonnegative rational number such that `a \geq b m` OUTPUT: @@ -239,9 +235,9 @@ def TamariLattice(n, m=1): INPUT: - - `n` -- a nonnegative integer (the index) + - ``n`` -- a nonnegative integer (the index) - - `m` -- an optional nonnegative integer (the slope, default to 1) + - ``m`` -- an optional nonnegative integer (the slope, default to 1) OUTPUT: a finite lattice @@ -282,7 +278,7 @@ def swap_dexter(p, i) -> list[tuple[int, ...]]: - ``p`` -- a Dyck path in the `(a \times b)`-rectangle - - ``i`` -- an integer between `0` and `a+b-1` + - ``i`` -- integer between `0` and `a+b-1` OUTPUT: @@ -350,9 +346,7 @@ def DexterSemilattice(n): - ``n`` -- a nonnegative integer (the index) - OUTPUT: - - a finite meet-semilattice + OUTPUT: a finite meet-semilattice The elements of the semilattice are :func:`Dyck paths` in the `(n+1 \times diff --git a/src/sage/combinat/tiling.py b/src/sage/combinat/tiling.py index bb35fb4684e..78bbdad26c2 100644 --- a/src/sage/combinat/tiling.py +++ b/src/sage/combinat/tiling.py @@ -861,7 +861,7 @@ def __rmul__(self, m): INPUT: - - ``m`` -- square matrix, matching the dimension of ``self``. + - ``m`` -- square matrix, matching the dimension of ``self`` OUTPUT: polyomino @@ -980,7 +980,7 @@ def translated_copies(self, box): INPUT: - - ``box`` -- Polyomino or tuple of integers (size of a box) + - ``box`` -- polyomino or tuple of integers (size of a box) OUTPUT: iterator of 3d polyominoes @@ -1083,7 +1083,7 @@ def translated_copies_intersection(self, box): INPUT: - - ``box`` -- Polyomino or tuple of integers (size of a box) + - ``box`` -- polyomino or tuple of integers (size of a box) OUTPUT: set of 3d polyominoes @@ -1141,7 +1141,7 @@ def isometric_copies(self, box, orientation_preserving=True, INPUT: - - ``box`` -- Polyomino or tuple of integers (size of a box) + - ``box`` -- polyomino or tuple of integers (size of a box) - ``orientation_preserving`` -- boolean (default: ``True``); If ``True``, the group of isometries of the `n`-cube is restricted @@ -1209,7 +1209,7 @@ def isometric_copies_intersection(self, box, orientation_preserving=True): INPUT: - - ``box`` -- Polyomino or tuple of integers (size of a box) + - ``box`` -- polyomino or tuple of integers (size of a box) - ``orientation_preserving`` -- boolean (default: ``True``); if ``True``, the group of isometries of the `n`-cube is restricted @@ -1510,7 +1510,7 @@ def self_surrounding(self, radius, remove_incomplete_copies=True, ####################### class TilingSolver(SageObject): r""" - Tiling solver + Tiling solver. Solve the problem of tiling a polyomino with a certain number of polyominoes. @@ -1518,7 +1518,7 @@ class TilingSolver(SageObject): INPUT: - ``pieces`` -- iterable of Polyominoes - - ``box`` -- Polyomino or tuple of integers (size of a box) + - ``box`` -- polyomino or tuple of integers (size of a box) - ``rotation`` -- boolean (default: ``True``); whether to allow rotations - ``reflection`` -- boolean (default: ``False``); whether to allow @@ -1610,7 +1610,7 @@ def __init__(self, pieces, box, rotation=True, def _repr_(self): r""" - String representation + String representation. EXAMPLES:: @@ -1783,7 +1783,7 @@ def rows_for_piece(self, i, mod_box_isometries=False): INPUT: - - ``i`` -- integer, the `i`-th piece + - ``i`` -- integer; the `i`-th piece - ``mod_box_isometries`` -- boolean (default: ``False``); whether to consider only rows for positions up to the action of the @@ -1857,7 +1857,7 @@ def rows_for_piece(self, i, mod_box_isometries=False): @cached_method def rows(self): r""" - Creation of the rows + Creation of the rows. EXAMPLES:: @@ -1902,8 +1902,8 @@ def _rows_mod_box_isometries(self, i): INPUT: - - ``i`` -- integer, the `i`-th piece to consider, that piece must not - be isometric to itself by a isometry that preserve the box. + - ``i`` -- integer; the `i`-th piece to consider, that piece must not + be isometric to itself by a isometry that preserve the box EXAMPLES:: @@ -2008,7 +2008,7 @@ def row_to_polyomino(self, row_number): INPUT: - - ``row_number`` -- integer, the `i`-th row + - ``row_number`` -- integer; the `i`-th row OUTPUT: polyomino @@ -2036,8 +2036,8 @@ def row_to_polyomino(self, row_number): We check that issue :issue:`32252` is fixed and that colors of polyominoes are properly recovered:: - sage: v = Polyomino([(0, 0), (0, 1)], color="blue") - sage: h = Polyomino([(0, 0), (1, 0)], color="red") + sage: v = Polyomino([(0, 0), (0, 1)], color='blue') + sage: h = Polyomino([(0, 0), (1, 0)], color='red') sage: T = TilingSolver(pieces=[v, h], box=(2, 2), ....: rotation=False, reflection=False, reusable=True) sage: for i in range(4): print(i,T.row_to_polyomino(i)) @@ -2369,7 +2369,7 @@ def animate(self, partial=None, stop=None, size=0.75, axes=False): - ``'common_prefix'`` -- common prefix between two consecutive solutions - ``'incremental'`` -- one piece change at a time - - ``stop`` -- integer (default:``None``), number of frames + - ``stop`` -- integer (default: ``None``); number of frames - ``size`` -- number (default: ``0.75``); the size of each ``1 \times 1`` square. This does a homothety with respect @@ -2406,7 +2406,7 @@ def animate(self, partial=None, stop=None, size=0.75, axes=False): The ``show`` function takes arguments to specify the delay between frames (measured in hundredths of a second, default value 20) and - the number of iterations (default value 0, which means to iterate + the number of iterations (default: 0, which means to iterate forever). To iterate 4 times with half a second between each frame:: sage: a.show(delay=50, iterations=4) # long time, optional - imagemagick, needs sage.plot diff --git a/src/sage/combinat/triangles_FHM.py b/src/sage/combinat/triangles_FHM.py index 6822f342658..a98a78c1841 100644 --- a/src/sage/combinat/triangles_FHM.py +++ b/src/sage/combinat/triangles_FHM.py @@ -7,7 +7,7 @@ invertible rational change-of-variables involving `x` and `y`. These polynomial are called triangles because their supports, the sets -of exponents where their coefficients can be non-zero, have a triangular shape. +of exponents where their coefficients can be nonzero, have a triangular shape. The M-triangle class is motivated by the generating series of Möbius numbers for graded posets. A typical example is:: @@ -388,9 +388,7 @@ def transmute(self): """ Return the image of ``self`` by an involution. - OUTPUT: - - another M-triangle + OUTPUT: another M-triangle The involution is defined by converting to an H-triangle, transposing the matrix, and then converting back to an M-triangle. @@ -466,9 +464,7 @@ def transpose(self): """ Return the transposed H-triangle. - OUTPUT: - - another H-triangle + OUTPUT: another H-triangle This operation is an involution. When seen as a matrix, it performs a symmetry with respect to the northwest-southeast diff --git a/src/sage/combinat/tutorial.py b/src/sage/combinat/tutorial.py index 0da72d30dbf..fe6cc26e8f5 100644 --- a/src/sage/combinat/tutorial.py +++ b/src/sage/combinat/tutorial.py @@ -1540,7 +1540,7 @@ These sets share the same underlying algorithmic structure, implemented in the more general (and slightly more cumbersome) class ``IntegerListsLex``. This class models sets of vectors -`(\ell_0,\dots,\ell_k)` of non-negative integers, with +`(\ell_0,\dots,\ell_k)` of nonnegative integers, with constraints on the sum and the length, and bounds on the parts and on the consecutive differences between the parts. Here are some more examples:: diff --git a/src/sage/combinat/vector_partition.py b/src/sage/combinat/vector_partition.py index 9e5f5ac9025..bf1ea0b8122 100644 --- a/src/sage/combinat/vector_partition.py +++ b/src/sage/combinat/vector_partition.py @@ -36,7 +36,7 @@ def find_min(vect): INPUT: - - ``vec`` -- A list of integers + - ``vec`` -- list of integers OUTPUT: @@ -68,8 +68,8 @@ def IntegerVectorsIterator(vect, min=None): INPUT: - - ``vect`` -- A list of non-negative integers - - ``min`` -- A list of non-negative integers dominated elementwise by ``vect`` + - ``vect`` -- list of nonnegative integers + - ``min`` -- list of nonnegative integers dominated elementwise by ``vect`` OUTPUT: @@ -169,16 +169,18 @@ class VectorPartitions(UniqueRepresentation, Parent): Class of all vector partitions of ``vec`` with all parts greater than or equal to ``min`` in lexicographic order, with parts from ``parts``. - A vector partition of ``vec`` is a list of vectors with non-negative + A vector partition of ``vec`` is a list of vectors with nonnegative integer entries whose sum is ``vec``. INPUT: - - ``vec`` -- Integer vector - - ``min`` -- Integer vector dominated elementwise by ``vec`` - - ``parts`` -- Finite list of possible parts - - ``distinct`` -- Boolean, set to ``True`` if only vector partitions with distinct parts are enumerated - - ``is_repeatable`` -- Boolean function on ``parts`` which gives ``True`` in parts that can be repeated + - ``vec`` -- integer vector + - ``min`` -- integer vector dominated elementwise by ``vec`` + - ``parts`` -- finite list of possible parts + - ``distinct`` -- boolean, set to ``True`` if only vector partitions with + distinct parts are enumerated + - ``is_repeatable`` -- boolean function on ``parts`` which gives ``True`` + in parts that can be repeated EXAMPLES: diff --git a/src/sage/combinat/words/abstract_word.py b/src/sage/combinat/words/abstract_word.py index 9dedcc03e11..ec744e5b5c2 100644 --- a/src/sage/combinat/words/abstract_word.py +++ b/src/sage/combinat/words/abstract_word.py @@ -830,12 +830,10 @@ def _iterated_right_palindromic_closure_iterator(self, f=None): INPUT: - - ``f`` -- involution on the alphabet of ``self`` (default: ``None``); + - ``f`` -- involution on the alphabet of ``self`` (default: ``None``); it must be callable on letters as well as words (e.g. WordMorphism) - OUTPUT: - - iterator -- the iterated (`f`-)palindromic closure of self + OUTPUT: iterator -- the iterated (`f`-)palindromic closure of self EXAMPLES:: diff --git a/src/sage/combinat/yang_baxter_graph.py b/src/sage/combinat/yang_baxter_graph.py index 1fffb3e29a6..6d90493b3fd 100644 --- a/src/sage/combinat/yang_baxter_graph.py +++ b/src/sage/combinat/yang_baxter_graph.py @@ -43,9 +43,7 @@ def YangBaxterGraph(partition=None, root=None, operators=None): tuples of the form `(v, l)` where `v` is a successor of `u` and `l` is the label of the edge from `u` to `v`. - OUTPUT: - - - Either: + OUTPUT: either: - :class:`YangBaxterGraph_partition` -- if partition is defined - :class:`YangBaxterGraph_generic` -- if partition is ``None`` @@ -126,7 +124,7 @@ def __init__(self, root, operators): - ``root`` -- the root vertex of the graph - - ``operators`` -- a list of callables that map vertices to (new) + - ``operators`` -- list of callables that map vertices to (new) vertices. .. NOTE:: @@ -413,7 +411,7 @@ def vertices(self, sort=False) -> list: INPUT: - - ``sort`` -- boolean (default ``False``) whether to sort the vertices + - ``sort`` -- boolean (default: ``False``); whether to sort the vertices EXAMPLES:: @@ -456,9 +454,7 @@ def vertex_relabelling_dict(self, v, relabel_operator) -> dict: - ``relabel_operator`` -- function mapping a vertex and a label to the image of the vertex - OUTPUT: - - - dictionary pairing vertices with the corresponding image of ``v`` + OUTPUT: dictionary pairing vertices with the corresponding image of ``v`` EXAMPLES:: @@ -488,10 +484,10 @@ def relabel_vertices(self, v, relabel_operator, inplace=True): INPUT: - - ``v`` -- tuple, Permutation, ... + - ``v`` -- tuple, Permutation, etc - ``inplace`` -- if ``True``, modifies ``self``; otherwise returns a - modified copy of ``self``. + modified copy of ``self`` EXAMPLES:: @@ -678,9 +674,9 @@ def _swap_operator(self, operator, u): INPUT: - - ``i`` -- positive integer between 1 and len(u)-1, inclusive + - ``i`` -- positive integer between ``1`` and ``len(u)-1``, inclusive - - ``u`` -- tuple, list, permutation, .... + - ``u`` -- tuple, list, permutation, etc EXAMPLES:: @@ -709,9 +705,7 @@ def vertex_relabelling_dict(self, v) -> dict: - ``v`` -- an object - OUTPUT: - - - dictionary pairing vertices with the corresponding image of ``v`` + OUTPUT: dictionary pairing vertices with the corresponding image of ``v`` EXAMPLES:: @@ -735,10 +729,10 @@ def relabel_vertices(self, v, inplace=True): INPUT: - - ``v`` -- tuple, Permutation, ... + - ``v`` -- tuple, Permutation, etc - ``inplace`` -- if ``True``, modifies ``self``; otherwise - returns a modified copy of ``self``. + returns a modified copy of ``self`` EXAMPLES:: @@ -913,7 +907,7 @@ def __call__(self, u): - ``i`` -- positive integer between ``1`` and ``len(u)-1``, inclusive - - ``u`` -- tuple, list, permutation, .... + - ``u`` -- tuple, list, permutation, etc EXAMPLES::