diff --git a/.vscode/settings.json b/.vscode/settings.json index e414fb65d7f..58c9bc7af2b 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -27,7 +27,7 @@ "python.linting.enabled": true, // The following pycodestyle arguments are the same as the pycodestyle-minimal // tox environnment, see the file SAGE_ROOT/src/tox.ini - "python.linting.pycodestyleArgs": ["--select=E111,E306,E401,E701,E702,E703,W391,W605,E711,E712,E713,E721,E722"], + "python.linting.pycodestyleArgs": ["--select=E111,E306,E401,E701,E702,E703,W291,W391,W605,E711,E712,E713,E721,E722"], "cSpell.words": [ "furo", "Conda", diff --git a/src/conftest_inputtest.py b/src/conftest_inputtest.py index d3f5d5cdfb2..aeca6276691 100644 --- a/src/conftest_inputtest.py +++ b/src/conftest_inputtest.py @@ -1,6 +1,6 @@ def something(): """ a doctest in a docstring - + EXAMPLES:: sage: something() diff --git a/src/sage/combinat/diagram.py b/src/sage/combinat/diagram.py index a4a4169848a..c86cc4c45f4 100644 --- a/src/sage/combinat/diagram.py +++ b/src/sage/combinat/diagram.py @@ -856,7 +856,7 @@ def peelable_tableaux(self): For a fixed northwest diagram `D`, we say that a Young tableau `T` is `D`-peelable if: - + 1. the row indices of the cells in the first column of `D` are the entries in an initial segment in the first column of `T` and 2. the tableau `Q` obtained by removing those cells from `T` and playing diff --git a/src/sage/combinat/matrices/hadamard_matrix.py b/src/sage/combinat/matrices/hadamard_matrix.py index f4911807d9e..1fff63878e3 100644 --- a/src/sage/combinat/matrices/hadamard_matrix.py +++ b/src/sage/combinat/matrices/hadamard_matrix.py @@ -453,7 +453,7 @@ def hadamard_matrix(n,existence=False, check=True): return True M = skew_hadamard_matrix(n, check=False) elif regular_symmetric_hadamard_matrix_with_constant_diagonal(n, 1, existence=True) is True: - if existence: + if existence: return True M = regular_symmetric_hadamard_matrix_with_constant_diagonal(n, 1) else: diff --git a/src/sage/geometry/hyperplane_arrangement/plot.py b/src/sage/geometry/hyperplane_arrangement/plot.py index 9f89585578e..dc407a40ad3 100644 --- a/src/sage/geometry/hyperplane_arrangement/plot.py +++ b/src/sage/geometry/hyperplane_arrangement/plot.py @@ -103,9 +103,9 @@ sage: a.plot(hyperplane_labels=True,label_colors=['red','green','black']) # optional - sage.plot Graphics3d Object """ - from copy import copy from colorsys import hsv_to_rgb + from sage.misc.lazy_import import lazy_import lazy_import("sage.plot.plot3d.parametric_plot3d", "parametric_plot3d") lazy_import("sage.plot.plot3d.shapes2", "text3d") @@ -119,7 +119,7 @@ def plot(hyperplane_arrangement, **kwds): r""" - Return a plot of the hyperplane arrangement. + Return a plot of the hyperplane arrangement. If the arrangement is in 4 dimensions but inessential, a plot of the essentialization is returned. diff --git a/src/sage/geometry/ribbon_graph.py b/src/sage/geometry/ribbon_graph.py index d2a8d7de63a..6cc269c6b99 100644 --- a/src/sage/geometry/ribbon_graph.py +++ b/src/sage/geometry/ribbon_graph.py @@ -1,9 +1,9 @@ r""" Ribbon Graphs -This file implements objects called *ribbon graphs*. These are graphs -together with a cyclic ordering of the darts adjacent to each -vertex. This data allows us to unambiguously "thicken" the ribbon +This file implements objects called *ribbon graphs*. These are graphs +together with a cyclic ordering of the darts adjacent to each +vertex. This data allows us to unambiguously "thicken" the ribbon graph to an orientable surface with boundary. Also, every orientable surface with non-empty boundary is the thickening of a ribbon graph. @@ -103,10 +103,10 @@ class RibbonGraph(SageObject, UniqueRepresentation): **Brief introduction** - Let `\Sigma` be an orientable surface with non-empty boundary and let - `\Gamma` be the topological realization of a graph that is embedded in + Let `\Sigma` be an orientable surface with non-empty boundary and let + `\Gamma` be the topological realization of a graph that is embedded in `\Sigma` in such a way that the graph is a strong deformation retract of - the surface. + the surface. Let `v(\Gamma)` be the set of vertices of `\Gamma`, suppose that these are white vertices. Now we mark black vertices in an interior point @@ -121,7 +121,7 @@ class RibbonGraph(SageObject, UniqueRepresentation): `\Gamma` and suppose that we enumerate the set `D(\Gamma)` and that it has `n` elements. - With the orientation of the surface and the embedding of the graph in + With the orientation of the surface and the embedding of the graph in the surface we can produce two permutations: - A permutation that we denote by `\sigma`. This permutation is a @@ -139,13 +139,13 @@ class RibbonGraph(SageObject, UniqueRepresentation): .. RUBRIC:: Abstract definition - Consider a graph `\Gamma` (not a priori embedded in any surface). - Now we can again consider one vertex in the interior of each edge + Consider a graph `\Gamma` (not a priori embedded in any surface). + Now we can again consider one vertex in the interior of each edge splitting each edge in two darts. We label the darts with numbers. - We say that a ribbon structure on `\Gamma` is a set of two + We say that a ribbon structure on `\Gamma` is a set of two permutations `(\sigma, \rho)`. Where `\sigma` is formed by as many - disjoint cycles as vertices had `\Gamma`. And each cycle is a + disjoint cycles as vertices had `\Gamma`. And each cycle is a cyclic ordering of the darts adjacent to a vertex. The permutation `\rho` just tell us which two darts belong to the same edge. @@ -210,7 +210,7 @@ class RibbonGraph(SageObject, UniqueRepresentation): sage: R2.sigma() (1,3,5,8)(2,4,6) - This example is constructed by taking the bipartite graph of + This example is constructed by taking the bipartite graph of type `(3,3)`:: sage: s3 = PermutationGroupElement('(1,2,3)(4,5,6)(7,8,9)(10,11,12)(13,14,15)(16,17,18)') @@ -384,7 +384,7 @@ def number_boundaries(self): sage: R1.number_boundaries() 1 - This example is constructed by taking the bipartite graph of + This example is constructed by taking the bipartite graph of type `(3,3)`:: sage: s2 = PermutationGroupElement('(1,2,3)(4,5,6)(7,8,9)(10,11,12)(13,14,15)(16,17,18)') @@ -409,7 +409,7 @@ def contract_edge(self, k): INPUT: - - ``k`` -- non-negative integer; the position in `\rho` of the + - ``k`` -- non-negative integer; the position in `\rho` of the transposition that is going to be contracted OUTPUT: @@ -441,7 +441,7 @@ def contract_edge(self, k): ValueError: the edge is a loop and cannot be contracted In this example, we consider a graph that has one edge ``(19,20)`` - such that one of its ends is a vertex of valency 1. This is + such that one of its ends is a vertex of valency 1. This is the vertex ``(20)`` that is not specified when defining `\sigma`. We contract precisely this edge and get a ribbon graph with no vertices of valency 1:: @@ -514,7 +514,7 @@ def extrude_edge(self, vertex, dart1, dart2): OUTPUT: - A ribbon graph resulting from extruding a new edge that + A ribbon graph resulting from extruding a new edge that pulls from ``vertex`` a new vertex that is, now, adjacent to all the darts from ``dart1``to ``dart2`` (not including ``dart2``) in the cyclic ordering given by the cycle corresponding @@ -553,7 +553,7 @@ def extrude_edge(self, vertex, dart1, dart2): (1,2)(3,4)(5,6)(7,8) In the following example we first extrude one edge from a vertex - of valency 3 generating a new vertex of valency 2. Then we + of valency 3 generating a new vertex of valency 2. Then we extrude a new edge from this vertex of valency 2:: sage: s1 = PermutationGroupElement('(1,3,5)(2,4,6)') @@ -674,7 +674,7 @@ def boundary(self): OUTPUT: - A list of lists. The number of inner lists is the number of + A list of lists. The number of inner lists is the number of boundary components of the surface. Each list in the list consists of an ordered tuple of numbers, each number comes from the number assigned to the corresponding dart before @@ -878,7 +878,7 @@ def make_generic(self): def homology_basis(self): r""" - Return an oriented basis of the first homology group of the + Return an oriented basis of the first homology group of the graph. OUTPUT: @@ -1098,8 +1098,8 @@ def make_ribbon(g, r): OUTPUT: - - a ribbon graph that has 2 vertices (two non-trivial cycles - in its sigma permutation) of valency `2g + r` and it has + - a ribbon graph that has 2 vertices (two non-trivial cycles + in its sigma permutation) of valency `2g + r` and it has `2g + r` edges (and hence `4g + 2r` darts) EXAMPLES:: diff --git a/src/sage/geometry/triangulation/point_configuration.py b/src/sage/geometry/triangulation/point_configuration.py index 1bf933700c9..f970a5faf4a 100644 --- a/src/sage/geometry/triangulation/point_configuration.py +++ b/src/sage/geometry/triangulation/point_configuration.py @@ -1865,7 +1865,7 @@ def contained_simplex(self, large=True, initial_point=None, point_order=None): sage: pc.contained_simplex() (P(-1, -1), P(1, 1), P(0, 1)) sage: pc.contained_simplex(point_order = [pc[1],pc[3],pc[4],pc[2],pc[0]]) - (P(0, 1), P(1, 1), P(-1, -1)) + (P(0, 1), P(1, 1), P(-1, -1)) Lower-dimensional example:: diff --git a/src/sage/libs/eclib/interface.py b/src/sage/libs/eclib/interface.py index 119a68ba34d..0faee97661e 100644 --- a/src/sage/libs/eclib/interface.py +++ b/src/sage/libs/eclib/interface.py @@ -731,9 +731,9 @@ class mwrank_MordellWeil(SageObject): Reducing saturation bound from given value 20 to computed index bound 3 Tamagawa index primes are [ 2 ] Checking saturation at [ 2 3 ] - Checking 2-saturation + Checking 2-saturation Points were proved 2-saturated (max q used = 7) - Checking 3-saturation + Checking 3-saturation Points were proved 3-saturated (max q used = 7) done P2 = [-2:3:1] is generator number 2 @@ -741,10 +741,10 @@ class mwrank_MordellWeil(SageObject): Reducing saturation bound from given value 20 to computed index bound 4 Tamagawa index primes are [ 2 ] Checking saturation at [ 2 3 ] - Checking 2-saturation + Checking 2-saturation possible kernel vector = [1,1] This point may be in 2E(Q): [14:-52:1] - ...and it is! + ...and it is! Replacing old generator #1 with new generator [1:-1:1] Reducing index bound from 4 to 2 Points have successfully been 2-saturated (max q used = 7) @@ -756,9 +756,9 @@ class mwrank_MordellWeil(SageObject): Reducing saturation bound from given value 20 to computed index bound 3 Tamagawa index primes are [ 2 ] Checking saturation at [ 2 3 ] - Checking 2-saturation + Checking 2-saturation Points were proved 2-saturated (max q used = 11) - Checking 3-saturation + Checking 3-saturation Points were proved 3-saturated (max q used = 13) done, index = 1. P4 = [-1:3:1] = -1*P1 + -1*P2 + -1*P3 (mod torsion) @@ -911,10 +911,10 @@ def process(self, v, saturation_bound=0): The resulting points may not be p-saturated for p between this and the computed index bound 93 Tamagawa index primes are [ 2 ] Checking saturation at [ 2 ] - Checking 2-saturation + Checking 2-saturation possible kernel vector = [1,0,0] This point may be in 2E(Q): [1547:-2967:343] - ...and it is! + ...and it is! Replacing old generator #1 with new generator [-2:3:1] Reducing index bound from 93 to 46 Points have successfully been 2-saturated (max q used = 11) @@ -933,12 +933,12 @@ def process(self, v, saturation_bound=0): The resulting points may not be p-saturated for p between this and the computed index bound 46 Tamagawa index primes are [ 2 ] Checking saturation at [ 2 3 ] - Checking 2-saturation + Checking 2-saturation Points were proved 2-saturated (max q used = 11) - Checking 3-saturation + Checking 3-saturation possible kernel vector = [0,1,0] This point may be in 3E(Q): [2707496766203306:864581029138191:2969715140223272] - ...and it is! + ...and it is! Replacing old generator #2 with new generator [-14:25:8] Reducing index bound from 46 to 15 Points have successfully been 3-saturated (max q used = 13) @@ -957,14 +957,14 @@ def process(self, v, saturation_bound=0): The resulting points may not be p-saturated for p between this and the computed index bound 15 Tamagawa index primes are [ 2 ] Checking saturation at [ 2 3 5 ] - Checking 2-saturation + Checking 2-saturation Points were proved 2-saturated (max q used = 11) - Checking 3-saturation + Checking 3-saturation Points were proved 3-saturated (max q used = 13) - Checking 5-saturation + Checking 5-saturation possible kernel vector = [0,0,1] This point may be in 5E(Q): [-13422227300:-49322830557:12167000000] - ...and it is! + ...and it is! Replacing old generator #3 with new generator [1:-1:1] Reducing index bound from 15 to 3 Points have successfully been 5-saturated (max q used = 71) @@ -981,9 +981,9 @@ def process(self, v, saturation_bound=0): saturating basis...Saturation index bound (for points of good reduction) = 3 Tamagawa index primes are [ 2 ] Checking saturation at [ 2 3 ] - Checking 2-saturation + Checking 2-saturation Points were proved 2-saturated (max q used = 11) - Checking 3-saturation + Checking 3-saturation Points were proved 3-saturated (max q used = 13) done (True, 1, '[ ]') @@ -1329,6 +1329,5 @@ def points(self): P4 = [12:35:27] = 1*P1 + -1*P2 + -1*P3 (mod torsion) sage: EQ.points() [[1, -1, 1], [-2, 3, 1], [-14, 25, 8]] - """ return self.__mw.getbasis() diff --git a/src/sage/libs/pari/tests.py b/src/sage/libs/pari/tests.py index e5a2aa25172..472b1c2f66e 100644 --- a/src/sage/libs/pari/tests.py +++ b/src/sage/libs/pari/tests.py @@ -1767,7 +1767,7 @@ sage: eta1 = e.elleta(precision=150)[0] sage: eta1.sage() 3.605463601432652085915820564207726774810268996598024745444380641429820491740 # 64-bit - 3.60546360143265208591582056420772677481026899659802474544 # 32-bit + 3.60546360143265208591582056420772677481026899659802474544 # 32-bit sage: from cypari2 import Pari sage: pari = Pari() diff --git a/src/sage/logic/logic.py b/src/sage/logic/logic.py index 769fae29289..13a45b337ff 100644 --- a/src/sage/logic/logic.py +++ b/src/sage/logic/logic.py @@ -318,7 +318,7 @@ def combine(self, statement1, statement2): 'CPAREN', 'CPAREN'], {'a': 'False', 'b': 'False'}, - ['a', 'b', 'b']] + ['a', 'b', 'b']] """ toks = ['OPAREN'] + statement1[0] + ['OR'] + statement2[0] + ['CPAREN'] variables = dict(statement1[1]) diff --git a/src/sage/manifolds/catalog.py b/src/sage/manifolds/catalog.py index e71faca3072..bb09ed8885d 100644 --- a/src/sage/manifolds/catalog.py +++ b/src/sage/manifolds/catalog.py @@ -262,11 +262,12 @@ def Torus(R=2, r=1, names=None): M.induced_metric() return M + def RealProjectiveSpace(dim=2): r""" Generate projective space of dimension ``dim`` over the reals. - This is the topological space of lines through the origin in + This is the topological space of lines through the origin in `\RR^{d+1}`. The standard atlas consists of `d+2` charts, which sends the set `U_i = \{[x_1, x_2, \ldots, x_{d+1}] : x_i \neq 0 \}` to `k^{d}` by dividing by `x_i` and omitting the `i`th coordinate diff --git a/src/sage/manifolds/differentiable/manifold.py b/src/sage/manifolds/differentiable/manifold.py index d650d4eb712..e674ad8db05 100644 --- a/src/sage/manifolds/differentiable/manifold.py +++ b/src/sage/manifolds/differentiable/manifold.py @@ -3957,7 +3957,7 @@ def affine_connection(self, name, latex_name=None): AffineConnection return AffineConnection(self, name, latex_name) - def metric(self, name: str, signature: Optional[int] = None, + def metric(self, name: str, signature: Optional[int] = None, latex_name: Optional[str] = None, dest_map: Optional[DiffMap] = None) -> PseudoRiemannianMetric: r""" diff --git a/src/sage/manifolds/differentiable/symplectic_form.py b/src/sage/manifolds/differentiable/symplectic_form.py index 482f9527ba0..c72f50b70fa 100644 --- a/src/sage/manifolds/differentiable/symplectic_form.py +++ b/src/sage/manifolds/differentiable/symplectic_form.py @@ -498,7 +498,7 @@ def poisson_bracket( def volume_form(self, contra: int = 0) -> TensorField: r""" - Liouville volume form `\frac{1}{n!}\omega^n` associated with the + Liouville volume form `\frac{1}{n!}\omega^n` associated with the symplectic form `\omega`, where `2n` is the dimension of the manifold. INPUT: diff --git a/src/sage/modular/abvar/homspace.py b/src/sage/modular/abvar/homspace.py index 4698e509f86..adf9889bebe 100644 --- a/src/sage/modular/abvar/homspace.py +++ b/src/sage/modular/abvar/homspace.py @@ -350,7 +350,7 @@ def __call__(self, M, **kwds): elif M.domain() == self.domain() and M.codomain() == self.codomain(): M = M.matrix() else: - raise ValueError("cannot convert %s into %s" % (M, self)) + raise ValueError("cannot convert %s into %s" % (M, self)) elif is_Matrix(M): if M.base_ring() != ZZ: M = M.change_ring(ZZ) diff --git a/src/sage/monoids/free_monoid_element.py b/src/sage/monoids/free_monoid_element.py index f23dba93b45..23d2a8abc66 100644 --- a/src/sage/monoids/free_monoid_element.py +++ b/src/sage/monoids/free_monoid_element.py @@ -149,7 +149,7 @@ def _latex_(self): \alpha b sage: latex(b*alpha) b \alpha - sage: "%s"%latex(alpha*b) + sage: "%s" % latex(alpha*b) '\\alpha b' """ s = "" @@ -159,10 +159,10 @@ def _latex_(self): g = x[int(v[i][0])] e = v[i][1] if e == 1: - s += "%s "%(g,) + s += "%s " % (g,) else: - s += "%s^{%s}"%(g,e) - s = s.rstrip(" ") # strip the trailing whitespace caused by adding a space after each element name + s += "%s^{%s}" % (g, e) + s = s.rstrip(" ") # strip the trailing whitespace caused by adding a space after each element name if len(s) == 0: s = "1" return s diff --git a/src/sage/numerical/backends/cvxopt_backend_test.py b/src/sage/numerical/backends/cvxopt_backend_test.py index 0e7227940c1..6029221fda2 100644 --- a/src/sage/numerical/backends/cvxopt_backend_test.py +++ b/src/sage/numerical/backends/cvxopt_backend_test.py @@ -1,14 +1,16 @@ import pytest + from sage.structure.sage_object import SageObject from sage.numerical.backends.generic_backend_test import GenericBackendTests from sage.numerical.backends.generic_backend import GenericBackend from sage.numerical.mip import MixedIntegerLinearProgram + class TestCVXOPTBackend(GenericBackendTests): @pytest.fixture def backend(self) -> GenericBackend: - return MixedIntegerLinearProgram(solver="CVXOPT").get_backend() + return MixedIntegerLinearProgram(solver="CVXOPT").get_backend() def test_sage_unittest_testsuite(self, sage_object: SageObject): # TODO: Remove this test as soon as all old test methods are migrated diff --git a/src/sage/numerical/backends/glpk_backend_test.py b/src/sage/numerical/backends/glpk_backend_test.py index ec37cd25f36..b41b1ae80c8 100644 --- a/src/sage/numerical/backends/glpk_backend_test.py +++ b/src/sage/numerical/backends/glpk_backend_test.py @@ -1,10 +1,12 @@ import pytest + from sage.numerical.backends.generic_backend_test import GenericBackendTests from sage.numerical.backends.generic_backend import GenericBackend from sage.numerical.mip import MixedIntegerLinearProgram + class TestGLPKBackend(GenericBackendTests): @pytest.fixture def backend(self) -> GenericBackend: - return MixedIntegerLinearProgram(solver="GLPK").get_backend() + return MixedIntegerLinearProgram(solver="GLPK").get_backend() diff --git a/src/sage/numerical/backends/ppl_backend_test.py b/src/sage/numerical/backends/ppl_backend_test.py index ac241275ee2..852c3be82c1 100644 --- a/src/sage/numerical/backends/ppl_backend_test.py +++ b/src/sage/numerical/backends/ppl_backend_test.py @@ -1,10 +1,12 @@ import pytest + from sage.numerical.backends.generic_backend_test import GenericBackendTests from sage.numerical.backends.generic_backend import GenericBackend from sage.numerical.mip import MixedIntegerLinearProgram + class TestPPLBackend(GenericBackendTests): @pytest.fixture def backend(self) -> GenericBackend: - return MixedIntegerLinearProgram(solver="PPL").get_backend() + return MixedIntegerLinearProgram(solver="PPL").get_backend() diff --git a/src/sage/numerical/linear_tensor_constraints.py b/src/sage/numerical/linear_tensor_constraints.py index 6535867f8c8..24f94f3b3d6 100644 --- a/src/sage/numerical/linear_tensor_constraints.py +++ b/src/sage/numerical/linear_tensor_constraints.py @@ -97,7 +97,7 @@ def LinearTensorConstraintsParent(linear_functions_parent): sage: LF = LinearFunctionsParent(QQ) sage: LT = LinearTensorParent(QQ^2, LF) sage: LinearTensorConstraintsParent(LT) - Linear constraints in the tensor product of Vector space of dimension 2 + Linear constraints in the tensor product of Vector space of dimension 2 over Rational Field and Linear functions over Rational Field """ return LinearTensorConstraintsParent_class(linear_functions_parent) @@ -215,7 +215,7 @@ def lhs(self): sage: mip. = MixedIntegerLinearProgram() sage: (x[0] * vector([1,2]) == 0).lhs() - (1.0, 2.0)*x_0 + (1.0, 2.0)*x_0 """ return self._lhs @@ -250,7 +250,7 @@ def _ascii_art_(self): sage: mip. = MixedIntegerLinearProgram() sage: ascii_art(x[0] * vector([1,2]) >= 0) (0.0, 0.0) <= (1.0, 2.0)*x_0 - sage: ascii_art(x[0] * matrix([[1,2],[3,4]]) >= 0) + sage: ascii_art(x[0] * matrix([[1,2],[3,4]]) >= 0) [0 0] <= [x_0 2*x_0] [0 0] [3*x_0 4*x_0] """ @@ -313,7 +313,7 @@ class LinearTensorConstraintsParent_class(Parent): sage: p = MixedIntegerLinearProgram() sage: LT = p.linear_functions_parent().tensor(RDF^2); LT - Tensor product of Vector space of dimension 2 over Real Double + Tensor product of Vector space of dimension 2 over Real Double Field and Linear functions over Real Double Field sage: from sage.numerical.linear_tensor_constraints import LinearTensorConstraintsParent sage: LTC = LinearTensorConstraintsParent(LT); LTC @@ -342,7 +342,7 @@ def __init__(self, linear_tensor_parent): sage: LT = LinearTensorParent(RDF^2, LF) sage: from sage.numerical.linear_tensor_constraints import LinearTensorConstraintsParent sage: LinearTensorConstraintsParent(LT) - Linear constraints in the tensor product of Vector space of + Linear constraints in the tensor product of Vector space of dimension 2 over Real Double Field and Linear functions over Real Double Field """ @@ -399,7 +399,7 @@ def _repr_(self): sage: ieq = (x[0] * vector([1,2]) >= 0) sage: ieq.parent() # indirect doctests Linear constraints in the tensor product of Vector space of - dimension 2 over Real Double Field and Linear functions over + dimension 2 over Real Double Field and Linear functions over Real Double Field """ return 'Linear constraints in the tensor product of {0} and {1}'.format( diff --git a/src/sage/rings/asymptotic/asymptotic_expansion_generators.py b/src/sage/rings/asymptotic/asymptotic_expansion_generators.py index 3100ed5356f..4f4c506bc40 100644 --- a/src/sage/rings/asymptotic/asymptotic_expansion_generators.py +++ b/src/sage/rings/asymptotic/asymptotic_expansion_generators.py @@ -173,7 +173,7 @@ def Stirling(var, precision=None, skip_constant_factor=False): sage: set_series_precision(5) sage: asymptotic_expansions.Stirling('n') - sqrt(2)*sqrt(pi)*e^(n*log(n))*(e^n)^(-1)*n^(1/2) + + sqrt(2)*sqrt(pi)*e^(n*log(n))*(e^n)^(-1)*n^(1/2) + ... + O(e^(n*log(n))*(e^n)^(-1)*n^(-5/2)) sage: set_series_precision(20) # restore series precision default """ diff --git a/src/sage/rings/padics/eisenstein_extension_generic.py b/src/sage/rings/padics/eisenstein_extension_generic.py index 6473ba4d2ca..4f68e63ffae 100644 --- a/src/sage/rings/padics/eisenstein_extension_generic.py +++ b/src/sage/rings/padics/eisenstein_extension_generic.py @@ -39,7 +39,7 @@ def __init__(self, poly, prec, print_mode, names, element_class): def _extension_type(self): """ - Return the type (``Unramified``, ``Eisenstein``) of this + Return the type (``Unramified``, ``Eisenstein``) of this extension as a string, if any. Used for printing. diff --git a/src/sage/rings/padics/unramified_extension_generic.py b/src/sage/rings/padics/unramified_extension_generic.py index d8eecc36f02..7973ed814c3 100644 --- a/src/sage/rings/padics/unramified_extension_generic.py +++ b/src/sage/rings/padics/unramified_extension_generic.py @@ -56,7 +56,7 @@ def __init__(self, poly, prec, print_mode, names, element_class): def _extension_type(self): """ - Return the type (``Unramified``, ``Eisenstein``) of this + Return the type (``Unramified``, ``Eisenstein``) of this extension as a string, if any. Used for printing. diff --git a/src/sage/rings/tate_algebra.py b/src/sage/rings/tate_algebra.py index 701278b2eb1..1b601e4992a 100644 --- a/src/sage/rings/tate_algebra.py +++ b/src/sage/rings/tate_algebra.py @@ -239,7 +239,6 @@ class TateAlgebraFactory(UniqueFactory): AUTHORS: - Xavier Caruso, Thibaut Verron (2018-09) - """ def create_key(self, base, prec=None, log_radii=ZZ(0), names=None, order='degrevlex'): """ @@ -251,7 +250,7 @@ def create_key(self, base, prec=None, log_radii=ZZ(0), names=None, order='degrev - ``prec`` -- an integer or ``None`` (default: ``None``) - - ``log_radii`` -- an integer or a list or a tuple of integers + - ``log_radii`` -- an integer or a list or a tuple of integers (default: ``0``) - ``names`` -- names of the indeterminates diff --git a/src/sage/schemes/affine/affine_point.py b/src/sage/schemes/affine/affine_point.py index bf86bc225c6..72feecf97f8 100644 --- a/src/sage/schemes/affine/affine_point.py +++ b/src/sage/schemes/affine/affine_point.py @@ -105,7 +105,7 @@ def _matrix_times_point_(self, mat, dom): - ``mat`` -- a matrix - - ``dom`` -- (unused) needed for consistent function call with projective + - ``dom`` -- (unused) needed for consistent function call with projective OUTPUT: a scheme point given by ``mat*self`` diff --git a/src/sage/schemes/elliptic_curves/ell_modular_symbols.py b/src/sage/schemes/elliptic_curves/ell_modular_symbols.py index 72489b121f9..2b23f6c7555 100644 --- a/src/sage/schemes/elliptic_curves/ell_modular_symbols.py +++ b/src/sage/schemes/elliptic_curves/ell_modular_symbols.py @@ -8,7 +8,7 @@ subspace on which complex conjugation acts as multiplication by `+1` and one on which it acts by `-1`. -There are three implementations of modular symbols, two within +There are three implementations of modular symbols, two within ``Sage`` and one in Cremona's ``eclib`` library. One can choose here which one is used. diff --git a/src/sage/schemes/elliptic_curves/ell_point.py b/src/sage/schemes/elliptic_curves/ell_point.py index 4587756b06d..9b870b5df9f 100644 --- a/src/sage/schemes/elliptic_curves/ell_point.py +++ b/src/sage/schemes/elliptic_curves/ell_point.py @@ -3559,7 +3559,7 @@ def discrete_log(self, Q, ord=None): - Otherwise (if this test is inconclusive), check that the Weil pairing of `P` and `Q` is trivial. - For anomalous curves with `\#E = p`, the + For anomalous curves with `\#E = p`, the :meth:`padic_elliptic_logarithm` function is called. INPUT: diff --git a/src/sage/schemes/product_projective/homset.py b/src/sage/schemes/product_projective/homset.py index 7f4e1de0773..28aa566bb73 100644 --- a/src/sage/schemes/product_projective/homset.py +++ b/src/sage/schemes/product_projective/homset.py @@ -146,7 +146,7 @@ def points(self, **kwds): (1 : 0 : 0 , 0 : 1), (1 : 0 : 0 , 1 : 0), (1 : 0 : 0 , 1 : 1), (1 : 0 : 0 , 2 : 1), (1 : 0 : 1 , 0 : 1), (1 : 0 : 1 , 1 : 0), (1 : 0 : 1 , 1 : 1), (1 : 0 : 1 , 2 : 1), (1 : 1 : 0 , 0 : 1), (1 : 1 : 0 , 1 : 0), (1 : 1 : 0 , 1 : 1), (1 : 1 : 0 , 2 : 1), - (1 : 1 : 1 , 0 : 1), (1 : 1 : 1 , 1 : 0), (1 : 1 : 1 , 1 : 1), (1 : 1 : 1 , 2 : 1), + (1 : 1 : 1 , 0 : 1), (1 : 1 : 1 , 1 : 0), (1 : 1 : 1 , 1 : 1), (1 : 1 : 1 , 2 : 1), (1 : 2 : 1 , 0 : 1), (1 : 2 : 1 , 1 : 0), (1 : 2 : 1 , 1 : 1), (1 : 2 : 1 , 2 : 1), (2 : 0 : 1 , 0 : 1), (2 : 0 : 1 , 1 : 0), (2 : 0 : 1 , 1 : 1), (2 : 0 : 1 , 2 : 1), (2 : 1 : 0 , 0 : 1), (2 : 1 : 0 , 1 : 0), (2 : 1 : 0 , 1 : 1), (2 : 1 : 0 , 2 : 1), diff --git a/src/sage/tests/books/judson-abstract-algebra/boolean-sage.py b/src/sage/tests/books/judson-abstract-algebra/boolean-sage.py index 460403b3efb..2d7b13c00f7 100644 --- a/src/sage/tests/books/judson-abstract-algebra/boolean-sage.py +++ b/src/sage/tests/books/judson-abstract-algebra/boolean-sage.py @@ -152,7 +152,7 @@ ~~~~~~~~~~~~~~~~~~~~~~ :: sage: linear = P.linear_extension(); linear - [18, 9, 11, 6, 10, 0, 2, 1, 8, 3, 15, + [18, 9, 11, 6, 10, 0, 2, 1, 8, 3, 15, 7, 4, 14, 5, 19, 16, 13, 17, 12] ~~~~~~~~~~~~~~~~~~~~~~ :: diff --git a/src/sage/tests/cmdline.py b/src/sage/tests/cmdline.py index 1570b9c9b6a..12e73393206 100644 --- a/src/sage/tests/cmdline.py +++ b/src/sage/tests/cmdline.py @@ -725,7 +725,7 @@ def test_executable(args, input="", timeout=100.0, pydebug_ignore_warnings=False except KeyError: pass - __with_pydebug = hasattr(sys, 'gettotalrefcount') # This is a Python debug build (--with-pydebug) + __with_pydebug = hasattr(sys, 'gettotalrefcount') # This is a Python debug build (--with-pydebug) if __with_pydebug and pydebug_ignore_warnings: pexpect_env['PYTHONWARNINGS'] = ','.join([ 'ignore::DeprecationWarning', diff --git a/src/sage_setup/autogen/giacpy-mkkeywords.py b/src/sage_setup/autogen/giacpy-mkkeywords.py index 3a918b20aeb..8c5c1653b88 100644 --- a/src/sage_setup/autogen/giacpy-mkkeywords.py +++ b/src/sage_setup/autogen/giacpy-mkkeywords.py @@ -1,6 +1,6 @@ -#see the discussion in trac #29171 about where to store this file. +#see the discussion in trac #29171 about where to store this file. """ -This file is to help the maintainer to upgrade the giac keywords in +This file is to help the maintainer to upgrade the giac keywords in giacpy or giacpy_sage or sage.libs.giac @@ -12,14 +12,14 @@ It should not be used on the fly for an automatic installation script, because auto-methods.pxi is -quite long to be built and adding new giac keywords often break the built of giacpy +quite long to be built and adding new giac keywords often break the built of giacpy while not implementing a new giac keyword doesn't break the giacpy built. newkeywords.pxi is just created to check things manually but is not used in iacpy or sage.libs.giac AUTHORS: -- Frederic Han (2020-07) +- Frederic Han (2020-07) """ from subprocess import PIPE, Popen @@ -89,7 +89,7 @@ Mi.write(s) Mi.close() - + # building keywords.pxi with open("keywords.pxi", "w") as Fi: Fi.write("# file auto generated by mkkeywords.py\n") diff --git a/src/tox.ini b/src/tox.ini index 1fdf5230aae..216d2376511 100644 --- a/src/tox.ini +++ b/src/tox.ini @@ -103,14 +103,15 @@ description = # E703: statement ends with a semicolon # E711: comparison to None should be ‘if cond is None:’ # E712: comparison to True should be ‘if cond is True:’ or ‘if cond:’ - # E713 test for membership should be 'not in' + # E713 test for membership should be ’not in’ # E721: do not compare types, use isinstance() # E722: do not use bare except, specify exception instead + # W291: trailing whitespace # W391: blank line at end of file # W605: invalid escape sequence ‘x’ # See https://pycodestyle.pycqa.org/en/latest/intro.html#error-codes deps = pycodestyle -commands = pycodestyle --select E111,E306,E401,E701,E702,E703,W391,W605,E711,E712,E713,E721,E722 {posargs:{toxinidir}/sage/} +commands = pycodestyle --select E111,E306,E401,E701,E702,E703,W291,W391,W605,E711,E712,E713,E721,E722 {posargs:{toxinidir}/sage/} pycodestyle --select E111,E306,E401,E703,W605,E712,E713,E721,E722 --filename *.pyx {posargs:{toxinidir}/sage/} [pycodestyle]