Skip to content

Commit

Permalink
gh-37772: add links to standard errors in toric folder
Browse files Browse the repository at this point in the history
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: #37772
Reported by: Frédéric Chapoton
Reviewer(s): Matthias Köppe
  • Loading branch information
Release Manager committed Apr 11, 2024
2 parents 394f021 + fe72bba commit 4dd6611
Show file tree
Hide file tree
Showing 10 changed files with 92 additions and 94 deletions.
6 changes: 3 additions & 3 deletions build/pkgs/configure/checksums.ini
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
tarball=configure-VERSION.tar.gz
sha1=a8f26f365284ca719e583e703c5b8eeb656b35ab
md5=612ba76c797d5fc92e272a59b1b7b2e6
cksum=2444442853
sha1=e00d37668d4c323478c575234b3e8513923c09f6
md5=19845ef8465f120fb16811052483c0b1
cksum=3911910914
2 changes: 1 addition & 1 deletion build/pkgs/configure/package-version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6d187b153b5b5c3e29fe07d9efe925e34bf5baa5
86cd345f191738d8b40af5f0772173ff5ae49515
10 changes: 6 additions & 4 deletions src/sage/schemes/toric/chow_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,12 +231,14 @@ def _repr_(self) -> str:

def degree(self) -> int:
r"""
The degree of the Chow cycle.
Return the degree of the Chow cycle.
OUTPUT:
Integer. The complex dimension of the subvariety representing
the Chow cycle. Raises a ``ValueError`` if the Chow cycle is a
the Chow cycle.
This raises a :class:`ValueError` if the Chow cycle is a
sum of mixed degree cycles.
EXAMPLES::
Expand Down Expand Up @@ -355,7 +357,7 @@ def intersection_with_divisor(self, divisor):
OUTPUT:
A new :class:`ChowCycle`. If the divisor is not Cartier then
this method potentially raises a ``ValueError``, indicating
this method potentially raises a :class:`ValueError`, indicating
that the divisor cannot be made transversal to the Chow cycle.
EXAMPLES::
Expand Down Expand Up @@ -472,7 +474,7 @@ def cohomology_class(self):
If the toric variety is not simplicial, that is, has worse
than orbifold singularities, there is no way to associate a
cohomology class of the correct degree. In this case,
:meth:`cohomology_class` raises a ``ValueError``.
:meth:`cohomology_class` raises a :class:`ValueError`.
EXAMPLES::
Expand Down
4 changes: 2 additions & 2 deletions src/sage/schemes/toric/divisor.py
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,7 @@ def m(self, cone):
returned.
- If there is no such vector (i.e. ``self`` is not even a
`\QQ`-Cartier divisor), a ``ValueError`` is raised.
`\QQ`-Cartier divisor), a :class:`ValueError` is raised.
EXAMPLES::
Expand Down Expand Up @@ -774,7 +774,7 @@ def move_away_from(self, cone):
.. NOTE::
A divisor that is Weil but not Cartier might be impossible
to move away. In this case, a ``ValueError`` is raised.
to move away. In this case, a :class:`ValueError` is raised.
EXAMPLES::
Expand Down
4 changes: 2 additions & 2 deletions src/sage/schemes/toric/divisor_class.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ cdef class ToricRationalDivisorClass(Vector_rational_dense):

cpdef _dot_product_(self, Vector right):
r"""
Raise a ``TypeError`` exception.
Raise a :class:`TypeError` exception.
Dot product is not defined on toric rational divisor classes.
Expand All @@ -215,7 +215,7 @@ cdef class ToricRationalDivisorClass(Vector_rational_dense):
OUTPUT:
- ``TypeError`` exception is raised.
A :class:`TypeError` exception is raised.
TESTS::
Expand Down
2 changes: 1 addition & 1 deletion src/sage/schemes/toric/ideal.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ class ToricIdeal(MPolynomialIdeal):
You may specify the ambient polynomial ring via the
``polynomial_ring`` parameter or via the ``names`` and
``base_ring`` parameter. A ``ValueError`` is raised if you
``base_ring`` parameter. A :class:`ValueError` is raised if you
specify both.
- ``algorithm`` -- string (optional). The algorithm to use. For
Expand Down
33 changes: 18 additions & 15 deletions src/sage/schemes/toric/morphism.py
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,8 @@ def as_fan_morphism(self):
OUTPUT: A :class:`SchemeMorphism_polynomial_toric_variety`.
Raises a ``TypeError`` if the morphism cannot be written in such a way.
This raises a :class:`TypeError` if the morphism cannot be written
in such a way.
EXAMPLES::
Expand Down Expand Up @@ -681,9 +682,10 @@ def as_polynomial_map(self):
OUTPUT:
A :class:`SchemeMorphism_polynomial_toric_variety`. Raises a
``TypeError`` if the morphism cannot be written in terms of
homogeneous polynomials.
A :class:`SchemeMorphism_polynomial_toric_variety`.
This raises a :class:`TypeError` if the morphism cannot be
written in terms of homogeneous polynomials.
The defining polynomials are not necessarily unique. There are
choices if multiple ambient space ray generators project to
Expand Down Expand Up @@ -717,7 +719,7 @@ def as_polynomial_map(self):
orbit = self.domain()
codomain_fan = self.codomain().fan()
R = orbit.coordinate_ring()
polys = [ R.one() ] * codomain_fan.nrays()
polys = [R.one()] * codomain_fan.nrays()
for i in self._defining_cone.ambient_ray_indices():
polys[i] = R.zero()
ray_index_map = self._reverse_ray_map()
Expand Down Expand Up @@ -1071,8 +1073,8 @@ def as_polynomial_map(self):
OUTPUT: A :class:`SchemeMorphism_polynomial_toric_variety`.
Raises a ``TypeError`` if the morphism cannot be written in terms of
homogeneous polynomials.
This raises a :class:`TypeError` if the morphism cannot be written
in terms of homogeneous polynomials.
EXAMPLES::
Expand Down Expand Up @@ -1105,8 +1107,8 @@ def as_polynomial_map(self):
'homogeneous polynomials')
polys[i] *= x**d
if phi.domain_fan().virtual_rays():
raise NotImplementedError("polynomial representations for fans "
"with virtual rays are not implemented yet")
raise NotImplementedError("polynomial representations for fans with"
" virtual rays are not implemented yet")
return SchemeMorphism_polynomial_toric_variety(self.parent(), polys)

def is_bundle(self):
Expand Down Expand Up @@ -1478,7 +1480,7 @@ def fiber_component(self, domain_cone, multiplicity=False):
embedding = SchemeMorphism_fan_fiber_component_toric_variety(self, domain_cone)
if multiplicity:
return embedding.domain(), \
self.fan_morphism().index(embedding.base_cone())
self.fan_morphism().index(embedding.base_cone())
else:
return embedding.domain()

Expand Down Expand Up @@ -1610,7 +1612,7 @@ def is_union_in_fan(self, c0, c1):
except ValueError:
return False

m = matrix(ZZ, n, n, lambda i,j:is_union_in_fan(self,prim[i], prim[j]))
m = matrix(ZZ, n, n, lambda i, j: is_union_in_fan(self, prim[i], prim[j]))

for i in range(n):
m[i, i] = 0
Expand Down Expand Up @@ -1728,9 +1730,10 @@ def as_polynomial_map(self):
OUTPUT:
A :class:`SchemeMorphism_polynomial_toric_variety`. Raises a
``ValueError`` if the morphism cannot be written in terms of
homogeneous polynomials.
A :class:`SchemeMorphism_polynomial_toric_variety`.
This raises a :class:`ValueError` if the morphism cannot be
written in terms of homogeneous polynomials.
EXAMPLES::
Expand Down Expand Up @@ -1831,7 +1834,7 @@ def projection(ray):
star_rays = set()
for cone in fm.relative_star_generators(defining_cone):
star_rays.update(cone.rays())
projected_rays = [ projection(r) for r in cone.rays() ]
projected_rays = [projection(r) for r in cone.rays()]
cones.append(Cone(projected_rays))
fiber_fan = Fan(cones)

Expand Down
Loading

0 comments on commit 4dd6611

Please sign in to comment.