Skip to content

Commit 7d7e5e0

Browse files
committed
ruff UP details and links to errors in doc in geometry folder
1 parent e2e0f8d commit 7d7e5e0

27 files changed

+78
-86
lines changed

src/sage/geometry/cone.py

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# -*- coding: utf-8 -*-
21
r"""
32
Convex rational polyhedral cones
43
@@ -554,7 +553,7 @@ def _ambient_space_point(body, data):
554553
555554
An integral, rational, real algebraic, or numeric point of the
556555
ambient space of ``body`` is returned if ``data`` were
557-
successfully interpreted in such a way. A ``TypeError`` is raised
556+
successfully interpreted in such a way. A :class:`TypeError` is raised
558557
otherwise.
559558
560559
TESTS::
@@ -1664,7 +1663,7 @@ def _contains(self, point, region='whole cone'):
16641663
otherwise, in particular when ``point`` is incompatible with
16651664
the ambient space.
16661665
1667-
A ``ValueError`` is raised if ``region`` is not one of the
1666+
A :class:`ValueError` is raised if ``region`` is not one of the
16681667
three allowed values.
16691668
16701669
TESTS::
@@ -2340,8 +2339,8 @@ def embed(self, cone):
23402339
or
23412340
:meth:`~sage.geometry.cone.ConvexRationalPolyhedralCone.facet_of`. The
23422341
cone returned by this method will have ``self`` as ambient. If ``cone``
2343-
does not represent a valid cone of ``self``, ``ValueError`` exception
2344-
is raised.
2342+
does not represent a valid cone of ``self``, :class:`ValueError`
2343+
exception is raised.
23452344
23462345
.. NOTE::
23472346
@@ -3017,8 +3016,8 @@ def intersection(self, other):
30173016
30183017
- :class:`cone <ConvexRationalPolyhedralCone>`.
30193018
3020-
Raises ``ValueError`` if the ambient space dimensions are not
3021-
compatible.
3019+
This raises :class:`ValueError` if the ambient space dimensions
3020+
are not compatible.
30223021
30233022
EXAMPLES::
30243023
@@ -5349,7 +5348,7 @@ def random_element(self, ring=ZZ):
53495348
Either a lattice element or vector contained in both this cone
53505349
and its ambient vector space. If ``ring`` is ``ZZ``, a lattice
53515350
element is returned; otherwise a vector is returned. If ``ring``
5352-
is neither ``ZZ`` nor ``QQ``, then a ``NotImplementedError`` is
5351+
is neither ``ZZ`` nor ``QQ``, then a :class:`NotImplementedError` is
53535352
raised.
53545353
53555354
EXAMPLES:
@@ -6267,7 +6266,7 @@ def random_cone(lattice=None, min_ambient_dim=0, max_ambient_dim=None,
62676266
62686267
A new, randomly generated cone.
62696268
6270-
A ``ValueError`` will be thrown under the following conditions:
6269+
A :class:`ValueError` will be thrown under the following conditions:
62716270
62726271
* Any of ``min_ambient_dim``, ``max_ambient_dim``, ``min_rays``, or
62736272
``max_rays`` are negative.
@@ -6425,7 +6424,7 @@ def random_cone(lattice=None, min_ambient_dim=0, max_ambient_dim=None,
64256424
provided.
64266425
64276426
If the user requests too many rays in zero, one, or two dimensions,
6428-
a ``ValueError`` is thrown::
6427+
a :class:`ValueError` is thrown::
64296428
64306429
sage: random_cone(max_ambient_dim=0, min_rays=1)
64316430
Traceback (most recent call last):
@@ -6513,7 +6512,7 @@ def random_cone(lattice=None, min_ambient_dim=0, max_ambient_dim=None,
65136512
sage: random_cone(lattice=L, strictly_convex=True)
65146513
0-d cone in 0-d lattice L
65156514
6516-
A ``ValueError`` is thrown if a non-solid cone is requested in a
6515+
A :class:`ValueError` is thrown if a non-solid cone is requested in a
65176516
zero-dimensional lattice::
65186517
65196518
sage: L = ToricLattice(0)
@@ -6527,7 +6526,7 @@ def random_cone(lattice=None, min_ambient_dim=0, max_ambient_dim=None,
65276526
...
65286527
ValueError: all cones are solid when max_ambient_dim is zero.
65296528
6530-
A ``ValueError`` is thrown if a solid cone is requested but the
6529+
A :class:`ValueError` is thrown if a solid cone is requested but the
65316530
maximum number of rays is too few::
65326531
65336532
sage: random_cone(min_ambient_dim=4, max_rays=3, solid=True)
@@ -6542,7 +6541,7 @@ def random_cone(lattice=None, min_ambient_dim=0, max_ambient_dim=None,
65426541
ValueError: max_rays must be at least 5 for a solid cone in this
65436542
lattice.
65446543
6545-
A ``ValueError`` is thrown if a non-solid cone is requested but
6544+
A :class:`ValueError` is thrown if a non-solid cone is requested but
65466545
``min_rays`` guarantees a solid cone::
65476546
65486547
sage: random_cone(max_ambient_dim=4, min_rays=10, solid=False)

src/sage/geometry/fan.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1956,7 +1956,7 @@ def cone_containing(self, *points):
19561956
19571957
We think of the origin as of the smallest cone containing no rays
19581958
at all. If there is no ray in ``self`` that contains all ``rays``,
1959-
a ``ValueError`` exception will be raised.
1959+
a :class:`ValueError` exception will be raised.
19601960
19611961
EXAMPLES::
19621962
@@ -2352,8 +2352,8 @@ def embed(self, cone):
23522352
or
23532353
:meth:`~sage.geometry.cone.ConvexRationalPolyhedralCone.facet_of`. The
23542354
cone returned by this method will have ``self`` as ambient. If ``cone``
2355-
does not represent a valid cone of ``self``, ``ValueError`` exception
2356-
is raised.
2355+
does not represent a valid cone of ``self``, :class:`ValueError`
2356+
exception is raised.
23572357
23582358
.. NOTE::
23592359
@@ -3504,8 +3504,8 @@ def complex(self, base_ring=ZZ, extended=False):
35043504
OUTPUT:
35053505
35063506
The complex associated to the fan as a :class:`ChainComplex
3507-
<sage.homology.chain_complex.ChainComplex>`. Raises a
3508-
``ValueError`` if the extended complex is requested for a
3507+
<sage.homology.chain_complex.ChainComplex>`. This raises a
3508+
:class:`ValueError` if the extended complex is requested for a
35093509
non-complete fan.
35103510
35113511
EXAMPLES::

src/sage/geometry/fan_morphism.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -520,8 +520,8 @@ def _ray_index_map(self):
520520
domain fan is mapped to the origin. If it is `j`, then the `i`-th ray
521521
of the domain fan is mapped onto the `j`-th ray of the codomain fan.
522522
If there is a ray in the domain fan which is mapped into the relative
523-
interior of a higher dimensional cone, a ``ValueError`` exception is
524-
raised.
523+
interior of a higher dimensional cone, a :class:`ValueError`
524+
exception is raised.
525525
526526
.. NOTE::
527527
@@ -601,8 +601,8 @@ def _subdivide_domain_fan(self, check, verbose):
601601
OUTPUT:
602602
603603
- none, but the domain fan of self is replaced with its minimal
604-
refinement, if possible. Otherwise a ``ValueError`` exception is
605-
raised.
604+
refinement, if possible. Otherwise a :class:`ValueError`
605+
exception is raised.
606606
607607
TESTS::
608608
@@ -763,11 +763,11 @@ def _subdivide_domain_fan(self, check, verbose):
763763

764764
def _support_error(self):
765765
r"""
766-
Raise a ``ValueError`` exception due to support incompatibility.
766+
Raise a :class:`ValueError` exception due to support incompatibility.
767767
768768
OUTPUT:
769769
770-
- none, a ``ValueError`` exception is raised.
770+
- none, a :class:`ValueError` exception is raised.
771771
772772
TESTS:
773773
@@ -806,10 +806,10 @@ def _validate(self):
806806
807807
OUTPUT:
808808
809-
- none, but a ``ValueError`` exception is raised if there is a cone of
810-
the domain fan of ``self`` which is not completely contained in a
811-
single cone of the codomain fan of ``self``, or if one of these fans
812-
does not sit in the appropriate lattice.
809+
- none, but a :class:`ValueError` exception is raised if there is
810+
a cone of the domain fan of ``self`` which is not completely
811+
contained in a single cone of the codomain fan of ``self``,
812+
or if one of these fans does not sit in the appropriate lattice.
813813
814814
EXAMPLES::
815815

src/sage/geometry/hyperbolic_space/hyperbolic_coercion.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# -*- coding: utf-8 -*-
21
"""
32
Coercion Maps Between Hyperbolic Plane Models
43
@@ -82,7 +81,7 @@ def _call_(self, x):
8281
"""
8382
C = self.codomain()
8483
if not C.is_bounded() and self.domain().is_bounded() and x.is_boundary():
85-
msg = u"boundary points are not implemented for the {}"
84+
msg = "boundary points are not implemented for the {}"
8685
raise NotImplementedError(msg.format(C.name()))
8786

8887
y = self.image_coordinates(x.coordinates())

src/sage/geometry/hyperbolic_space/hyperbolic_geodesic.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# -*- coding: utf-8 -*-
21
r"""
32
Hyperbolic Geodesics
43
@@ -622,7 +621,7 @@ def is_parallel(self, other):
622621
def ideal_endpoints(self):
623622
r"""
624623
Return the ideal endpoints in bounded models. Raise a
625-
``NotImplementedError`` in models that are not bounded.
624+
:class:`NotImplementedError` in models that are not bounded.
626625
627626
EXAMPLES::
628627
@@ -660,7 +659,7 @@ def ideal_endpoints(self):
660659
def complete(self):
661660
r"""
662661
Return the geodesic with ideal endpoints in bounded models. Raise a
663-
``NotImplementedError`` in models that are not bounded.
662+
:class:`NotImplementedError` in models that are not bounded.
664663
In the following examples we represent complete geodesics by a dashed
665664
line.
666665
@@ -817,7 +816,7 @@ def common_perpendicula(self, other):
817816
r"""
818817
Return the unique hyperbolic geodesic perpendicular to two given
819818
geodesics, if such a geodesic exists. If none exists, raise a
820-
``ValueError``.
819+
:class:`ValueError`.
821820
822821
INPUT:
823822
@@ -1278,7 +1277,7 @@ def common_perpendicular(self, other):
12781277
r"""
12791278
Return the unique hyperbolic geodesic perpendicular to ``self``
12801279
and ``other``, if such a geodesic exists; otherwise raise a
1281-
``ValueError``.
1280+
:class:`ValueError`.
12821281
12831282
INPUT:
12841283

src/sage/geometry/hyperbolic_space/hyperbolic_interface.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# -*- coding: utf-8 -*-
21
r"""
32
Interface to Hyperbolic Models
43

src/sage/geometry/hyperbolic_space/hyperbolic_isometry.py

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# -*- coding: utf-8 -*-
21
r"""
32
Hyperbolic Isometries
43
@@ -489,7 +488,7 @@ def classification(self):
489488
def translation_length(self):
490489
r"""
491490
For hyperbolic elements, return the translation length;
492-
otherwise, raise a ``ValueError``.
491+
otherwise, raise a :class:`ValueError`.
493492
494493
EXAMPLES::
495494
@@ -512,7 +511,7 @@ def translation_length(self):
512511
def axis(self):
513512
r"""
514513
For a hyperbolic isometry, return the axis of the
515-
transformation; otherwise raise a ``ValueError``.
514+
transformation; otherwise raise a :class:`ValueError`.
516515
517516
EXAMPLES::
518517
@@ -593,7 +592,7 @@ def fixed_geodesic(self):
593592
def repelling_fixed_point(self):
594593
r"""
595594
For a hyperbolic isometry, return the attracting fixed point;
596-
otherwise raise a ``ValueError``.
595+
otherwise raise a :class:`ValueError`.
597596
598597
OUTPUT:
599598
@@ -612,7 +611,7 @@ def repelling_fixed_point(self):
612611
def attracting_fixed_point(self):
613612
r"""
614613
For a hyperbolic isometry, return the attracting fixed point;
615-
otherwise raise a `ValueError``.
614+
otherwise raise a :class:`ValueError`.
616615
617616
OUTPUT:
618617
@@ -735,7 +734,7 @@ def classification(self): #UHP
735734
def translation_length(self): #UHP
736735
r"""
737736
For hyperbolic elements, return the translation length;
738-
otherwise, raise a ``ValueError``.
737+
otherwise, raise a :class:`ValueError`.
739738
740739
EXAMPLES::
741740
@@ -843,9 +842,11 @@ def fixed_point_set(self): # UHP
843842
return self.domain().get_geodesic(*pts)
844843
return pts
845844

846-
def repelling_fixed_point(self): #UHP
845+
def repelling_fixed_point(self): # UHP
847846
r"""
848-
Return the repelling fixed point; otherwise raise a ``ValueError``.
847+
Return the repelling fixed point.
848+
849+
Otherwise, this raises a :class:`ValueError`.
849850
850851
OUTPUT:
851852
@@ -867,9 +868,11 @@ def repelling_fixed_point(self): #UHP
867868
return self.domain().get_point(infinity)
868869
return self.domain().get_point(v[0] / v[1])
869870

870-
def attracting_fixed_point(self): #UHP
871+
def attracting_fixed_point(self): # UHP
871872
r"""
872-
Return the attracting fixed point; otherwise raise a ``ValueError``.
873+
Return the attracting fixed point.
874+
875+
Otherwise, this raises a :class:`ValueError`.
873876
874877
OUTPUT:
875878

src/sage/geometry/hyperbolic_space/hyperbolic_model.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# -*- coding: utf-8 -*-
21
r"""
32
Hyperbolic Models
43
@@ -156,7 +155,7 @@ def _repr_(self): # Abstract
156155
sage: HyperbolicPlane().UHP()
157156
Hyperbolic plane in the Upper Half Plane Model
158157
"""
159-
return u'Hyperbolic plane in the {}'.format(self._name)
158+
return 'Hyperbolic plane in the {}'.format(self._name)
160159

161160
def _element_constructor_(self, x, is_boundary=None, **graphics_options): # Abstract
162161
"""
@@ -260,7 +259,7 @@ def point_in_model(self, p):
260259
def point_test(self, p): # Abstract
261260
r"""
262261
Test whether a point is in the model. If the point is in the
263-
model, do nothing. Otherwise, raise a ``ValueError``.
262+
model, do nothing. Otherwise, raise a :class:`ValueError`.
264263
265264
EXAMPLES::
266265
@@ -298,7 +297,7 @@ def boundary_point_in_model(self, p): # Abstract
298297
def bdry_point_test(self, p): # Abstract
299298
r"""
300299
Test whether a point is in the model. If the point is in the
301-
model, do nothing; otherwise raise a ``ValueError``.
300+
model, do nothing; otherwise raise a :class:`ValueError`.
302301
303302
EXAMPLES::
304303
@@ -340,7 +339,7 @@ def isometry_test(self, A): # Abstract
340339
Test whether an isometry ``A`` is in the model.
341340
342341
If the isometry is in the model, do nothing. Otherwise, raise
343-
a ``ValueError``.
342+
a :class:`ValueError`.
344343
345344
EXAMPLES::
346345
@@ -1173,7 +1172,7 @@ def __init__(self, space):
11731172
# name should really be 'Poincaré Disk Model', but utf8 is not
11741173
# accepted by repr
11751174
HyperbolicModel.__init__(self, space,
1176-
name=u'Poincare Disk Model', short_name="PD",
1175+
name='Poincare Disk Model', short_name="PD",
11771176
bounded=True, conformal=True, dimension=2,
11781177
isometry_group="PU(1, 1)",
11791178
isometry_group_is_projective=True)

src/sage/geometry/hyperbolic_space/hyperbolic_point.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# -*- coding: utf-8 -*-
21
r"""
32
Hyperbolic Points
43

src/sage/geometry/hyperplane_arrangement/arrangement.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# -*- coding: utf-8 -*-
21
r"""
32
Hyperplane Arrangements
43
@@ -2723,7 +2722,7 @@ def region_containing_point(self, p):
27232722
27242723
OUTPUT:
27252724
2726-
A polyhedron. A ``ValueError`` is raised if the point is not
2725+
A polyhedron. A :class:`ValueError` is raised if the point is not
27272726
interior to a region, that is, sits on a hyperplane.
27282727
27292728
EXAMPLES::

0 commit comments

Comments
 (0)