From 32403e99d99b7ba0833a516da28f5d307c605f5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Chapoton?= Date: Sat, 6 Aug 2022 18:05:55 +0200 Subject: [PATCH] a few rst fixes in pyx files --- src/sage/coding/codecan/codecan.pyx | 6 ++-- src/sage/graphs/distances_all_pairs.pyx | 5 ++-- .../vertex_separation.pyx | 2 +- src/sage/graphs/matchpoly.pyx | 2 +- .../perm_gps/partn_ref/data_structures.pyx | 5 ++-- .../perm_gps/partn_ref/refinement_binary.pyx | 28 +++++++++++-------- .../partn_ref2/refinement_generic.pyx | 2 +- .../groups/perm_gps/permgroup_element.pyx | 12 ++++---- 8 files changed, 35 insertions(+), 27 deletions(-) diff --git a/src/sage/coding/codecan/codecan.pyx b/src/sage/coding/codecan/codecan.pyx index e88b560fef4..5320a49b179 100644 --- a/src/sage/coding/codecan/codecan.pyx +++ b/src/sage/coding/codecan/codecan.pyx @@ -369,7 +369,7 @@ cdef class InnerGroup: return self.transporter def __repr__(self): - """ + r""" EXAMPLES:: sage: from sage.coding.codecan.codecan import InnerGroup @@ -378,7 +378,7 @@ cdef class InnerGroup: frobenius power = 1 and partition = 0 -> 0 1 -> 1 2 -> 2 3 -> 3 4 -> 4 5 -> 5 6 -> 6 7 -> 7 8 -> 8 9 -> 9 """ - return "Subgroup of (GL(k,q) times \GF{q}^n ) rtimes Aut(\GF{q}) " + \ + return r"Subgroup of (GL(k,q) times \GF{q}^n ) rtimes Aut(\GF{q}) " + \ "with rank = %s, frobenius power = %s and partition =%s" % (self.rank, self.frob_pow, OP_string(self.row_partition)) @@ -741,7 +741,7 @@ cdef class PartitionRefinementLinearCode(PartitionRefinement_generic): return self._inner_group_stabilizer_order cdef _init_point_hyperplane_incidence(self): - """ + r""" Compute a set of codewords `W` of `C` (generated by self) which is compatible with the group action, i.e. if we start with some other code `(g,\pi)C` the result should be `(g,\pi)W`. diff --git a/src/sage/graphs/distances_all_pairs.pyx b/src/sage/graphs/distances_all_pairs.pyx index 2b4955737dc..f33c9beebd2 100644 --- a/src/sage/graphs/distances_all_pairs.pyx +++ b/src/sage/graphs/distances_all_pairs.pyx @@ -2079,7 +2079,7 @@ def wiener_index(G): ################ cdef uint64_t c_szeged_index_low_memory(short_digraph sd): - """ + r""" Return the Szeged index of the graph. Let `G = (V, E)` be a connected simple graph, and for any `uv\in E`, let @@ -2185,8 +2185,9 @@ cdef uint64_t c_szeged_index_low_memory(short_digraph sd): return s + cdef uint64_t c_szeged_index_high_memory(short_digraph sd): - """ + r""" Return the Szeged index of the graph. Let `G = (V, E)` be a connected graph, and for any `uv\in E`, let `N_u(uv) = diff --git a/src/sage/graphs/graph_decompositions/vertex_separation.pyx b/src/sage/graphs/graph_decompositions/vertex_separation.pyx index 07ed7855558..9b0e2431045 100644 --- a/src/sage/graphs/graph_decompositions/vertex_separation.pyx +++ b/src/sage/graphs/graph_decompositions/vertex_separation.pyx @@ -475,7 +475,7 @@ def linear_ordering_to_path_decomposition(G, L): def pathwidth(self, k=None, certificate=False, algorithm="BAB", verbose=False, max_prefix_length=20, max_prefix_number=10**6): - """ + r""" Compute the pathwidth of ``self`` (and provides a decomposition) INPUT: diff --git a/src/sage/graphs/matchpoly.pyx b/src/sage/graphs/matchpoly.pyx index 36c6c8fb2c4..444d99ebee3 100644 --- a/src/sage/graphs/matchpoly.pyx +++ b/src/sage/graphs/matchpoly.pyx @@ -50,7 +50,7 @@ x = polygen(ZZ, 'x') def matching_polynomial(G, complement=True, name=None): - """ + r""" Computes the matching polynomial of the graph `G`. If `p(G, k)` denotes the number of `k`-matchings (matchings with `k` edges) diff --git a/src/sage/groups/perm_gps/partn_ref/data_structures.pyx b/src/sage/groups/perm_gps/partn_ref/data_structures.pyx index 90995722d64..74065fe1fec 100644 --- a/src/sage/groups/perm_gps/partn_ref/data_structures.pyx +++ b/src/sage/groups/perm_gps/partn_ref/data_structures.pyx @@ -828,11 +828,12 @@ cdef SC_print_level(StabilizerChain *SC, int level): print('| labels {}'.format([SC.labels [level][i] for i from 0 <= i < n])) print('|') print('| generators {}'.format([[SC.generators [level][n*i + j] for j from 0 <= j < n] for i from 0 <= i < SC.num_gens[level]])) - print('\ inverses {}'.format([[SC.gen_inverses[level][n*i + j] for j from 0 <= j < n] for i from 0 <= i < SC.num_gens[level]])) + print(r'\ inverses {}'.format([[SC.gen_inverses[level][n*i + j] for j from 0 <= j < n] for i from 0 <= i < SC.num_gens[level]])) else: print('/ level {}'.format(level)) print('|') - print('\ base_size {}'.format(SC.base_size)) + print(r'\ base_size {}'.format(SC.base_size)) + cdef StabilizerChain *SC_new_base(StabilizerChain *SC, int *base, int base_len): """ diff --git a/src/sage/groups/perm_gps/partn_ref/refinement_binary.pyx b/src/sage/groups/perm_gps/partn_ref/refinement_binary.pyx index 5f54d4f8ac2..f13fccf891a 100644 --- a/src/sage/groups/perm_gps/partn_ref/refinement_binary.pyx +++ b/src/sage/groups/perm_gps/partn_ref/refinement_binary.pyx @@ -607,7 +607,7 @@ cdef int ith_word_nonlinear(BinaryCodeStruct self, int i, bitset_s *word): return 0 cdef int refine_by_bip_degree(PartitionStack *col_ps, void *S, int *cells_to_refine_by, int ctrb_len): - """ + r""" Refines the input partition by checking degrees of vertices to the given cells in the associated bipartite graph (vertices split into columns and words). @@ -731,11 +731,14 @@ cdef int refine_by_bip_degree(PartitionStack *col_ps, void *S, int *cells_to_ref return invariant cdef int compare_linear_codes(int *gamma_1, int *gamma_2, void *S1, void *S2, int degree): - """ + r""" Compare gamma_1(S1) and gamma_2(S2). - Return return -1 if gamma_1(S1) < gamma_2(S2), 0 if gamma_1(S1) == gamma_2(S2), - 1 if gamma_1(S1) > gamma_2(S2). (Just like the python \code{cmp}) function. + This returns: + + - -1 if gamma_1(S1) < gamma_2(S2), + - 0 if gamma_1(S1) == gamma_2(S2), + - 1 if gamma_1(S1) > gamma_2(S2). Abstractly, what this function does is relabel the basis of B by gamma_1 and gamma_2, run a row reduction on each, and verify that the matrices are the @@ -745,9 +748,9 @@ cdef int compare_linear_codes(int *gamma_1, int *gamma_2, void *S1, void *S2, in code has a 1 in the entry in which they differ is reported as larger. INPUT: - gamma_1, gamma_2 -- list permutations (inverse) - S1, S2 -- binary code struct objects + - gamma_1, gamma_2 -- list permutations (inverse) + - S1, S2 -- binary code struct objects """ cdef int i, piv_loc_1, piv_loc_2, cur_col, cur_row=0 cdef bint is_pivot_1, is_pivot_2 @@ -804,16 +807,19 @@ cdef int compare_linear_codes(int *gamma_1, int *gamma_2, void *S1, void *S2, in return 0 cdef int compare_nonlinear_codes(int *gamma_1, int *gamma_2, void *S1, void *S2, int degree): - """ + r""" Compare gamma_1(S1) and gamma_2(S2). - Return return -1 if gamma_1(S1) < gamma_2(S2), 0 if gamma_1(S1) == gamma_2(S2), - 1 if gamma_1(S1) > gamma_2(S2). (Just like the python \code{cmp}) function. + This returns: + + - -1 if gamma_1(S1) < gamma_2(S2), + - 0 if gamma_1(S1) == gamma_2(S2), + - 1 if gamma_1(S1) > gamma_2(S2). INPUT: - gamma_1, gamma_2 -- list permutations (inverse) - S1, S2 -- a binary code struct object + - gamma_1, gamma_2 -- list permutations (inverse) + - S1, S2 -- a binary code struct object """ cdef int side=0, i, start, end, n_one_1, n_one_2, cur_col cdef int where_0, where_1 diff --git a/src/sage/groups/perm_gps/partn_ref2/refinement_generic.pyx b/src/sage/groups/perm_gps/partn_ref2/refinement_generic.pyx index 2fcb0363a8b..71e6c1fc94d 100644 --- a/src/sage/groups/perm_gps/partn_ref2/refinement_generic.pyx +++ b/src/sage/groups/perm_gps/partn_ref2/refinement_generic.pyx @@ -913,7 +913,7 @@ cdef class PartitionRefinement_generic: "\\begin{tikzpicture}\n" + "\\tikzset{level distance=3cm, edge from parent/.style=" + "{draw, edge from parent path={(\\tikzparentnode.south) -- (\\tikzchildnode.north)}}}\n" + - "\Tree") + "\\Tree") self._latex_debug_string += "[." self._latex_act_node() diff --git a/src/sage/groups/perm_gps/permgroup_element.pyx b/src/sage/groups/perm_gps/permgroup_element.pyx index 037884f55da..99cf04054cf 100644 --- a/src/sage/groups/perm_gps/permgroup_element.pyx +++ b/src/sage/groups/perm_gps/permgroup_element.pyx @@ -1175,7 +1175,7 @@ cdef class PermutationGroupElement(MultiplicativeGroupElement): return result cpdef _act_on_(self, x, bint self_on_left): - """ + r""" Return the result of the action of ``self`` on ``x``. For example, if ``x=f(z)`` is a polynomial, then this function returns @@ -1619,7 +1619,7 @@ cdef class PermutationGroupElement(MultiplicativeGroupElement): return ~self def sign(self): - """ + r""" Returns the sign of self, which is `(-1)^{s}`, where `s` is the number of swaps. @@ -1857,12 +1857,12 @@ cdef class PermutationGroupElement(MultiplicativeGroupElement): return _Partitions(cycle_type) def has_descent(self, i, side = "right", positive = False): - """ + r""" INPUT: - - ``i``: an element of the index set - - ``side``: "left" or "right" (default: "right") - - ``positive``: a boolean (default: False) + - ``i`` -- an element of the index set + - ``side`` -- "left" or "right" (default: "right") + - ``positive`` -- a boolean (default: False) Returns whether ``self`` has a left (resp. right) descent at position ``i``. If ``positive`` is True, then test for a non