Skip to content

Commit

Permalink
Docstring edits
Browse files Browse the repository at this point in the history
:class:`SomeError` or ``SomeError`` to :exc:`SomeError`. (1)
  • Loading branch information
gmou3 committed Jul 2, 2024
1 parent 7ab69d4 commit 7754584
Show file tree
Hide file tree
Showing 100 changed files with 184 additions and 184 deletions.
2 changes: 1 addition & 1 deletion src/sage/algebras/commutative_dga.py
Original file line number Diff line number Diff line change
Expand Up @@ -2436,7 +2436,7 @@ def cohomology_generators(self, max_degree):
ALGORITHM:
Reduce a basis of the `n`'th cohomology modulo all the degree `n`
Reduce a basis of the `n`-th cohomology modulo all the degree `n`
products of the lower degree cohomologies.
EXAMPLES::
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -801,7 +801,7 @@ def maximal_ideal(self):
- :class:`~sage.algebras.finite_dimensional_algebras.finite_dimensional_algebra_ideal.FiniteDimensionalAlgebraIdeal`;
the unique maximal ideal of ``self``. If ``self`` is not a local
algebra, a :class:`ValueError` is raised.
algebra, a :exc:`ValueError` is raised.
EXAMPLES::
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class FiniteDimensionalAlgebraMorphism(RingHomomorphism_im_gens):
- ``f`` -- matrix of the underlying `k`-linear map
- ``unitary`` -- boolean (default: ``True``); if ``True`` and ``check``
is also ``True``, raise a :class:`ValueError` unless ``A`` and ``B`` are
is also ``True``, raise a :exc:`ValueError` unless ``A`` and ``B`` are
unitary and ``f`` respects unit elements
- ``check`` -- boolean (default: ``True``); check whether the given
Expand Down
2 changes: 1 addition & 1 deletion src/sage/algebras/free_algebra_quotient.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ def gen(self, i):
sage: H.gen(2)
k
An :class:`IndexError` is raised if an invalid generator is requested::
An :exc:`IndexError` is raised if an invalid generator is requested::
sage: H.gen(3)
Traceback (most recent call last):
Expand Down
2 changes: 1 addition & 1 deletion src/sage/algebras/fusion_rings/fusion_ring.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class FusionRing(WeylCharacterRing):
The cyclotomic order is an integer `N` such that all computations
will return elements of the cyclotomic field of `N`-th roots of unity.
Normally you will never need to change this but consider changing it
if :meth:`root_of_unity` raises a :class:`ValueError`.
if :meth:`root_of_unity` raises a :exc:`ValueError`.
This algebra has a basis (sometimes called *primary fields* but here
called *simple objects*) indexed by the weights of level `\leq k`.
Expand Down
2 changes: 1 addition & 1 deletion src/sage/algebras/fusion_rings/shm_managers.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ cdef class FvarsHandler:
.. NOTE::
If you ever encounter an :class:`OverflowError` when running the
If you ever encounter an :exc:`OverflowError` when running the
:meth:`FMatrix.find_orthogonal_solution` solver, consider
increasing the parameter ``n_bytes``.
Expand Down
2 changes: 1 addition & 1 deletion src/sage/algebras/lie_algebras/verma_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,7 @@ def _Hom_(self, Y, category=None, **options):
The sole purpose of this method is to construct the homset as a
:class:`~sage.algebras.lie_algebras.verma_module.VermaModuleHomset`.
If ``category`` is specified and is not a subcategory of
``self.category()``, a :class:`TypeError` is raised instead.
``self.category()``, a :exc:`TypeError` is raised instead.
This method is not meant to be called directly. Please use
:func:`sage.categories.homset.Hom` instead.
Expand Down
2 changes: 1 addition & 1 deletion src/sage/algebras/quatalg/quaternion_algebra.py
Original file line number Diff line number Diff line change
Expand Up @@ -3775,7 +3775,7 @@ def cyclic_right_subideals(self, p, alpha=None):
.. NOTE::
Currently, `p` must satisfy a bunch of conditions, or a
:class:`NotImplementedError` is raised. In particular, `p` must
:exc:`NotImplementedError` is raised. In particular, `p` must
be odd and unramified in the quaternion algebra, must be
coprime to the index of the right order in the maximal
order, and also coprime to the normal of ``self``. (The Brandt
Expand Down
6 changes: 3 additions & 3 deletions src/sage/arith/long.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ cdef inline long pyobject_to_long(x) except? LONG_MIN:
r"""
Given a Python object ``x`` cast it quickly to a C long.
A :class:`TypeError` is raised if the input cannot be converted to
A :exc:`TypeError` is raised if the input cannot be converted to
an integer or
an :class:`OverflowError` is raised if it does not fit into a C long.
an :exc:`OverflowError` is raised if it does not fit into a C long.
TESTS:
Expand Down Expand Up @@ -106,7 +106,7 @@ cdef inline bint integer_check_long(x, long* value, int* err) except -1:
- ``ERR_TYPE`` -- ``x`` is not an integer type of any kind
- ``ERR_INDEX`` -- ``x`` implements ``__index__`` but a :class:`TypeError`
- ``ERR_INDEX`` -- ``x`` implements ``__index__`` but a :exc:`TypeError`
was raised calling ``__index__()``
- Other exceptions in ``__index__`` are simply propagated. This is
Expand Down
10 changes: 5 additions & 5 deletions src/sage/arith/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def algdep(z, degree, known_bits=None, use_bits=None, known_digits=None,
is not found, then ``None`` will be returned. If ``proof=True`` then
the result is returned only if it can be proved correct (i.e. the
only possible minimal polynomial satisfying the height bound, or no
such polynomial exists). Otherwise a :class:`ValueError` is raised
such polynomial exists). Otherwise a :exc:`ValueError` is raised
indicating that higher precision is required.
ALGORITHM: Uses LLL for real/complex inputs, PARI C-library
Expand Down Expand Up @@ -4260,7 +4260,7 @@ def primitive_root(n, check=True):
"""
Return a positive integer that generates the multiplicative group
of integers modulo `n`, if one exists; otherwise, raise a
:class:`ValueError`.
:exc:`ValueError`.
A primitive root exists if `n=4` or `n=p^k` or `n=2p^k`, where `p`
is an odd prime and `k` is a nonnegative number.
Expand Down Expand Up @@ -5302,7 +5302,7 @@ def integer_trunc(i):
def two_squares(n):
"""
Write the integer `n` as a sum of two integer squares if possible;
otherwise raise a :class:`ValueError`.
otherwise raise a :exc:`ValueError`.
INPUT:
Expand Down Expand Up @@ -5424,7 +5424,7 @@ def two_squares(n):
def three_squares(n):
"""
Write the integer `n` as a sum of three integer squares if possible;
otherwise raise a :class:`ValueError`.
otherwise raise a :exc:`ValueError`.
INPUT:
Expand Down Expand Up @@ -5645,7 +5645,7 @@ def four_squares(n):
def sum_of_k_squares(k, n):
"""
Write the integer `n` as a sum of `k` integer squares if possible;
otherwise raise a :class:`ValueError`.
otherwise raise a :exc:`ValueError`.
INPUT:
Expand Down
2 changes: 1 addition & 1 deletion src/sage/arith/multi_modular.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ cdef class MultiModularBasis_base():
cdef mod_int _new_random_prime(self, set known_primes) except 1:
"""
Choose a new random prime for inclusion in the list of moduli,
or raise a :class:`RuntimeError` if there are no more primes.
or raise a :exc:`RuntimeError` if there are no more primes.
INPUT:
Expand Down
2 changes: 1 addition & 1 deletion src/sage/arith/rational_reconstruction.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ cdef int mpq_rational_reconstruction(mpq_t answer, mpz_t a, mpz_t m) except -1:
sqrt(m/2).
If `m` is zero, raise :class`ZeroDivisionError`. If the rational
reconstruction does not exist, raise :class:`ValueError`.
reconstruction does not exist, raise :exc:`ValueError`.
We assume that ``mpq_init`` has been called on ``answer``.
Expand Down
8 changes: 4 additions & 4 deletions src/sage/calculus/calculus.py
Original file line number Diff line number Diff line change
Expand Up @@ -962,10 +962,10 @@ def minpoly(ex, var='x', algorithm=None, bits=None, degree=None, epsilon=0):
If the minimal polynomial could not be found, two distinct kinds of
errors are raised. If no reasonable candidate was found with the
given ``bits``/``degree`` parameters, a :class:`ValueError` will be
given ``bits``/``degree`` parameters, a :exc:`ValueError` will be
raised. If a reasonable candidate was found but (perhaps due to
limits in the underlying symbolic package) was unable to be proved
correct, a :class:`NotImplementedError` will be raised.
correct, a :exc:`NotImplementedError` will be raised.
ALGORITHM: Two distinct algorithms are used, depending on the
algorithm parameter. By default, the numerical algorithm is
Expand All @@ -987,8 +987,8 @@ def minpoly(ex, var='x', algorithm=None, bits=None, degree=None, epsilon=0):
vanishing. If this fails, and ``epsilon`` is nonzero,
return `f` if and only if
`f(\mathtt{self}) < \mathtt{epsilon}`.
Otherwise raise a :class:`ValueError` (if no suitable
candidate was found) or a :class:`NotImplementedError` (if a
Otherwise raise a :exc:`ValueError` (if no suitable
candidate was found) or a :exc:`NotImplementedError` (if a
likely candidate was found but could not be proved correct).
EXAMPLES: First some simple examples::
Expand Down
2 changes: 1 addition & 1 deletion src/sage/calculus/var.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def var(*args, **kwds):
If a single symbolic variable was created, the variable
itself. Otherwise, a tuple of symbolic variables. The variable
names are checked to be valid Python identifiers and a
:class:`ValueError` is raised otherwise.
:exc:`ValueError` is raised otherwise.
EXAMPLES:
Expand Down
4 changes: 2 additions & 2 deletions src/sage/categories/category.py
Original file line number Diff line number Diff line change
Expand Up @@ -565,7 +565,7 @@ def an_instance(cls):
def __call__(self, x, *args, **opts):
"""
Construct an object in this category from the data in ``x``,
or throw :class:`TypeError` or :class:`NotImplementedError`.
or throw :exc:`TypeError` or :exc:`NotImplementedError`.
If ``x`` is readily in ``self`` it is returned unchanged.
Categories wishing to extend this minimal behavior should
Expand All @@ -583,7 +583,7 @@ def __call__(self, x, *args, **opts):
def _call_(self, x):
"""
Construct an object in this category from the data in ``x``,
or throw :class:`NotImplementedError`.
or throw :exc:`NotImplementedError`.
EXAMPLES::
Expand Down
2 changes: 1 addition & 1 deletion src/sage/categories/crystals.py
Original file line number Diff line number Diff line change
Expand Up @@ -579,7 +579,7 @@ def _Hom_(self, Y, category=None, **options):
The sole purpose of this method is to construct the homset
as a :class:`~sage.categories.crystals.CrystalHomset`. If
``category`` is specified and is not a subcategory of
:class:`Crystals`, a :class:`TypeError` is raised instead.
:class:`Crystals`, a :exc:`TypeError` is raised instead.
This method is not meant to be called directly. Please use
:func:`sage.categories.homset.Hom` instead.
Expand Down
8 changes: 4 additions & 4 deletions src/sage/categories/enumerated_sets.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ class EnumeratedSets(CategoryWithAxiom):
- ``iter(S)`` -- an iterator for the elements of the set;
- ``S.list()`` -- a fresh list of the elements of the set, when
possible; raises a :class:`NotImplementedError` if the list is
possible; raises a :exc:`NotImplementedError` if the list is
predictably too large to be expanded in memory.
- ``S.tuple()`` -- a tuple of the elements of the set, when
possible; raises a :class:`NotImplementedError` if the tuple is
possible; raises a :exc:`NotImplementedError` if the tuple is
predictably too large to be expanded in memory.
- ``S.unrank(n)`` -- the ``n``-th element of the set when ``n`` is a sage
Expand Down Expand Up @@ -183,7 +183,7 @@ def __iter__(self):
the methods of the first column are defined using ``__iter__``
If none of these are provided, this raises
a :class:`NotImplementedError`.
a :exc:`NotImplementedError`.
EXAMPLES:
Expand Down Expand Up @@ -928,7 +928,7 @@ def random_element(self):
the probability is uniform.
This is a generic implementation from the category
``EnumeratedSets()``. It raises a :class:`NotImplementedError`
``EnumeratedSets()``. It raises a :exc:`NotImplementedError`
since one does not know whether the set is finite.
EXAMPLES::
Expand Down
2 changes: 1 addition & 1 deletion src/sage/categories/facade_sets.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ def _an_element_(self):
For each parent ``self`` is a facade for, this default
implementation tries the method ``an_element`` until it finds an
element in ``self``. If none is found, this raises a
:class:`NotImplementedError`.
:exc:`NotImplementedError`.
EXAMPLES::
Expand Down
2 changes: 1 addition & 1 deletion src/sage/categories/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -811,7 +811,7 @@ def inverse_of_unit(self):
1/2
Trying to invert the zero element typically raises a
:class:`ZeroDivisionError`::
:exc:`ZeroDivisionError`::
sage: QQ(0).inverse_of_unit()
Traceback (most recent call last):
Expand Down
2 changes: 1 addition & 1 deletion src/sage/categories/filtered_modules_with_basis.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ def basis(self, d=None):
over Integer Ring(i))_{i in Partitions}
Checking this method on a filtered algebra. Note that this
will typically raise a :class:`NotImplementedError` when this
will typically raise a :exc:`NotImplementedError` when this
feature is not implemented. ::
sage: A = AlgebrasWithBasis(ZZ).Filtered().example()
Expand Down
2 changes: 1 addition & 1 deletion src/sage/categories/finite_groups.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ def conjugacy_classes(self):
This will eventually be a fall-back method for groups not defined
over GAP. Right now, it just raises a
:class:`NotImplementedError`, until we include a non-GAP
:exc:`NotImplementedError`, until we include a non-GAP
way of listing the conjugacy classes representatives.
EXAMPLES::
Expand Down
6 changes: 3 additions & 3 deletions src/sage/categories/finite_posets.py
Original file line number Diff line number Diff line change
Expand Up @@ -929,7 +929,7 @@ def birational_toggle(self, v, labelling):
encoded to be understood by Sage. This implementation allows
`\mathbf{K}` to be a semifield, not just a field. The birational
`v`-toggle is only a rational map, so an exception (most
likely, :class:`ZeroDivisionError`) will be thrown if the
likely, :exc:`ZeroDivisionError`) will be thrown if the
denominator is zero.
INPUT:
Expand Down Expand Up @@ -1150,7 +1150,7 @@ def birational_toggles(self, vs, labelling):
encoded to be understood by Sage. This implementation allows
`\mathbf{K}` to be a semifield, not just a field. The birational
`v`-toggle is only a rational map, so an exception (most
likely, :class:`ZeroDivisionError`) will be thrown if the
likely, :exc:`ZeroDivisionError`) will be thrown if the
denominator is zero.
INPUT:
Expand Down Expand Up @@ -1229,7 +1229,7 @@ def birational_rowmotion(self, labelling):
by Sage. This implementation allows `\mathbf{K}` to be a
semifield, not just a field. Birational rowmotion is only
a rational map, so an exception (most likely,
:class:`ZeroDivisionError`) will be thrown if the
:exc:`ZeroDivisionError`) will be thrown if the
denominator is zero.
INPUT:
Expand Down
2 changes: 1 addition & 1 deletion src/sage/categories/function_fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def super_categories(self):
def _call_(self, x):
r"""
Construct an object in this category from the data in ``x``,
or throw a ``TypeError``.
or throw a :exc:`TypeError`.
EXAMPLES::
Expand Down
8 changes: 4 additions & 4 deletions src/sage/categories/functor.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ cdef class Functor(SageObject):
default call method:
- ``_coerce_into_domain(self, x)`` -- return an object of ``self``'s
domain, corresponding to ``x``, or raise a :class:`TypeError`.
- Default: Raise :class:`TypeError` if ``x`` is not in ``self``'s domain.
domain, corresponding to ``x``, or raise a :exc:`TypeError`.
- Default: Raise :exc:`TypeError` if ``x`` is not in ``self``'s domain.
- ``_apply_functor(self, x)`` -- apply ``self`` to an object ``x`` of
``self``'s domain.
Expand Down Expand Up @@ -277,10 +277,10 @@ cdef class Functor(SageObject):
A subclass of :class:`Functor` may overload this method. It should
return an object of ``self``'s domain, and should raise a
:class:`TypeError` if this is impossible.
:exc:`TypeError` if this is impossible.
By default, the argument will not be changed, but a
:class:`TypeError` will be raised if the argument does not
:exc:`TypeError` will be raised if the argument does not
belong to the domain.
TESTS::
Expand Down
2 changes: 1 addition & 1 deletion src/sage/categories/hecke_modules.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def _Hom_(self, Y, category):
The sole purpose of this method is to construct the homset
as a :class:`~sage.modular.hecke.homspace.HeckeModuleHomspace`. If
``category`` is specified and is not a subcategory of
:class:`HeckeModules`, a :class:`TypeError` is raised instead
:class:`HeckeModules`, a :exc:`TypeError` is raised instead
This method is not meant to be called directly. Please use
:func:`sage.categories.homset.Hom` instead.
Expand Down
2 changes: 1 addition & 1 deletion src/sage/categories/highest_weight_crystals.py
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ def _Hom_(self, Y, category=None, **options):
The sole purpose of this method is to construct the homset as a
:class:`~sage.categories.highest_weight_crystals.HighestWeightCrystalHomset`.
If ``category`` is specified and is not a subcategory of
:class:`HighestWeightCrystals`, a :class:`TypeError` is raised
:class:`HighestWeightCrystals`, a :exc:`TypeError` is raised
instead
This method is not meant to be called directly. Please use
Expand Down
2 changes: 1 addition & 1 deletion src/sage/categories/homset.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ def Hom(X, Y, category=None, check=True):
A parent (or a parent class of a category) may specify how to
construct certain homsets by implementing a method ``_Hom_(self,
codomain, category)``. This method should either construct the
requested homset or raise a :class:`TypeError`. This hook is currently
requested homset or raise a :exc:`TypeError`. This hook is currently
mostly used to create homsets in some specific subclass of
:class:`Homset` (e.g. :class:`sage.rings.homset.RingHomset`)::
Expand Down
2 changes: 1 addition & 1 deletion src/sage/categories/infinite_enumerated_sets.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def _test_enumerated_set_iter_cardinality(self, **options):
* :meth:`.cardinality` is supposed to return ``infinity``
* :meth:`.list` is supposed to raise a :class:`NotImplementedError`.
* :meth:`.list` is supposed to raise a :exc:`NotImplementedError`.
EXAMPLES::
Expand Down
Loading

0 comments on commit 7754584

Please sign in to comment.