Skip to content

Commit

Permalink
sagemathgh-38816: fix all pep E302 in manifolds and geometry
Browse files Browse the repository at this point in the history
this is about fixing the warning

E302 expected 2 blank lines, found 1

in the `manifolds` and `geometry` folders.

Purely scripted using `autopep8`

### 📝 Checklist

- [x] The title is concise and informative.
- [x] The description explains in detail what this PR is about.
- [ ] I have linked a relevant issue or discussion.
- [ ] I have created tests covering the changes.
- [ ] I have updated the documentation and checked the documentation
preview.

URL: sagemath#38816
Reported by: Frédéric Chapoton
Reviewer(s): Vincent Macri
  • Loading branch information
Release Manager committed Oct 17, 2024
2 parents b0152e2 + 1f8dae9 commit bbbca89
Show file tree
Hide file tree
Showing 70 changed files with 124 additions and 3 deletions.
4 changes: 2 additions & 2 deletions build/pkgs/configure/checksums.ini
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
tarball=configure-VERSION.tar.gz
sha1=978eb775a20fea3ed9b88f0d67ecd84a3d9cd6ea
sha256=c3987bb0f8aca81e112a17d8904ef2353a706159d43250305dc2bcac4ca2e33a
sha1=869b8dcff3ad88d00ad0212c4f1727a1c0d0a078
sha256=7880976e0ba4561e205467391ccdfd966789e8d09d2ca5a442767b634beb671e
2 changes: 1 addition & 1 deletion build/pkgs/configure/package-version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4326d0d9422011034a230ab3c1445fafeb2ac444
1c867dde3c7e7b486606afcfe479bb96d18f6b0b
1 change: 1 addition & 0 deletions src/sage/geometry/cone_catalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
# the top-level non-underscore functions defined in this module.
#


def _preprocess_args(ambient_dim, lattice):
r"""
Preprocess arguments for cone-constructing functions.
Expand Down
1 change: 1 addition & 0 deletions src/sage/geometry/cone_critical_angles.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
from sage.rings.real_double import RDF
from sage.symbolic.constants import pi


def _normalize_gevp_solution(gevp_solution):
r"""
Normalize the results of :func:`solve_gevp_nonzero` and
Expand Down
12 changes: 12 additions & 0 deletions src/sage/geometry/hyperbolic_space/hyperbolic_coercion.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
from sage.misc.lazy_import import lazy_import
lazy_import('sage.misc.call', 'attrcall')


class HyperbolicModelCoercion(Morphism):
"""
Abstract base class for morphisms between the hyperbolic models.
Expand Down Expand Up @@ -148,6 +149,7 @@ def __invert__(self):
# From UHP #
############


class CoercionUHPtoPD(HyperbolicModelCoercion):
"""
Coercion from the UHP to PD model.
Expand Down Expand Up @@ -188,6 +190,7 @@ def image_isometry_matrix(self, x):
return matrix([[1,-I],[-I,1]]) * x * matrix([[1,I],[I,1]]).conjugate()/Integer(2)
return matrix([[1,-I],[-I,1]]) * x * matrix([[1,I],[I,1]])/Integer(2)


class CoercionUHPtoKM(HyperbolicModelCoercion):
"""
Coercion from the UHP to KM model.
Expand Down Expand Up @@ -227,6 +230,7 @@ def image_isometry_matrix(self, x):
"""
return SL2R_to_SO21(x)


class CoercionUHPtoHM(HyperbolicModelCoercion):
"""
Coercion from the UHP to HM model.
Expand Down Expand Up @@ -269,6 +273,7 @@ def image_isometry_matrix(self, x):
# From PD #
###########


class CoercionPDtoUHP(HyperbolicModelCoercion):
"""
Coercion from the PD to UHP model.
Expand Down Expand Up @@ -318,6 +323,7 @@ def image_isometry_matrix(self, x):
return matrix([[1,I],[I,1]]) * x * matrix([[1,-I],[-I,1]]).conjugate() / Integer(2)
return matrix([[1,I],[I,1]]) * x * matrix([[1,-I],[-I,1]]) / Integer(2)


class CoercionPDtoKM(HyperbolicModelCoercion):
"""
Coercion from the PD to KM model.
Expand Down Expand Up @@ -444,6 +450,7 @@ def image_isometry_matrix(self, x):
"""
return SO21_to_SL2R(x)


class CoercionKMtoPD(HyperbolicModelCoercion):
"""
Coercion from the KM to PD model.
Expand Down Expand Up @@ -482,6 +489,7 @@ def image_isometry_matrix(self, x):
return (matrix(2,[1,-I,-I,1]) * SO21_to_SL2R(x) *
matrix(2,[1,I,I,1])/Integer(2))


class CoercionKMtoHM(HyperbolicModelCoercion):
"""
Coercion from the KM to HM model.
Expand Down Expand Up @@ -524,6 +532,7 @@ def image_isometry_matrix(self, x):
# From HM #
###########


class CoercionHMtoUHP(HyperbolicModelCoercion):
"""
Coercion from the HM to UHP model.
Expand Down Expand Up @@ -560,6 +569,7 @@ def image_isometry_matrix(self, x):
"""
return SO21_to_SL2R(x)


class CoercionHMtoPD(HyperbolicModelCoercion):
"""
Coercion from the HM to PD model.
Expand Down Expand Up @@ -596,6 +606,7 @@ def image_isometry_matrix(self, x):
return (matrix(2,[1,-I,-I,1]) * SO21_to_SL2R(x) *
matrix(2,[1,I,I,1])/Integer(2))


class CoercionHMtoKM(HyperbolicModelCoercion):
"""
Coercion from the HM to KM model.
Expand Down Expand Up @@ -635,6 +646,7 @@ def image_isometry_matrix(self, x):
#####################################################################
## Helper functions


def SL2R_to_SO21(A):
r"""
Given a matrix in `SL(2, \RR)` return its irreducible representation in
Expand Down
3 changes: 3 additions & 0 deletions src/sage/geometry/hyperbolic_space/hyperbolic_isometry.py
Original file line number Diff line number Diff line change
Expand Up @@ -620,6 +620,7 @@ def attracting_fixed_point(self):
fp = self._cached_isometry.attracting_fixed_point()
return self.domain().get_point(fp)


class HyperbolicIsometryUHP(HyperbolicIsometry):
r"""
Create a hyperbolic isometry in the UHP model.
Expand Down Expand Up @@ -881,6 +882,7 @@ def attracting_fixed_point(self): # UHP
return self.domain().get_point(infinity)
return self.domain().get_point(v[0] / v[1])


class HyperbolicIsometryPD(HyperbolicIsometry):
r"""
Create a hyperbolic isometry in the PD model.
Expand Down Expand Up @@ -982,6 +984,7 @@ def _orientation_preserving(A): #PD
return bool(A[1][0] == A[0][1].conjugate() and A[1][1] == A[0][0].conjugate()
and abs(A[0][0]) - abs(A[0][1]) != 0)


class HyperbolicIsometryKM(HyperbolicIsometry):
r"""
Create a hyperbolic isometry in the KM model.
Expand Down
1 change: 1 addition & 0 deletions src/sage/geometry/hyperbolic_space/hyperbolic_point.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@

from sage.geometry.hyperbolic_space.hyperbolic_isometry import HyperbolicIsometry


class HyperbolicPoint(Element):
r"""
Abstract base class for hyperbolic points. This class should never
Expand Down
2 changes: 2 additions & 0 deletions src/sage/geometry/hyperplane_arrangement/check_freeness.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
from sage.matrix.constructor import matrix
import sage.libs.singular.function_factory as fun_fact


def less_generators(X):
"""
Reduce the generator matrix of the module defined by ``X``.
Expand Down Expand Up @@ -63,6 +64,7 @@ def less_generators(X):
Kd = set(range(X.nrows())).difference(K)
X = X.matrix_from_rows(sorted(Kd))


def construct_free_chain(A):
"""
Construct the free chain for the hyperplanes ``A``.
Expand Down
3 changes: 3 additions & 0 deletions src/sage/geometry/lattice_polytope.py
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,7 @@ def ReflexivePolytope(dim, n):
# Sequences of reflexive polytopes
_rp = [None] * 4


def ReflexivePolytopes(dim):
r"""
Return the sequence of all 2- or 3-dimensional reflexive polytopes.
Expand Down Expand Up @@ -494,6 +495,7 @@ def is_LatticePolytope(x):
deprecation(34307, "is_LatticePolytope is deprecated, use isinstance instead")
return isinstance(x, LatticePolytopeClass)


@richcmp_method
class LatticePolytopeClass(ConvexSet_compact, Hashable, sage.geometry.abc.LatticePolytope):
r"""
Expand Down Expand Up @@ -4982,6 +4984,7 @@ def part_of_point(self, i):

_palp_dimension = None


def _palp(command, polytopes, reduce_dimension=False):
r"""
Run ``command`` on vertices of given
Expand Down
2 changes: 2 additions & 0 deletions src/sage/geometry/polyhedron/backend_polymake.py
Original file line number Diff line number Diff line change
Expand Up @@ -724,6 +724,8 @@ def _test_polymake_pickling(self, tester=None, other=None, **options):
tester.assertEqual(P.AFFINE_HULL, P1.AFFINE_HULL)

#########################################################################


class Polyhedron_QQ_polymake(Polyhedron_polymake, Polyhedron_QQ):
r"""
Polyhedra over `\QQ` with polymake.
Expand Down
1 change: 1 addition & 0 deletions src/sage/geometry/polyhedron/base0.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
from sage.structure.element import Element
import sage.geometry.abc


class Polyhedron_base0(Element, sage.geometry.abc.Polyhedron):
"""
Initialization and basic access for polyhedra.
Expand Down
1 change: 1 addition & 0 deletions src/sage/geometry/polyhedron/base2.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
from sage.modules.free_module_element import vector
from .base1 import Polyhedron_base1


class Polyhedron_base2(Polyhedron_base1):
"""
Methods related to lattice points.
Expand Down
1 change: 1 addition & 0 deletions src/sage/geometry/polyhedron/base3.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
from sage.rings.rational_field import QQ
from .base2 import Polyhedron_base2


class Polyhedron_base3(Polyhedron_base2):
"""
Methods related to the combinatorics of a polyhedron.
Expand Down
1 change: 1 addition & 0 deletions src/sage/geometry/polyhedron/base4.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
from sage.misc.cachefunc import cached_method
from .base3 import Polyhedron_base3


class Polyhedron_base4(Polyhedron_base3):
"""
Methods relying on :mod:`sage.graphs`.
Expand Down
1 change: 1 addition & 0 deletions src/sage/geometry/polyhedron/base5.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@

from .base4 import Polyhedron_base4


class Polyhedron_base5(Polyhedron_base4):
"""
Methods constructing new polyhedra
Expand Down
1 change: 1 addition & 0 deletions src/sage/geometry/polyhedron/base6.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
from sage.geometry.convex_set import AffineHullProjectionData
from .base5 import Polyhedron_base5


class Polyhedron_base6(Polyhedron_base5):
r"""
Methods related to plotting including affine hull projection.
Expand Down
1 change: 1 addition & 0 deletions src/sage/geometry/polyhedron/base7.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
from sage.rings.rational_field import QQ
from .base6 import Polyhedron_base6


class Polyhedron_base7(Polyhedron_base6):
r"""
Methods related to triangulation and volume.
Expand Down
4 changes: 4 additions & 0 deletions src/sage/geometry/polyhedron/cdd_file_format.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
from .misc import _set_to_None_if_empty, _common_length_of, _to_space_separated_string

#########################################################################


def cdd_Vrepresentation(cdd_type, vertices, rays, lines, file_output=None):
r"""
Return a string containing the V-representation in cddlib's ext format.
Expand Down Expand Up @@ -92,6 +94,8 @@ def cdd_Vrepresentation(cdd_type, vertices, rays, lines, file_output=None):
return s

#########################################################################


def cdd_Hrepresentation(cdd_type, ieqs, eqns, file_output=None):
r"""
Return a string containing the H-representation in cddlib's ine format.
Expand Down
1 change: 1 addition & 0 deletions src/sage/geometry/polyhedron/double_description.py
Original file line number Diff line number Diff line change
Expand Up @@ -704,6 +704,7 @@ def add_inequality(self, a):
self.R = R_pos + R_nul + R_new
self.A.append(a)


class StandardAlgorithm(Problem):
"""
Standard implementation of the double description algorithm.
Expand Down
1 change: 1 addition & 0 deletions src/sage/geometry/polyhedron/face.py
Original file line number Diff line number Diff line change
Expand Up @@ -991,6 +991,7 @@ def stacking_locus(self):

return parent.element_class(parent, None, [locus_ieqs, locus_eqns])


def combinatorial_face_to_polyhedral_face(polyhedron, combinatorial_face):
r"""
Convert a combinatorial face to a face of a polyhedron.
Expand Down
2 changes: 2 additions & 0 deletions src/sage/geometry/polyhedron/library.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@
lazy_import('sage.graphs.graph', 'Graph')
lazy_import('sage.combinat.root_system.associahedron', 'Associahedron')


def zero_sum_projection(d, base_ring=None):
r"""
Return a matrix corresponding to the projection on the orthogonal of
Expand Down Expand Up @@ -319,6 +320,7 @@ def gale_transform_to_polytope(vectors, base_ring=None, backend=None):

return P


def gale_transform_to_primal(vectors, base_ring=None, backend=None):
r"""
Return a point configuration dual to a totally cyclic vector configuration.
Expand Down
3 changes: 3 additions & 0 deletions src/sage/geometry/ribbon_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@

#Auxiliary functions that will be used in the classes.


def _find(l, k):
r"""
Return the two coordinates of the element ``k`` in the list of
Expand Down Expand Up @@ -1078,6 +1079,7 @@ def normalize(self):
PermutationConstructor([tuple(x) for x in aux_rho])
)


def make_ribbon(g, r):
r"""
Return a ribbon graph whose thickening has genus ``g`` and ``r``
Expand Down Expand Up @@ -1151,6 +1153,7 @@ def make_ribbon(g, r):
return RibbonGraph(PermutationConstructor([tuple(x) for x in repr_sigma]),
PermutationConstructor([tuple(x) for x in repr_rho]))


def bipartite_ribbon_graph(p, q):
r"""
Return the bipartite graph modeling the corresponding
Expand Down
2 changes: 2 additions & 0 deletions src/sage/manifolds/catalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ def Minkowski(positive_spacelike=True, names=None):
g[1,1], g[2,2], g[3,3] = sgn, sgn, sgn
return M


def Kerr(m=1, a=0, coordinates='BL', names=None):
"""
Generate a Kerr spacetime.
Expand Down Expand Up @@ -217,6 +218,7 @@ def Kerr(m=1, a=0, coordinates='BL', names=None):
raise NotImplementedError("coordinates system not implemented, see help"
" for details")


def Torus(R=2, r=1, names=None):
"""
Generate a 2-dimensional torus embedded in Euclidean space.
Expand Down
1 change: 1 addition & 0 deletions src/sage/manifolds/chart.py
Original file line number Diff line number Diff line change
Expand Up @@ -3270,6 +3270,7 @@ def _plot_xx_list(xx_list, rem_coords, ranges, steps, number_values):

# *****************************************************************************


class CoordChange(SageObject):
r"""
Transition map between two charts of a topological manifold.
Expand Down
1 change: 1 addition & 0 deletions src/sage/manifolds/chart_func.py
Original file line number Diff line number Diff line change
Expand Up @@ -2613,6 +2613,7 @@ def collect_common_factors(self):
self._del_derived()
return self


class ChartFunctionRing(Parent, UniqueRepresentation):
"""
Ring of all chart functions on a chart.
Expand Down
1 change: 1 addition & 0 deletions src/sage/manifolds/continuous_map.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
from sage.categories.homset import Hom
from sage.categories.morphism import Morphism


class ContinuousMap(Morphism):
r"""
Continuous map between two topological manifolds.
Expand Down
1 change: 1 addition & 0 deletions src/sage/manifolds/continuous_map_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

from sage.manifolds.subset import ManifoldSubset


class ImageManifoldSubset(ManifoldSubset):
r"""
Subset of a topological manifold that is a continuous image of a manifold subset.
Expand Down
1 change: 1 addition & 0 deletions src/sage/manifolds/differentiable/affine_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
from sage.parallel.decorate import parallel
from sage.parallel.parallelism import Parallelism


class AffineConnection(SageObject):
r"""
Affine connection on a smooth manifold.
Expand Down
1 change: 1 addition & 0 deletions src/sage/manifolds/differentiable/automorphismfield.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
from sage.manifolds.differentiable.tensorfield import TensorField
from sage.manifolds.differentiable.tensorfield_paral import TensorFieldParal


class AutomorphismField(TensorField):
r"""
Field of automorphisms of tangent spaces to a generic (a priori
Expand Down
Loading

0 comments on commit bbbca89

Please sign in to comment.