sagemath/sagemath-escape.patch
Jerry James bf7a318833 Version 9.7
Drop upstreamed patches: -infinite-recursion, -use-after-free, -sphinx
2023-01-17 08:43:14 -07:00

896 lines
38 KiB
Diff

diff -up src/sage/graphs/strongly_regular_db.pyx.orig src/sage/graphs/strongly_regular_db.pyx
--- src/sage/graphs/strongly_regular_db.pyx.orig 2022-09-19 16:38:18.000000000 -0600
+++ src/sage/graphs/strongly_regular_db.pyx 2023-01-15 16:25:07.239217420 -0700
@@ -2424,7 +2424,7 @@ def strongly_regular_from_two_intersecti
A set of points in the projective geometry `PG(k,q)` is said to be a
2-intersection set if it intersects every hyperplane in either `h_1` or
- `h_2` points, where `h_1,h_2\in \\NN`.
+ `h_2` points, where `h_1,h_2\in \NN`.
From a 2-intersection set `S` can be defined a strongly-regular graph in the
following way:
diff -up src/sage/groups/group.pyx.orig src/sage/groups/group.pyx
--- src/sage/groups/group.pyx.orig 2022-09-19 16:38:18.000000000 -0600
+++ src/sage/groups/group.pyx 2023-01-15 16:25:07.239217420 -0700
@@ -51,7 +51,7 @@ def is_Group(x):
cdef class Group(Parent):
- """
+ r"""
Base class for all groups
TESTS::
diff -up src/sage/groups/perm_gps/partn_ref/refinement_binary.pyx.orig src/sage/groups/perm_gps/partn_ref/refinement_binary.pyx
--- src/sage/groups/perm_gps/partn_ref/refinement_binary.pyx.orig 2022-09-19 16:38:18.000000000 -0600
+++ src/sage/groups/perm_gps/partn_ref/refinement_binary.pyx 2023-01-15 16:25:08.856187835 -0700
@@ -105,7 +105,7 @@ cdef class LinearBinaryCodeStruct(Binary
self.ith_word = &ith_word_linear
def run(self, partition=None):
- """
+ r"""
Perform the canonical labeling and automorphism group computation,
storing results to self.
diff -up src/sage/libs/eclib/newforms.pyx.orig src/sage/libs/eclib/newforms.pyx
--- src/sage/libs/eclib/newforms.pyx.orig 2022-09-19 16:38:18.000000000 -0600
+++ src/sage/libs/eclib/newforms.pyx 2023-01-15 16:25:10.727153601 -0700
@@ -22,7 +22,7 @@ from sage.modular.all import Cusp
cdef class ECModularSymbol:
- """
+ r"""
Modular symbol associated with an elliptic curve, using John Cremona's newforms class.
EXAMPLES::
diff -up src/sage/libs/fes.pyx.orig src/sage/libs/fes.pyx
--- src/sage/libs/fes.pyx.orig 2022-09-19 16:38:18.000000000 -0600
+++ src/sage/libs/fes.pyx 2023-01-15 16:25:10.727153601 -0700
@@ -292,7 +292,7 @@ def find_coordinate_change(As, max_tries
def prepare_polynomials(f):
- """
+ r"""
Finds a linear combination of the equations that is faster to solve by FES
INPUT:
diff -up src/sage/libs/ntl/ntl_GF2E.pyx.orig src/sage/libs/ntl/ntl_GF2E.pyx
--- src/sage/libs/ntl/ntl_GF2E.pyx.orig 2022-09-19 16:38:18.000000000 -0600
+++ src/sage/libs/ntl/ntl_GF2E.pyx 2023-01-15 16:25:10.727153601 -0700
@@ -73,7 +73,7 @@ def ntl_GF2E_random(ntl_GF2EContext_clas
cdef class ntl_GF2E():
r"""
- The \\class{GF2E} represents a finite extension field over GF(2)
+ The \class{GF2E} represents a finite extension field over GF(2)
using NTL. Elements are represented as polynomials over GF(2)
modulo a modulus.
@@ -439,7 +439,7 @@ cdef class ntl_GF2E():
return l
def _sage_(ntl_GF2E self, k=None):
- """
+ r"""
Returns a \class{FiniteFieldElement} representation
of this element. If a \class{FiniteField} k is provided
it is constructed in this field if possible. A \class{FiniteField}
diff -up src/sage/libs/ntl/ntl_mat_GF2E.pyx.orig src/sage/libs/ntl/ntl_mat_GF2E.pyx
--- src/sage/libs/ntl/ntl_mat_GF2E.pyx.orig 2022-09-19 16:38:18.000000000 -0600
+++ src/sage/libs/ntl/ntl_mat_GF2E.pyx 2023-01-15 16:25:10.728153583 -0700
@@ -181,7 +181,7 @@ cdef class ntl_mat_GF2E():
return unpickle_class_args, (ntl_mat_GF2E, (self.modulus_context(), self.x.NumRows(), self.x.NumCols(), self.list()))
def __repr__(self):
- """
+ r"""
Return the string representation of self.
EXAMPLES::
@@ -446,7 +446,7 @@ cdef class ntl_mat_GF2E():
return r
def gauss(self,ncols=-1):
- """
+ r"""
Performs unitary row operations so as to bring this matrix
into row echelon form. If the optional argument \code{ncols}
is supplied, stops when first ncols columns are in echelon
diff -up src/sage/libs/ntl/ntl_mat_GF2.pyx.orig src/sage/libs/ntl/ntl_mat_GF2.pyx
--- src/sage/libs/ntl/ntl_mat_GF2.pyx.orig 2022-09-19 16:38:18.000000000 -0600
+++ src/sage/libs/ntl/ntl_mat_GF2.pyx 2023-01-15 16:33:39.175760142 -0700
@@ -5,7 +5,7 @@
# distutils: extra_link_args = NTL_LIBEXTRA
# distutils: language = c++
-"""
+r"""
Matrices over the `\GF{2}` via NTL
This class is only provided to have a complete NTL interface and for
@@ -376,7 +376,7 @@ cdef class ntl_mat_GF2():
return r
def gauss(self,ncols=-1):
- """
+ r"""
Performs unitary row operations so as to bring this matrix
into row echelon form (not reduced!). If the optional
argument \code{ncols} is supplied, stops when first ncols
diff -up src/sage/libs/ntl/ntl_mat_ZZ.pyx.orig src/sage/libs/ntl/ntl_mat_ZZ.pyx
--- src/sage/libs/ntl/ntl_mat_ZZ.pyx.orig 2022-09-19 16:38:18.000000000 -0600
+++ src/sage/libs/ntl/ntl_mat_ZZ.pyx 2023-01-15 16:25:10.728153583 -0700
@@ -129,7 +129,7 @@ cdef class ntl_mat_ZZ():
return unpickle_class_args, (ntl_mat_ZZ, (self.__nrows, self.__ncols, self.list()))
def __repr__(self):
- """
+ r"""
Return the string representation of self.
EXAMPLES::
diff -up src/sage/libs/ntl/ntl_ZZ_pEX.pyx.orig src/sage/libs/ntl/ntl_ZZ_pEX.pyx
--- src/sage/libs/ntl/ntl_ZZ_pEX.pyx.orig 2022-09-19 16:38:18.000000000 -0600
+++ src/sage/libs/ntl/ntl_ZZ_pEX.pyx 2023-01-15 17:03:36.337323674 -0700
@@ -5,7 +5,7 @@
# distutils: extra_link_args = NTL_LIBEXTRA
# distutils: language = c++
-"""
+r"""
Wrapper for NTL's polynomials over finite ring extensions of `\Z / p\Z.`
AUTHORS:
diff -up src/sage/libs/ntl/ntl_ZZX.pyx.orig src/sage/libs/ntl/ntl_ZZX.pyx
--- src/sage/libs/ntl/ntl_ZZX.pyx.orig 2022-09-19 16:38:18.000000000 -0600
+++ src/sage/libs/ntl/ntl_ZZX.pyx 2023-01-15 16:25:10.729153564 -0700
@@ -692,7 +692,7 @@ cdef class ntl_ZZX():
return (self*other).quo_rem(g)[0]
def xgcd(self, ntl_ZZX other, proof=None):
- """
+ r"""
If self and other are coprime over the rationals, return r, s,
t such that r = s*self + t*other. Otherwise return 0. This
is \emph{not} the same as the \sage function on polynomials
diff -up src/sage/libs/singular/polynomial.pyx.orig src/sage/libs/singular/polynomial.pyx
--- src/sage/libs/singular/polynomial.pyx.orig 2022-09-19 16:38:18.000000000 -0600
+++ src/sage/libs/singular/polynomial.pyx 2023-01-15 16:25:10.729153564 -0700
@@ -22,7 +22,7 @@ cdef extern from *: # hack to get at cyt
int unlikely(int)
import re
-plusminus_pattern = re.compile("([^\(^])([\+\-])")
+plusminus_pattern = re.compile(r"([^\(^])([\+\-])")
parenthvar_pattern = re.compile(r"\(([a-zA-Z][a-zA-Z0-9]*)\)")
from sage.cpython.string cimport bytes_to_str, str_to_bytes
diff -up src/sage/libs/symmetrica/sc.pxi.orig src/sage/libs/symmetrica/sc.pxi
--- src/sage/libs/symmetrica/sc.pxi.orig 2022-09-19 16:38:18.000000000 -0600
+++ src/sage/libs/symmetrica/sc.pxi 2023-01-15 16:25:10.729153564 -0700
@@ -103,7 +103,7 @@ def charvalue_symmetrica(irred, cls, tab
def kranztafel_symmetrica(a, b):
- """
+ r"""
you enter the INTEGER objects, say a and b, and res becomes a
MATRIX object, the charactertable of S_b \wr S_a, co becomes a
VECTOR object of classorders and cl becomes a VECTOR object of
diff -up src/sage/matrix/matrix_integer_dense.pyx.orig src/sage/matrix/matrix_integer_dense.pyx
--- src/sage/matrix/matrix_integer_dense.pyx.orig 2022-09-19 16:38:19.000000000 -0600
+++ src/sage/matrix/matrix_integer_dense.pyx 2023-01-15 16:25:13.768097961 -0700
@@ -757,7 +757,7 @@ cdef class Matrix_integer_dense(Matrix_d
return ans
def _multiply_classical(self, Matrix_integer_dense right):
- """
+ r"""
EXAMPLES::
sage: n = 3
diff -up src/sage/matrix/matrix_modn_dense_template.pxi.orig src/sage/matrix/matrix_modn_dense_template.pxi
--- src/sage/matrix/matrix_modn_dense_template.pxi.orig 2022-09-19 16:38:19.000000000 -0600
+++ src/sage/matrix/matrix_modn_dense_template.pxi 2023-01-15 16:25:13.768097961 -0700
@@ -649,7 +649,7 @@ cdef class Matrix_modn_dense_template(Ma
return (word_size, little_endian, s), 10
def _unpickle(self, data, int version):
- """
+ r"""
TESTS:
Test for char-sized modulus::
@@ -2261,7 +2261,7 @@ cdef class Matrix_modn_dense_template(Ma
return Matrix_dense.determinant(self)
cdef xgcd_eliminate(self, celement * row1, celement* row2, Py_ssize_t start_col):
- """
+ r"""
Reduces ``row1`` and ``row2`` by a unimodular transformation
using the xgcd relation between their first coefficients ``a`` and
``b``.
diff -up src/sage/matroids/basis_exchange_matroid.pyx.orig src/sage/matroids/basis_exchange_matroid.pyx
--- src/sage/matroids/basis_exchange_matroid.pyx.orig 2022-09-19 16:38:19.000000000 -0600
+++ src/sage/matroids/basis_exchange_matroid.pyx 2023-01-15 16:25:13.770097924 -0700
@@ -2115,7 +2115,7 @@ cdef class BasisExchangeMatroid(Matroid)
return EQ[0]
cpdef _is_isomorphism(self, other, morphism):
- """
+ r"""
Version of is_isomorphism() that does no type checking.
INPUT:
diff -up src/sage/matroids/linear_matroid.pyx.orig src/sage/matroids/linear_matroid.pyx
--- src/sage/matroids/linear_matroid.pyx.orig 2022-09-19 16:38:19.000000000 -0600
+++ src/sage/matroids/linear_matroid.pyx 2023-01-15 16:25:13.771097906 -0700
@@ -800,7 +800,7 @@ cdef class LinearMatroid(BasisExchangeMa
# (field) isomorphism
cpdef bint _is_field_isomorphism(self, LinearMatroid other, morphism): # not safe if self == other
- """
+ r"""
Version of :meth:`<LinearMatroid.is_field_isomorphism>` that does no
type checking.
@@ -966,7 +966,7 @@ cdef class LinearMatroid(BasisExchangeMa
return self._is_field_isomorphism(other, morphism)
cpdef is_field_isomorphism(self, other, morphism):
- """
+ r"""
Test if a provided morphism induces a bijection between represented
matroids.
diff -up src/sage/matroids/matroid.pyx.orig src/sage/matroids/matroid.pyx
--- src/sage/matroids/matroid.pyx.orig 2022-09-19 16:38:19.000000000 -0600
+++ src/sage/matroids/matroid.pyx 2023-01-15 16:25:13.772097888 -0700
@@ -3150,7 +3150,7 @@ cdef class Matroid(SageObject):
return Polyhedron(vertices)
def independence_matroid_polytope(self):
- """
+ r"""
Return the independence matroid polytope of ``self``.
This is defined as the convex hull of the vertices
@@ -3430,7 +3430,7 @@ cdef class Matroid(SageObject):
return self._is_isomorphism(other, morphism)
cpdef is_isomorphism(self, other, morphism):
- """
+ r"""
Test if a provided morphism induces a matroid isomorphism.
A *morphism* is a map from the groundset of ``self`` to the groundset
@@ -3553,7 +3553,7 @@ cdef class Matroid(SageObject):
return self._is_isomorphism(other, mf)
cpdef _is_isomorphism(self, other, morphism):
- """
+ r"""
Version of is_isomorphism() that does no type checking.
INPUT:
@@ -4313,7 +4313,7 @@ cdef class Matroid(SageObject):
return self.dual().extension(element, subsets).dual()
cpdef modular_cut(self, subsets):
- """
+ r"""
Compute the modular cut generated by ``subsets``.
A *modular cut* is a collection `C` of flats such that
@@ -4714,7 +4714,7 @@ cdef class Matroid(SageObject):
return True
cpdef is_cosimple(self):
- """
+ r"""
Test if the matroid is cosimple.
A matroid is *cosimple* if it contains no cocircuits of length 1 or 2.
@@ -7480,7 +7480,7 @@ cdef class Matroid(SageObject):
return A
cpdef tutte_polynomial(self, x=None, y=None):
- """
+ r"""
Return the Tutte polynomial of the matroid.
The *Tutte polynomial* of a matroid is the polynomial
diff -up src/sage/misc/cachefunc.pyx.orig src/sage/misc/cachefunc.pyx
--- src/sage/misc/cachefunc.pyx.orig 2022-09-19 16:38:19.000000000 -0600
+++ src/sage/misc/cachefunc.pyx 2023-01-15 16:25:13.772097888 -0700
@@ -834,7 +834,7 @@ cdef class CachedFunction():
## forward other questions to the cached function.
def _instancedoc_(self):
- """
+ r"""
Provide documentation for the cached function.
A cached function shall inherit the documentation
diff -up src/sage/misc/sageinspect.py.orig src/sage/misc/sageinspect.py
--- src/sage/misc/sageinspect.py.orig 2022-09-19 16:38:19.000000000 -0600
+++ src/sage/misc/sageinspect.py 2023-01-15 16:40:43.609846146 -0700
@@ -948,7 +948,7 @@ def _grep_first_pair_of_parentheses(s):
def _split_syntactical_unit(s):
- """
+ r"""
Split off a sub-expression from the start of a given string.
INPUT:
diff -up src/sage/modules/free_module_element.pyx.orig src/sage/modules/free_module_element.pyx
--- src/sage/modules/free_module_element.pyx.orig 2022-09-19 16:38:19.000000000 -0600
+++ src/sage/modules/free_module_element.pyx 2023-01-15 16:25:19.760988310 -0700
@@ -3743,7 +3743,7 @@ cdef class FreeModuleElement(Vector):
from sage.misc.latex import latex
vector_delimiters = latex.vector_delimiters()
s = '\\left' + vector_delimiters[0]
- s += ',\,'.join(latex(a) for a in self.list())
+ s += ',\\,'.join(latex(a) for a in self.list())
return s + '\\right' + vector_delimiters[1]
def dense_vector(self):
diff -up src/sage/numerical/backends/generic_backend.pyx.orig src/sage/numerical/backends/generic_backend.pyx
--- src/sage/numerical/backends/generic_backend.pyx.orig 2022-09-19 16:38:19.000000000 -0600
+++ src/sage/numerical/backends/generic_backend.pyx 2023-01-15 16:25:19.761988291 -0700
@@ -1384,7 +1384,7 @@ cdef class GenericBackend:
raise NotImplementedError()
cpdef bint is_variable_basic(self, int index):
- """
+ r"""
Test whether the given variable is basic.
This assumes that the problem has been solved with the simplex method
@@ -1414,7 +1414,7 @@ cdef class GenericBackend:
raise NotImplementedError()
cpdef bint is_variable_nonbasic_at_lower_bound(self, int index):
- """
+ r"""
Test whether the given variable is nonbasic at lower bound.
This assumes that the problem has been solved with the simplex method
@@ -1444,7 +1444,7 @@ cdef class GenericBackend:
raise NotImplementedError()
cpdef bint is_slack_variable_basic(self, int index):
- """
+ r"""
Test whether the slack variable of the given row is basic.
This assumes that the problem has been solved with the simplex method
@@ -1474,7 +1474,7 @@ cdef class GenericBackend:
raise NotImplementedError()
cpdef bint is_slack_variable_nonbasic_at_lower_bound(self, int index):
- """
+ r"""
Test whether the given variable is nonbasic at lower bound.
This assumes that the problem has been solved with the simplex method
diff -up src/sage/numerical/backends/glpk_backend.pyx.orig src/sage/numerical/backends/glpk_backend.pyx
--- src/sage/numerical/backends/glpk_backend.pyx.orig 2022-09-19 16:38:19.000000000 -0600
+++ src/sage/numerical/backends/glpk_backend.pyx 2023-01-15 16:25:19.762988273 -0700
@@ -2316,7 +2316,7 @@ cdef class GLPKBackend(GenericBackend):
raise ValueError("This parameter is not available.")
cpdef bint is_variable_basic(self, int index):
- """
+ r"""
Test whether the given variable is basic.
This assumes that the problem has been solved with the simplex method
@@ -2347,7 +2347,7 @@ cdef class GLPKBackend(GenericBackend):
return self.get_col_stat(index) == GLP_BS
cpdef bint is_variable_nonbasic_at_lower_bound(self, int index):
- """
+ r"""
Test whether the given variable is nonbasic at lower bound.
This assumes that the problem has been solved with the simplex method
and a basis is available. Otherwise an exception will be raised.
@@ -2377,7 +2377,7 @@ cdef class GLPKBackend(GenericBackend):
return self.get_col_stat(index) == GLP_NL
cpdef bint is_slack_variable_basic(self, int index):
- """
+ r"""
Test whether the slack variable of the given row is basic.
This assumes that the problem has been solved with the simplex method
@@ -2408,7 +2408,7 @@ cdef class GLPKBackend(GenericBackend):
return self.get_row_stat(index) == GLP_BS
cpdef bint is_slack_variable_nonbasic_at_lower_bound(self, int index):
- """
+ r"""
Test whether the slack variable of the given row is nonbasic at lower bound.
This assumes that the problem has been solved with the simplex method
diff -up src/sage/numerical/backends/interactivelp_backend.pyx.orig src/sage/numerical/backends/interactivelp_backend.pyx
--- src/sage/numerical/backends/interactivelp_backend.pyx.orig 2022-09-19 16:38:19.000000000 -0600
+++ src/sage/numerical/backends/interactivelp_backend.pyx 2023-01-15 16:25:19.763988255 -0700
@@ -1065,7 +1065,7 @@ cdef class InteractiveLPBackend:
problem_type, ring, objective_constant_term=d)
cpdef bint is_variable_basic(self, int index):
- """
+ r"""
Test whether the given variable is basic.
This assumes that the problem has been solved with the simplex method
@@ -1095,7 +1095,7 @@ cdef class InteractiveLPBackend:
return self.lp_std_form.decision_variables()[index] in self.final_dictionary.basic_variables()
cpdef bint is_variable_nonbasic_at_lower_bound(self, int index):
- """
+ r"""
Test whether the given variable is nonbasic at lower bound.
This assumes that the problem has been solved with the simplex method
@@ -1125,7 +1125,7 @@ cdef class InteractiveLPBackend:
return self.lp_std_form.decision_variables()[index] in self.final_dictionary.nonbasic_variables()
cpdef bint is_slack_variable_basic(self, int index):
- """
+ r"""
Test whether the slack variable of the given row is basic.
This assumes that the problem has been solved with the simplex method
@@ -1155,7 +1155,7 @@ cdef class InteractiveLPBackend:
return self.lp_std_form.slack_variables()[index] in self.final_dictionary.basic_variables()
cpdef bint is_slack_variable_nonbasic_at_lower_bound(self, int index):
- """
+ r"""
Test whether the given variable is nonbasic at lower bound.
This assumes that the problem has been solved with the simplex method
@@ -1187,7 +1187,7 @@ cdef class InteractiveLPBackend:
cpdef dictionary(self):
# Proposed addition to the general interface,
# which would for other solvers return backend dictionaries (#18804)
- """
+ r"""
Return a dictionary representing the current basis.
EXAMPLES::
@@ -1222,7 +1222,7 @@ cdef class InteractiveLPBackend:
cpdef interactive_lp_problem(self):
- """
+ r"""
Return the :class:`InteractiveLPProblem` object associated with this backend.
EXAMPLES::
diff -up src/sage/rings/complex_interval.pyx.orig src/sage/rings/complex_interval.pyx
--- src/sage/rings/complex_interval.pyx.orig 2022-09-19 16:38:19.000000000 -0600
+++ src/sage/rings/complex_interval.pyx 2023-01-15 16:44:08.256030310 -0700
@@ -1114,7 +1114,7 @@ cdef class ComplexIntervalFieldElement(s
return x
def __invert__(self):
- """
+ r"""
Return the multiplicative inverse of ``self``.
EXAMPLES::
diff -up src/sage/rings/complex_mpc.pyx.orig src/sage/rings/complex_mpc.pyx
--- src/sage/rings/complex_mpc.pyx.orig 2022-09-19 16:38:19.000000000 -0600
+++ src/sage/rings/complex_mpc.pyx 2023-01-15 16:25:22.175944120 -0700
@@ -137,15 +137,15 @@ cdef inline mpfr_rnd_t rnd_im(mpc_rnd_t
sign = '[+-]'
digit_ten = '[0123456789]'
exponent_ten = '[e@]' + sign + '?[0123456789]+'
-number_ten = 'inf(?:inity)?|@inf@|nan(?:\([0-9A-Z_]*\))?|@nan@(?:\([0-9A-Z_]*\))?'\
- '|(?:' + digit_ten + '*\.' + digit_ten + '+|' + digit_ten + '+\.?)(?:' + exponent_ten + ')?'
-imaginary_ten = 'i(?:\s*\*\s*(?:' + number_ten + '))?|(?:' + number_ten + ')\s*\*\s*i'
-complex_ten = '(?P<im_first>(?P<im_first_im_sign>' + sign + ')?\s*(?P<im_first_im_abs>' + imaginary_ten + ')' \
- '(\s*(?P<im_first_re_sign>' + sign + ')\s*(?P<im_first_re_abs>' + number_ten + '))?)' \
+number_ten = r'inf(?:inity)?|@inf@|nan(?:\([0-9A-Z_]*\))?|@nan@(?:\([0-9A-Z_]*\))?'\
+ '|(?:' + digit_ten + r'*\.' + digit_ten + '+|' + digit_ten + r'+\.?)(?:' + exponent_ten + ')?'
+imaginary_ten = r'i(?:\s*\*\s*(?:' + number_ten + '))?|(?:' + number_ten + r')\s*\*\s*i'
+complex_ten = '(?P<im_first>(?P<im_first_im_sign>' + sign + r')?\s*(?P<im_first_im_abs>' + imaginary_ten + ')' \
+ r'(\s*(?P<im_first_re_sign>' + sign + r')\s*(?P<im_first_re_abs>' + number_ten + '))?)' \
'|' \
- '(?P<re_first>(?P<re_first_re_sign>' + sign + ')?\s*(?P<re_first_re_abs>' + number_ten + ')' \
- '(\s*(?P<re_first_im_sign>' + sign + ')\s*(?P<re_first_im_abs>' + imaginary_ten + '))?)'
-re_complex_ten = re.compile('^\s*(?:' + complex_ten + ')\s*$', re.I)
+ '(?P<re_first>(?P<re_first_re_sign>' + sign + r')?\s*(?P<re_first_re_abs>' + number_ten + ')' \
+ r'(\s*(?P<re_first_im_sign>' + sign + r')\s*(?P<re_first_im_abs>' + imaginary_ten + '))?)'
+re_complex_ten = re.compile(r'^\s*(?:' + complex_ten + r')\s*$', re.I)
cpdef inline split_complex_string(string, int base=10):
"""
@@ -185,17 +185,17 @@ cpdef inline split_complex_string(string
# Warning: number, imaginary, and complex should be enclosed in parentheses
# when used as regexp because of alternatives '|'
- number = '@nan@(?:\([0-9A-Z_]*\))?|@inf@|(?:' + digit + '*\.' + digit + '+|' + digit + '+\.?)(?:' + exponent + ')?'
+ number = r'@nan@(?:\([0-9A-Z_]*\))?|@inf@|(?:' + digit + r'*\.' + digit + '+|' + digit + r'+\.?)(?:' + exponent + ')?'
if base <= 10:
- number = 'nan(?:\([0-9A-Z_]*\))?|inf(?:inity)?|' + number
- imaginary = 'i(?:\s*\*\s*(?:' + number + '))?|(?:' + number + ')\s*\*\s*i'
- complex = '(?P<im_first>(?P<im_first_im_sign>' + sign + ')?\s*(?P<im_first_im_abs>' + imaginary + ')' \
- '(\s*(?P<im_first_re_sign>' + sign + ')\s*(?P<im_first_re_abs>' + number + '))?)' \
+ number = r'nan(?:\([0-9A-Z_]*\))?|inf(?:inity)?|' + number
+ imaginary = r'i(?:\s*\*\s*(?:' + number + '))?|(?:' + number + r')\s*\*\s*i'
+ complex = '(?P<im_first>(?P<im_first_im_sign>' + sign + r')?\s*(?P<im_first_im_abs>' + imaginary + ')' \
+ r'(\s*(?P<im_first_re_sign>' + sign + r')\s*(?P<im_first_re_abs>' + number + '))?)' \
'|' \
- '(?P<re_first>(?P<re_first_re_sign>' + sign + ')?\s*(?P<re_first_re_abs>' + number + ')' \
- '(\s*(?P<re_first_im_sign>' + sign + ')\s*(?P<re_first_im_abs>' + imaginary + '))?)'
+ '(?P<re_first>(?P<re_first_re_sign>' + sign + r')?\s*(?P<re_first_re_abs>' + number + ')' \
+ r'(\s*(?P<re_first_im_sign>' + sign + r')\s*(?P<re_first_im_abs>' + imaginary + '))?)'
- z = re.match('^\s*(?:' + complex + ')\s*$', string, re.I)
+ z = re.match(r'^\s*(?:' + complex + r')\s*$', string, re.I)
x, y = None, None
if z is not None:
@@ -207,18 +207,18 @@ cpdef inline split_complex_string(string
return None
if z.group(prefix + '_re_abs') is not None:
- x = z.expand('\g<' + prefix + '_re_abs>')
+ x = z.expand(r'\g<' + prefix + '_re_abs>')
if z.group(prefix + '_re_sign') is not None:
- x = z.expand('\g<' + prefix + '_re_sign>') + x
+ x = z.expand(r'\g<' + prefix + '_re_sign>') + x
if z.group(prefix + '_im_abs') is not None:
- y = re.search('(?P<im_part>' + number + ')', z.expand('\g<' + prefix + '_im_abs>'), re.I)
+ y = re.search('(?P<im_part>' + number + ')', z.expand(r'\g<' + prefix + '_im_abs>'), re.I)
if y is None:
y = '1'
else:
- y = y.expand('\g<im_part>')
+ y = y.expand(r'\g<im_part>')
if z.group(prefix + '_im_sign') is not None:
- y = z.expand('\g<' + prefix + '_im_sign>') + y
+ y = z.expand(r'\g<' + prefix + '_im_sign>') + y
return x, y
@@ -1701,7 +1701,7 @@ cdef class MPComplexNumber(sage.structur
return z
def cosh(self):
- """
+ r"""
Return the hyperbolic cosine of this complex number:
.. MATH::
@@ -1721,7 +1721,7 @@ cdef class MPComplexNumber(sage.structur
return z
def sinh(self):
- """
+ r"""
Return the hyperbolic sine of this complex number:
.. MATH::
@@ -2063,7 +2063,7 @@ cdef class MPComplexNumber(sage.structur
return z
def exp(self):
- """
+ r"""
Return the exponential of this complex number:
.. MATH::
diff -up src/sage/rings/finite_rings/hom_finite_field.pyx.orig src/sage/rings/finite_rings/hom_finite_field.pyx
--- src/sage/rings/finite_rings/hom_finite_field.pyx.orig 2022-09-19 16:38:19.000000000 -0600
+++ src/sage/rings/finite_rings/hom_finite_field.pyx 2023-01-15 16:25:22.175944120 -0700
@@ -147,7 +147,7 @@ cdef class SectionFiniteFieldHomomorphis
def _repr_(self):
- """
+ r"""
Return a string representation of this section.
EXAMPLES::
diff -up src/sage/rings/finite_rings/integer_mod.pyx.orig src/sage/rings/finite_rings/integer_mod.pyx
--- src/sage/rings/finite_rings/integer_mod.pyx.orig 2022-09-19 16:38:19.000000000 -0600
+++ src/sage/rings/finite_rings/integer_mod.pyx 2023-01-15 16:25:22.176944101 -0700
@@ -2245,7 +2245,7 @@ cdef class IntegerMod_gmp(IntegerMod_abs
return int(self.lift())
def __pow__(IntegerMod_gmp self, exp, m): # NOTE: m ignored, always use modulus of parent ring
- """
+ r"""
EXAMPLES::
sage: R = Integers(10^10)
@@ -3544,7 +3544,7 @@ cdef class IntegerMod_int64(IntegerMod_a
return self._new_c(self.ivalue >> (-k))
def __pow__(IntegerMod_int64 self, exp, m): # NOTE: m ignored, always use modulus of parent ring
- """
+ r"""
EXAMPLES::
sage: R = Integers(10)
diff -up src/sage/rings/number_field/number_field_element.pyx.orig src/sage/rings/number_field/number_field_element.pyx
--- src/sage/rings/number_field/number_field_element.pyx.orig 2022-09-19 16:38:19.000000000 -0600
+++ src/sage/rings/number_field/number_field_element.pyx 2023-01-15 16:25:22.176944101 -0700
@@ -493,7 +493,7 @@ cdef class NumberFieldElement(FieldEleme
return codomain(f(im_gens[0]))
def _latex_(self):
- """
+ r"""
Returns the latex representation for this element.
EXAMPLES::
diff -up src/sage/rings/number_field/number_field_morphisms.pyx.orig src/sage/rings/number_field/number_field_morphisms.pyx
--- src/sage/rings/number_field/number_field_morphisms.pyx.orig 2022-09-19 16:38:19.000000000 -0600
+++ src/sage/rings/number_field/number_field_morphisms.pyx 2023-01-15 16:25:22.176944101 -0700
@@ -340,7 +340,7 @@ cdef class EmbeddedNumberFieldConversion
cpdef matching_root(poly, target, ambient_field=None, margin=1, max_prec=None):
- """
+ r"""
Given a polynomial and a target, this function chooses the root that
target best approximates as compared in ambient_field.
@@ -403,7 +403,7 @@ cpdef matching_root(poly, target, ambien
cpdef closest(target, values, margin=1):
- """
+ r"""
This is a utility function that returns the item in values closest to
target (with respect to the \code{abs} function). If margin is greater
than 1, and x and y are the first and second closest elements to target,
diff -up src/sage/rings/padics/local_generic_element.pyx.orig src/sage/rings/padics/local_generic_element.pyx
--- src/sage/rings/padics/local_generic_element.pyx.orig 2022-09-19 16:38:19.000000000 -0600
+++ src/sage/rings/padics/local_generic_element.pyx 2023-01-15 16:25:22.177944083 -0700
@@ -408,7 +408,7 @@ cdef class LocalGenericElement(Commutati
return ans
def _latex_(self):
- """
+ r"""
Returns a latex representation of self.
EXAMPLES::
diff -up src/sage/rings/padics/padic_capped_absolute_element.pyx.orig src/sage/rings/padics/padic_capped_absolute_element.pyx
--- src/sage/rings/padics/padic_capped_absolute_element.pyx.orig 2022-09-19 16:38:19.000000000 -0600
+++ src/sage/rings/padics/padic_capped_absolute_element.pyx 2023-01-15 16:25:22.177944083 -0700
@@ -383,7 +383,7 @@ cdef class pAdicCappedAbsoluteElement(CA
return ans
def _exp_binary_splitting(self, aprec):
- """
+ r"""
Compute the exponential power series of this element
This is a helper method for :meth:`exp`.
@@ -443,7 +443,7 @@ cdef class pAdicCappedAbsoluteElement(CA
return ans
def _exp_newton(self, aprec, log_algorithm=None):
- """
+ r"""
Compute the exponential power series of this element
This is a helper method for :meth:`exp`.
diff -up src/sage/rings/padics/padic_fixed_mod_element.pyx.orig src/sage/rings/padics/padic_fixed_mod_element.pyx
--- src/sage/rings/padics/padic_fixed_mod_element.pyx.orig 2022-09-19 16:38:19.000000000 -0600
+++ src/sage/rings/padics/padic_fixed_mod_element.pyx 2023-01-15 16:25:22.177944083 -0700
@@ -449,7 +449,7 @@ cdef class pAdicFixedModElement(FMElemen
return ans
def _exp_binary_splitting(self, aprec):
- """
+ r"""
Compute the exponential power series of this element
This is a helper method for :meth:`exp`.
@@ -508,7 +508,7 @@ cdef class pAdicFixedModElement(FMElemen
return ans
def _exp_newton(self, aprec, log_algorithm=None):
- """
+ r"""
Compute the exponential power series of this element
This is a helper method for :meth:`exp`.
diff -up src/sage/rings/padics/padic_generic_element.pyx.orig src/sage/rings/padics/padic_generic_element.pyx
--- src/sage/rings/padics/padic_generic_element.pyx.orig 2022-09-19 16:38:19.000000000 -0600
+++ src/sage/rings/padics/padic_generic_element.pyx 2023-01-15 16:25:22.178944065 -0700
@@ -544,7 +544,7 @@ cdef class pAdicGenericElement(LocalGene
return self._repr_(mode=mode)
def _repr_(self, mode=None, do_latex=False):
- """
+ r"""
Returns a string representation of this element.
INPUT:
@@ -3028,7 +3028,7 @@ cdef class pAdicGenericElement(LocalGene
return series_unit*nfactorial_unit.inverse_of_unit()<<(series_val-nfactorial_val)
def _exp_binary_splitting(self, aprec):
- """
+ r"""
Compute the exponential power series of this element
This is a helper method for :meth:`exp`.
@@ -3074,7 +3074,7 @@ cdef class pAdicGenericElement(LocalGene
raise NotImplementedError("the binary splitting algorithm is not implemented for the parent: %s" % self.parent())
def _exp_newton(self, aprec, log_algorithm=None):
- """
+ r"""
Compute the exponential power series of this element
This is a helper method for :meth:`exp`.
diff -up src/sage/rings/polynomial/multi_polynomial_libsingular.pyx.orig src/sage/rings/polynomial/multi_polynomial_libsingular.pyx
--- src/sage/rings/polynomial/multi_polynomial_libsingular.pyx.orig 2022-09-19 16:38:19.000000000 -0600
+++ src/sage/rings/polynomial/multi_polynomial_libsingular.pyx 2023-01-15 16:25:22.179944047 -0700
@@ -2485,7 +2485,7 @@ cdef class MPolynomial_libsingular(MPoly
return char_to_str(s)
def _latex_(self):
- """
+ r"""
Return a polynomial LaTeX representation of this polynomial.
EXAMPLES::
diff -up src/sage/rings/polynomial/ore_polynomial_element.pyx.orig src/sage/rings/polynomial/ore_polynomial_element.pyx
--- src/sage/rings/polynomial/ore_polynomial_element.pyx.orig 2022-09-19 16:38:19.000000000 -0600
+++ src/sage/rings/polynomial/ore_polynomial_element.pyx 2023-01-15 16:25:22.179944047 -0700
@@ -1707,8 +1707,8 @@ cdef class OrePolynomial(AlgebraElement)
var = ""
s += "%s %s"%(x,var)
s = s.replace(" + -", " - ")
- s = re.sub(" 1(\.0+)? \|"," ", s)
- s = re.sub(" -1(\.0+)? \|", " -", s)
+ s = re.sub(r" 1(\.0+)? \|"," ", s)
+ s = re.sub(r" -1(\.0+)? \|", " -", s)
s = s.replace("|","")
if s == " ":
return "0"
diff -up src/sage/rings/polynomial/polynomial_element.pyx.orig src/sage/rings/polynomial/polynomial_element.pyx
--- src/sage/rings/polynomial/polynomial_element.pyx.orig 2022-09-19 16:38:19.000000000 -0600
+++ src/sage/rings/polynomial/polynomial_element.pyx 2023-01-15 16:25:22.181944010 -0700
@@ -2744,8 +2744,8 @@ cdef class Polynomial(CommutativeAlgebra
var = ""
s += "%s %s" % (x, var)
s = s.replace(" + -", " - ")
- s = re.sub(" 1(\.0+)? \|"," ", s)
- s = re.sub(" -1(\.0+)? \|", " -", s)
+ s = re.sub(r" 1(\.0+)? \|"," ", s)
+ s = re.sub(r" -1(\.0+)? \|", " -", s)
s = s.replace("|","")
if s == " ":
return "0"
@@ -2845,7 +2845,7 @@ cdef class Polynomial(CommutativeAlgebra
raise IndexError("polynomials are immutable")
cpdef _floordiv_(self, right):
- """
+ r"""
Quotient of division of self by other. This is denoted //.
If self = quotient \* right + remainder, this function returns
@@ -6825,8 +6825,8 @@ cdef class Polynomial(CommutativeAlgebra
where the roots `a` and `b` are to be considered in the algebraic
closure of the fraction field of the coefficients and counted with
multiplicities. If the polynomials are not monic this quantity is
- multiplied by `\\alpha_1^{deg(p_2)} \\alpha_2^{deg(p_1)}` where
- `\\alpha_1` and `\\alpha_2` are the leading coefficients of `p_1` and
+ multiplied by `\alpha_1^{deg(p_2)} \alpha_2^{deg(p_1)}` where
+ `\alpha_1` and `\alpha_2` are the leading coefficients of `p_1` and
`p_2` respectively.
INPUT:
diff -up src/sage/rings/polynomial/polynomial_integer_dense_flint.pyx.orig src/sage/rings/polynomial/polynomial_integer_dense_flint.pyx
--- src/sage/rings/polynomial/polynomial_integer_dense_flint.pyx.orig 2022-09-19 16:38:19.000000000 -0600
+++ src/sage/rings/polynomial/polynomial_integer_dense_flint.pyx 2023-01-15 16:25:22.181944010 -0700
@@ -1394,7 +1394,7 @@ cdef class Polynomial_integer_dense_flin
return smallInteger(fmpz_poly_degree(self.__poly))
def pseudo_divrem(self, B):
- """
+ r"""
Write ``A = self``. This function computes polynomials `Q` and `R`
and an integer `d` such that
diff -up src/sage/rings/polynomial/real_roots.pyx.orig src/sage/rings/polynomial/real_roots.pyx
--- src/sage/rings/polynomial/real_roots.pyx.orig 2022-09-19 16:38:19.000000000 -0600
+++ src/sage/rings/polynomial/real_roots.pyx 2023-01-15 16:25:22.182943992 -0700
@@ -1259,7 +1259,7 @@ def de_casteljau_intvec(Vector_integer_d
cdef double half_ulp = ldexp(1.0 * 65/64, -54)
def intvec_to_doublevec(Vector_integer_dense b, long err):
- """
+ r"""
Given a vector of integers A = [a1, ..., an], and an integer
error bound E, returns a vector of floating-point numbers
B = [b1, ..., bn], lower and upper error bounds F1 and F2, and
@@ -2149,7 +2149,7 @@ def subsample_vec_doctest(a, slen, llen)
return subsample_vec(a, slen, llen)
def maximum_root_first_lambda(p):
- """
+ r"""
Given a polynomial with real coefficients, computes an upper bound
on its largest real root, using the first-\lambda algorithm from
"Implementations of a New Theorem for Computing Bounds for Positive
diff -up src/sage/rings/real_double_element_gsl.pyx.orig src/sage/rings/real_double_element_gsl.pyx
--- src/sage/rings/real_double_element_gsl.pyx.orig 2022-09-19 16:38:19.000000000 -0600
+++ src/sage/rings/real_double_element_gsl.pyx 2023-01-15 16:25:22.182943992 -0700
@@ -227,7 +227,7 @@ cdef class RealDoubleElement_gsl(RealDou
return a
def log(self, base=None):
- """
+ r"""
Return the logarithm.
INPUT:
diff -up src/sage/rings/real_mpfi.pyx.orig src/sage/rings/real_mpfi.pyx
--- src/sage/rings/real_mpfi.pyx.orig 2022-09-19 16:38:19.000000000 -0600
+++ src/sage/rings/real_mpfi.pyx 2023-01-15 16:25:22.183943974 -0700
@@ -1309,7 +1309,7 @@ cdef class RealIntervalFieldElement(Ring
return self.str(10)
def _latex_(self):
- """
+ r"""
Return a latex representation of ``self``.
EXAMPLES::
diff -up src/sage/rings/semirings/tropical_semiring.pyx.orig src/sage/rings/semirings/tropical_semiring.pyx
--- src/sage/rings/semirings/tropical_semiring.pyx.orig 2022-09-19 16:38:19.000000000 -0600
+++ src/sage/rings/semirings/tropical_semiring.pyx 2023-01-15 16:25:22.183943974 -0700
@@ -99,7 +99,7 @@ cdef class TropicalSemiringElement(Eleme
return repr(self._val)
def _latex_(self):
- """
+ r"""
Return a latex representation of ``self``.
EXAMPLES::
diff -up src/sage/rings/tate_algebra_element.pyx.orig src/sage/rings/tate_algebra_element.pyx
--- src/sage/rings/tate_algebra_element.pyx.orig 2022-09-19 16:38:19.000000000 -0600
+++ src/sage/rings/tate_algebra_element.pyx 2023-01-15 16:25:22.183943974 -0700
@@ -3448,7 +3448,7 @@ cdef class TateAlgebraElement(Commutativ
@coerce_binop
def Spoly(self, other):
- """
+ r"""
Return the S-polynomial of this series and ``other``.
INPUT:
diff -up src/sage/symbolic/expression.pyx.orig src/sage/symbolic/expression.pyx
--- src/sage/symbolic/expression.pyx.orig 2022-09-19 16:38:19.000000000 -0600
+++ src/sage/symbolic/expression.pyx 2023-01-15 16:25:22.185943937 -0700
@@ -7,7 +7,7 @@
# distutils: include_dirs = SINGULAR_INCDIR
# pynac/basic.h includes
# factory/factory.h so this ^ is needed to find it
-"""
+r"""
Symbolic Expressions
RELATIONAL EXPRESSIONS: