Skip to content

Commit 4dd6611

Browse files
author
Release Manager
committed
sagemathgh-37772: add links to standard errors in toric folder
adding links to standard python errors in the doc inside the `schemes/toric` folder plus a few pep8 cleanups ### 📝 Checklist - [x] The title is concise and informative. - [x] The description explains in detail what this PR is about. URL: sagemath#37772 Reported by: Frédéric Chapoton Reviewer(s): Matthias Köppe
2 parents 394f021 + fe72bba commit 4dd6611

10 files changed

+92
-94
lines changed

build/pkgs/configure/checksums.ini

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
tarball=configure-VERSION.tar.gz
2-
sha1=a8f26f365284ca719e583e703c5b8eeb656b35ab
3-
md5=612ba76c797d5fc92e272a59b1b7b2e6
4-
cksum=2444442853
2+
sha1=e00d37668d4c323478c575234b3e8513923c09f6
3+
md5=19845ef8465f120fb16811052483c0b1
4+
cksum=3911910914
+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
6d187b153b5b5c3e29fe07d9efe925e34bf5baa5
1+
86cd345f191738d8b40af5f0772173ff5ae49515

src/sage/schemes/toric/chow_group.py

+6-4
Original file line numberDiff line numberDiff line change
@@ -231,12 +231,14 @@ def _repr_(self) -> str:
231231

232232
def degree(self) -> int:
233233
r"""
234-
The degree of the Chow cycle.
234+
Return the degree of the Chow cycle.
235235
236236
OUTPUT:
237237
238238
Integer. The complex dimension of the subvariety representing
239-
the Chow cycle. Raises a ``ValueError`` if the Chow cycle is a
239+
the Chow cycle.
240+
241+
This raises a :class:`ValueError` if the Chow cycle is a
240242
sum of mixed degree cycles.
241243
242244
EXAMPLES::
@@ -355,7 +357,7 @@ def intersection_with_divisor(self, divisor):
355357
OUTPUT:
356358
357359
A new :class:`ChowCycle`. If the divisor is not Cartier then
358-
this method potentially raises a ``ValueError``, indicating
360+
this method potentially raises a :class:`ValueError`, indicating
359361
that the divisor cannot be made transversal to the Chow cycle.
360362
361363
EXAMPLES::
@@ -472,7 +474,7 @@ def cohomology_class(self):
472474
If the toric variety is not simplicial, that is, has worse
473475
than orbifold singularities, there is no way to associate a
474476
cohomology class of the correct degree. In this case,
475-
:meth:`cohomology_class` raises a ``ValueError``.
477+
:meth:`cohomology_class` raises a :class:`ValueError`.
476478
477479
EXAMPLES::
478480

src/sage/schemes/toric/divisor.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -568,7 +568,7 @@ def m(self, cone):
568568
returned.
569569
570570
- If there is no such vector (i.e. ``self`` is not even a
571-
`\QQ`-Cartier divisor), a ``ValueError`` is raised.
571+
`\QQ`-Cartier divisor), a :class:`ValueError` is raised.
572572
573573
EXAMPLES::
574574
@@ -774,7 +774,7 @@ def move_away_from(self, cone):
774774
.. NOTE::
775775
776776
A divisor that is Weil but not Cartier might be impossible
777-
to move away. In this case, a ``ValueError`` is raised.
777+
to move away. In this case, a :class:`ValueError` is raised.
778778
779779
EXAMPLES::
780780

src/sage/schemes/toric/divisor_class.pyx

+2-2
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ cdef class ToricRationalDivisorClass(Vector_rational_dense):
205205

206206
cpdef _dot_product_(self, Vector right):
207207
r"""
208-
Raise a ``TypeError`` exception.
208+
Raise a :class:`TypeError` exception.
209209
210210
Dot product is not defined on toric rational divisor classes.
211211
@@ -215,7 +215,7 @@ cdef class ToricRationalDivisorClass(Vector_rational_dense):
215215
216216
OUTPUT:
217217
218-
- ``TypeError`` exception is raised.
218+
A :class:`TypeError` exception is raised.
219219
220220
TESTS::
221221

src/sage/schemes/toric/ideal.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ class ToricIdeal(MPolynomialIdeal):
162162
163163
You may specify the ambient polynomial ring via the
164164
``polynomial_ring`` parameter or via the ``names`` and
165-
``base_ring`` parameter. A ``ValueError`` is raised if you
165+
``base_ring`` parameter. A :class:`ValueError` is raised if you
166166
specify both.
167167
168168
- ``algorithm`` -- string (optional). The algorithm to use. For

src/sage/schemes/toric/morphism.py

+18-15
Original file line numberDiff line numberDiff line change
@@ -522,7 +522,8 @@ def as_fan_morphism(self):
522522
523523
OUTPUT: A :class:`SchemeMorphism_polynomial_toric_variety`.
524524
525-
Raises a ``TypeError`` if the morphism cannot be written in such a way.
525+
This raises a :class:`TypeError` if the morphism cannot be written
526+
in such a way.
526527
527528
EXAMPLES::
528529
@@ -681,9 +682,10 @@ def as_polynomial_map(self):
681682
682683
OUTPUT:
683684
684-
A :class:`SchemeMorphism_polynomial_toric_variety`. Raises a
685-
``TypeError`` if the morphism cannot be written in terms of
686-
homogeneous polynomials.
685+
A :class:`SchemeMorphism_polynomial_toric_variety`.
686+
687+
This raises a :class:`TypeError` if the morphism cannot be
688+
written in terms of homogeneous polynomials.
687689
688690
The defining polynomials are not necessarily unique. There are
689691
choices if multiple ambient space ray generators project to
@@ -717,7 +719,7 @@ def as_polynomial_map(self):
717719
orbit = self.domain()
718720
codomain_fan = self.codomain().fan()
719721
R = orbit.coordinate_ring()
720-
polys = [ R.one() ] * codomain_fan.nrays()
722+
polys = [R.one()] * codomain_fan.nrays()
721723
for i in self._defining_cone.ambient_ray_indices():
722724
polys[i] = R.zero()
723725
ray_index_map = self._reverse_ray_map()
@@ -1071,8 +1073,8 @@ def as_polynomial_map(self):
10711073
10721074
OUTPUT: A :class:`SchemeMorphism_polynomial_toric_variety`.
10731075
1074-
Raises a ``TypeError`` if the morphism cannot be written in terms of
1075-
homogeneous polynomials.
1076+
This raises a :class:`TypeError` if the morphism cannot be written
1077+
in terms of homogeneous polynomials.
10761078
10771079
EXAMPLES::
10781080
@@ -1105,8 +1107,8 @@ def as_polynomial_map(self):
11051107
'homogeneous polynomials')
11061108
polys[i] *= x**d
11071109
if phi.domain_fan().virtual_rays():
1108-
raise NotImplementedError("polynomial representations for fans "
1109-
"with virtual rays are not implemented yet")
1110+
raise NotImplementedError("polynomial representations for fans with"
1111+
" virtual rays are not implemented yet")
11101112
return SchemeMorphism_polynomial_toric_variety(self.parent(), polys)
11111113

11121114
def is_bundle(self):
@@ -1478,7 +1480,7 @@ def fiber_component(self, domain_cone, multiplicity=False):
14781480
embedding = SchemeMorphism_fan_fiber_component_toric_variety(self, domain_cone)
14791481
if multiplicity:
14801482
return embedding.domain(), \
1481-
self.fan_morphism().index(embedding.base_cone())
1483+
self.fan_morphism().index(embedding.base_cone())
14821484
else:
14831485
return embedding.domain()
14841486

@@ -1610,7 +1612,7 @@ def is_union_in_fan(self, c0, c1):
16101612
except ValueError:
16111613
return False
16121614

1613-
m = matrix(ZZ, n, n, lambda i,j:is_union_in_fan(self,prim[i], prim[j]))
1615+
m = matrix(ZZ, n, n, lambda i, j: is_union_in_fan(self, prim[i], prim[j]))
16141616

16151617
for i in range(n):
16161618
m[i, i] = 0
@@ -1728,9 +1730,10 @@ def as_polynomial_map(self):
17281730
17291731
OUTPUT:
17301732
1731-
A :class:`SchemeMorphism_polynomial_toric_variety`. Raises a
1732-
``ValueError`` if the morphism cannot be written in terms of
1733-
homogeneous polynomials.
1733+
A :class:`SchemeMorphism_polynomial_toric_variety`.
1734+
1735+
This raises a :class:`ValueError` if the morphism cannot be
1736+
written in terms of homogeneous polynomials.
17341737
17351738
EXAMPLES::
17361739
@@ -1831,7 +1834,7 @@ def projection(ray):
18311834
star_rays = set()
18321835
for cone in fm.relative_star_generators(defining_cone):
18331836
star_rays.update(cone.rays())
1834-
projected_rays = [ projection(r) for r in cone.rays() ]
1837+
projected_rays = [projection(r) for r in cone.rays()]
18351838
cones.append(Cone(projected_rays))
18361839
fiber_fan = Fan(cones)
18371840

0 commit comments

Comments
 (0)