Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/sage/categories/sets_with_partial_maps.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,11 @@
from sage.categories.category_singleton import Category_singleton
from .objects import Objects


class SetsWithPartialMaps(Category_singleton):
"""
The category whose objects are sets and whose morphisms are
maps that are allowed to raise a ValueError on some inputs.
maps that are allowed to raise a :class:`ValueError` on some inputs.

This category is equivalent to the category of pointed sets,
via the equivalence sending an object X to X union {error},
Expand Down
4 changes: 2 additions & 2 deletions src/sage/graphs/generic_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -23178,9 +23178,9 @@ def automorphism_group(self, partition=None, verbosity=0,

TESTS:

We get a KeyError when given an invalid partition (:trac:`6087`)::
We get a :class:`KeyError` when given an invalid partition (:trac:`6087`)::

sage: g=graphs.CubeGraph(3)
sage: g = graphs.CubeGraph(3)
sage: g.relabel()
sage: g.automorphism_group(partition=[[0,1,2],[3,4,5]],algorithm='sage') # needs sage.groups
Traceback (most recent call last):
Expand Down
2 changes: 1 addition & 1 deletion src/sage/interfaces/axiom.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
clisp.

If the string "error" (case insensitive) occurs in the output of
anything from axiom, a RuntimeError exception is raised.
anything from axiom, a :class:`RuntimeError` exception is raised.

EXAMPLES: We evaluate a very simple expression in axiom.

Expand Down
2 changes: 1 addition & 1 deletion src/sage/interfaces/gap.py
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ def load_package(self, pkg, verbose=False):
"""
Load the Gap package with the given name.

If loading fails, raise a RuntimeError exception.
If loading fails, raise a :class:`RuntimeError` exception.

TESTS::

Expand Down
2 changes: 1 addition & 1 deletion src/sage/interfaces/giac.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@


If the string "error" (case insensitive) occurs in the output of
anything from Giac, a RuntimeError exception is raised.
anything from Giac, a :class:`RuntimeError` exception is raised.

Tutorial
--------
Expand Down
2 changes: 1 addition & 1 deletion src/sage/interfaces/maple.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
(x-y)*(x^4+x^3*y+x^2*y^2+x*y^3+y^4)

If the string "error" (case insensitive) occurs in the output of
anything from Maple, a RuntimeError exception is raised.
anything from Maple, a :class:`RuntimeError` exception is raised.

Tutorial
--------
Expand Down
2 changes: 1 addition & 1 deletion src/sage/interfaces/maxima.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
<class 'sage.interfaces.maxima.Maxima'>

If the string "error" (case insensitive) occurs in the output of
anything from Maxima, a RuntimeError exception is raised.
anything from Maxima, a :class:`RuntimeError` exception is raised.

EXAMPLES: We evaluate a very simple expression in Maxima.

Expand Down
2 changes: 1 addition & 1 deletion src/sage/interfaces/mwrank.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ def eval(self, s, **kwds):

.. NOTE::

If a RuntimeError exception is raised, then the mwrank
If a :class:`RuntimeError` exception is raised, then the mwrank
interface is restarted and the command is retried once.

EXAMPLES::
Expand Down
2 changes: 1 addition & 1 deletion src/sage/libs/gap/libgap.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ class Gap(Parent):

def load_package(self, pkg):
"""
If loading fails, raise a RuntimeError exception.
If loading fails, raise a :class:`RuntimeError` exception.

TESTS::

Expand Down
8 changes: 4 additions & 4 deletions src/sage/matrix/matrix0.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ cdef class Matrix(sage.structure.element.Matrix):
"""
This function gets called when you're about to change this matrix.

If self is immutable, a ValueError is raised, since you should
If self is immutable, a :class:`ValueError` is raised, since you should
never change a mutable matrix.

If self is mutable, the cache of results about self is deleted.
Expand All @@ -406,10 +406,10 @@ cdef class Matrix(sage.structure.element.Matrix):
cdef check_bounds_and_mutability(self, Py_ssize_t i, Py_ssize_t j):
"""
This function gets called when you're about to set the i,j entry of
this matrix. If i or j is out of range, an IndexError exception is
raised.
this matrix. If i or j is out of range, an :class:`IndexError`
exception is raised.

If self is immutable, a ValueError is raised, since you should
If self is immutable, a :class:`ValueError` is raised, since you should
never change a mutable matrix.

If self is mutable, the cache of results about self is deleted.
Expand Down
4 changes: 2 additions & 2 deletions src/sage/matrix/matrix_integer_dense.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -1712,8 +1712,8 @@ cdef class Matrix_integer_dense(Matrix_dense):
Return a pair (F, C) such that the rows of C form a symplectic
basis for self and ``F = C * self * C.transpose()``.

Raise a ValueError if self is not anti-symmetric, or self is not
alternating.
Raise a :class:`ValueError` if self is not anti-symmetric,
or self is not alternating.

Anti-symmetric means that `M = -M^t`. Alternating means
that the diagonal of `M` is identically zero.
Expand Down
29 changes: 15 additions & 14 deletions src/sage/modular/abvar/abvar.py
Original file line number Diff line number Diff line change
Expand Up @@ -580,9 +580,11 @@ def newform_decomposition(self, names=None):
def newform_label(self):
"""
Return the label [level][isogeny class][group] of the newform
`f` such that this abelian variety is isogenous to the
newform abelian variety `A_f`. If this abelian variety is
not simple, raise a ValueError.
`f` such that this abelian variety is isogenous to the newform
abelian variety `A_f`.

If this abelian variety is not simple, this raises
a :class:`ValueError`.

OUTPUT: string

Expand Down Expand Up @@ -687,8 +689,10 @@ def elliptic_curve(self):
def _isogeny_to_newform_abelian_variety(self):
r"""
Return an isogeny from self to an abelian variety `A_f`
attached to a newform. If self is not simple (so that no such
isogeny exists), raise a ValueError.
attached to a newform.

If self is not simple (so that no such
isogeny exists), this raises a :class:`ValueError`.

EXAMPLES::

Expand Down Expand Up @@ -733,13 +737,12 @@ def _simple_isogeny(self, other):
"""
Given self and other, if both are simple, and correspond to the
same newform with the same congruence subgroup, return an isogeny.
Otherwise, raise a ValueError.

INPUT:
Otherwise, this raises a :class:`ValueError`.

INPUT:

- ``self, other`` - modular abelian varieties

- ``self, other`` -- modular abelian varieties

OUTPUT: an isogeny

Expand Down Expand Up @@ -3183,7 +3186,7 @@ def degen_t(self, none_if_not_known=False):
`(t,N)`, where `N` is the ambient level and
`t` is an integer that divides the quotient of `N`
by the newform level. This function returns the tuple
`(t,N)`, or raises a ValueError if self isn't simple.
`(t,N)`, or raises a :class:`ValueError` if self is not simple.

.. note::

Expand Down Expand Up @@ -3235,16 +3238,14 @@ def isogeny_number(self, none_if_not_known=False):
"""
Return the number (starting at 0) of the isogeny class of new
simple abelian varieties that self is in. If self is not simple,
raises a ValueError exception.
raises a :class:`ValueError` exception.

INPUT:


- ``none_if_not_known`` - bool (default: False); if
- ``none_if_not_known`` -- bool (default: False); if
True then this function may return None instead of True of False if
we don't already know the isogeny number of self.


EXAMPLES: We test the none_if_not_known flag first::

sage: J0(33).isogeny_number(none_if_not_known=True) is None
Expand Down
4 changes: 2 additions & 2 deletions src/sage/modular/modsym/p1list.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -1371,8 +1371,8 @@ def lift_to_sl2z(c, d, N):
sage: lift_to_sl2z(2,3,6000000)
[1, 1, 2, 3]

You will get a ValueError exception if the input is invalid. Note
that here gcd(15,6,24)=3::
You will get a :class:`ValueError` exception if the input is invalid.
Note that here gcd(15,6,24)=3::

sage: lift_to_sl2z(15,6,24)
Traceback (most recent call last):
Expand Down
7 changes: 5 additions & 2 deletions src/sage/rings/finite_rings/integer_mod.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -646,11 +646,14 @@ cdef class IntegerMod_abstract(FiniteRingElement):
``R`` is the parent of ``self``.


OUTPUT: Integer `x` such that `b^x = a`, if this exists; a ValueError otherwise.
OUTPUT:

Integer `x` such that `b^x = a`, if this exists; a :class:`ValueError`
otherwise.

.. NOTE::

The algorithm first factors the modulus, then invokes Pari's ``znlog``
The algorithm first factors the modulus, then invokes Pari's :pari:`znlog`
function for each odd prime power in the factorization of the modulus.
This method can be quite slow for large moduli.

Expand Down
3 changes: 2 additions & 1 deletion src/sage/rings/integer.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -2326,7 +2326,8 @@ cdef class Integer(sage.structure.element.EuclideanDomainElement):
OUTPUT:

If ``truncate_mode`` is 0 (default), then returns the exact n'th root
if ``self`` is an n'th power, or raises a ValueError if it is not.
if ``self`` is an n'th power, or raises a :class:`ValueError`
if it is not.

If ``truncate_mode`` is 1, then if either ``n`` is odd or ``self`` is
positive, returns a pair ``(root, exact_flag)`` where ``root`` is the
Expand Down
3 changes: 2 additions & 1 deletion src/sage/rings/padics/padic_extension_generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,8 @@ def exact_ring(self):
"""
Return the order with the same defining polynomial.

Will raise a ValueError if the coefficients of the defining polynomial are not integral.
Will raise a :class:`ValueError` if the coefficients of the defining
polynomial are not integral.

EXAMPLES::

Expand Down
3 changes: 2 additions & 1 deletion src/sage/rings/padics/padic_floating_point_element.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,8 @@ cdef class pAdicFloatingPointElement(FPElement):
precision. If a rational is returned, its denominator will equal
``p^ordp(self)``.

This method will raise a ValueError when this element is infinity.
This method will raise a :class:`ValueError` when this element
is infinity.

EXAMPLES::

Expand Down
20 changes: 10 additions & 10 deletions src/sage/rings/power_series_ring_element.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -1510,21 +1510,21 @@ cdef class PowerSeries(AlgebraElement):

INPUT:

- ``prec`` - integer (default: None): if not None and the series
has infinite precision, truncates series at precision
prec.
- ``prec`` - integer (default: ``None``): if not ``None``
and the series has infinite precision, truncates series at
precision prec.

- ``extend`` - bool (default: False); if True, return a square
- ``extend`` - bool (default: ``False``); if ``True``, return a square
root in an extension ring, if necessary. Otherwise, raise
a ValueError if the square root is not in the base power series
ring. For example, if ``extend`` is True the square root of a
power series with odd degree leading coefficient is
defined as an element of a formal extension ring.
a :class:`ValueError` if the square root is not in the
base power series ring. For example, if ``extend`` is ``True``
the square root of a power series with odd degree leading
coefficient is defined as an element of a formal extension ring.

- ``name`` - string; if ``extend`` is True, you must also specify the print
- ``name`` - string; if ``extend`` is ``True``, you must also specify the print
name of the formal square root.

- ``all`` - bool (default: False); if True, return all square
- ``all`` - bool (default: ``False``); if ``True``, return all square
roots of self, instead of just one.

ALGORITHM: Newton's method
Expand Down
4 changes: 2 additions & 2 deletions src/sage/schemes/curves/projective_curve.py
Original file line number Diff line number Diff line change
Expand Up @@ -2009,7 +2009,7 @@ def _points_via_singular(self, sort=True):
.. note::

The Brill-Noether package does not always work (i.e., the
'bn' algorithm. When it fails a RuntimeError exception is
'bn' algorithm. When it fails a :class:`RuntimeError` exception is
raised.
"""
f = self.defining_polynomial()._singular_()
Expand Down Expand Up @@ -2150,7 +2150,7 @@ def rational_points(self, algorithm="enum", sort=True):
.. NOTE::

The Brill-Noether package does not always work (i.e., the 'bn'
algorithm. When it fails a RuntimeError exception is raised.
algorithm. When it fails a :class:`RuntimeError` exception is raised.

EXAMPLES::

Expand Down
2 changes: 1 addition & 1 deletion src/sage/schemes/elliptic_curves/ell_generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -729,7 +729,7 @@ def lift_x(self, x, all=False, extend=False):

- ``all`` (bool, default False) -- if True, return a (possibly
empty) list of all points; if False, return just one point,
or raise a ValueError if there are none.
or raise a :class:`ValueError` if there are none.

- ``extend`` (bool, default False) --

Expand Down
2 changes: 1 addition & 1 deletion src/sage/schemes/elliptic_curves/ell_number_field.py
Original file line number Diff line number Diff line change
Expand Up @@ -2256,7 +2256,7 @@ def rank(self, **kwds):

If the upper and lower bounds given by Simon two-descent are
the same, then the rank has been uniquely identified and we
return this. Otherwise, we raise a ValueError with an error
return this. Otherwise, we raise a :class:`ValueError` with an error
message specifying the upper and lower bounds.

.. NOTE::
Expand Down
2 changes: 1 addition & 1 deletion src/sage/schemes/elliptic_curves/gal_reps_number_field.py
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ def _non_surjective(E, patience=100):

- ``list`` -- A list of primes where mod-`p` representation is very likely
not surjective. At any prime not in this list, the representation is
definitely surjective. If E has CM, a ValueError is raised.
definitely surjective. If E has CM, a :class:`ValueError` is raised.

EXAMPLES::

Expand Down
12 changes: 6 additions & 6 deletions src/sage/schemes/elliptic_curves/period_lattice.py
Original file line number Diff line number Diff line change
Expand Up @@ -813,14 +813,14 @@ def is_real(self):
"""
return self.real_flag != 0

def is_rectangular(self):
def is_rectangular(self) -> bool:
r"""
Return True if this period lattice is rectangular.
Return ``True`` if this period lattice is rectangular.

.. NOTE::

Only defined for real lattices; a RuntimeError is raised for
non-real lattices.
Only defined for real lattices; a :class:`RuntimeError`
is raised for non-real lattices.

EXAMPLES::

Expand Down Expand Up @@ -864,8 +864,8 @@ def real_period(self, prec=None, algorithm='sage'):

.. NOTE::

Only defined for real lattices; a RuntimeError is raised for
non-real lattices.
Only defined for real lattices; a :class:`RuntimeError`
is raised for non-real lattices.

EXAMPLES::

Expand Down
4 changes: 2 additions & 2 deletions src/sage/tensor/modules/tensor_with_indices.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,8 +258,8 @@ def _parse_indices(indices, tensor_type=None, allow_contraction=True,
indices.

Parse ``indices`` checking usual conventions on repeating indices,
wildcard, balanced parentheses/brackets and raises a ValueError if not.
Return a couple contravariant/covariant indices.
wildcard, balanced parentheses/brackets and raises a :class:`ValueError`
if not. Return a couple contravariant/covariant indices.

INPUT:

Expand Down