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`. (2)
  • Loading branch information
gmou3 committed Jul 2, 2024
1 parent 7754584 commit 6964c2f
Show file tree
Hide file tree
Showing 99 changed files with 212 additions and 212 deletions.
2 changes: 1 addition & 1 deletion src/sage/combinat/bijectionist.py
Original file line number Diff line number Diff line change
Expand Up @@ -1071,7 +1071,7 @@ def _compute_possible_block_values(self):
This has to be called whenever ``self._P`` was modified.
It raises a :class:`ValueError`, if the restrictions on a
It raises a :exc:`ValueError`, if the restrictions on a
block are contradictory.
TESTS::
Expand Down
4 changes: 2 additions & 2 deletions src/sage/combinat/binary_recurrence_sequences.py
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,7 @@ def pthpowers(self, p, Bound):
A list of the indices of all ``p`` th powers less bounded by
``Bound``. If the sequence is degenerate and there are many
``p`` th powers, raises :class:`ValueError`.
``p`` th powers, raises :exc:`ValueError`.
EXAMPLES::
Expand All @@ -541,7 +541,7 @@ def pthpowers(self, p, Bound):
[1]
If the sequence is degenerate, and there are no ``p`` th powers, returns `[]`. Otherwise, if
there are many ``p`` th powers, raises :class:`ValueError`.
there are many ``p`` th powers, raises :exc:`ValueError`.
::
Expand Down
2 changes: 1 addition & 1 deletion src/sage/combinat/cartesian_product.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ def __len__(self):
An ``int``, the number of elements in the Cartesian product. If the
number of elements is infinite or does not fit into a python ``int``, a
:class:`TypeError` is raised.
:exc:`TypeError` is raised.
.. SEEALSO::
Expand Down
4 changes: 2 additions & 2 deletions src/sage/combinat/debruijn_sequence.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -263,15 +263,15 @@ class DeBruijnSequences(UniqueRepresentation, Parent):
TESTS:
Setting ``n`` or ``k`` to anything under 1 will return
a :class:`ValueError`::
a :exc:`ValueError`::
sage: DeBruijnSequences(3, 0).an_element()
Traceback (most recent call last):
...
ValueError: k and n cannot be under 1
Setting ``n`` or ``k`` to any type except an integer will return a
:class:`TypeError`::
:exc:`TypeError`::
sage: DeBruijnSequences(2.5, 3).an_element()
Traceback (most recent call last):
Expand Down
2 changes: 1 addition & 1 deletion src/sage/combinat/descent_algebra.py
Original file line number Diff line number Diff line change
Expand Up @@ -743,7 +743,7 @@ def one(self):
def one_basis(self):
"""
The element `1` is not (generally) a basis vector in the `I`
basis, thus this raises a :class:`TypeError`.
basis, thus this raises a :exc:`TypeError`.
EXAMPLES::
Expand Down
4 changes: 2 additions & 2 deletions src/sage/combinat/dyck_word.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ def replace_parens(x):
- If ``x`` is a closing parenthesis, replace ``x`` with the
constant ``close_symbol``.
- Raise a :class:`ValueError` if ``x`` is neither an opening nor a
- Raise a :exc:`ValueError` if ``x`` is neither an opening nor a
closing parenthesis.
.. SEEALSO:: :func:`replace_symbols`
Expand Down Expand Up @@ -170,7 +170,7 @@ def replace_symbols(x):
- If ``x`` is ``close_symbol``, replace ``x`` with ``')'``.
- If ``x`` is neither ``open_symbol`` nor ``close_symbol``, a
:class:`ValueError` is raised.
:exc:`ValueError` is raised.
.. SEEALSO:: :func:`replace_parens`
Expand Down
20 changes: 10 additions & 10 deletions src/sage/combinat/finite_state_machine.py
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,7 @@
...
ValueError: Invalid input sequence.

The raised :class:`ValueError` means `13` is not divisible by `3`.
The raised :exc:`ValueError` means `13` is not divisible by `3`.

.. _finite_state_machine_gray_code_example:

Expand Down Expand Up @@ -2064,7 +2064,7 @@ def _epsilon_cycle_output_empty_(self, fsm=None):

OUTPUT: boolean

A :class:`ValueError` is raised when ``self`` is not in an epsilon
A :exc:`ValueError` is raised when ``self`` is not in an epsilon
cycle.

TESTS::
Expand Down Expand Up @@ -2463,7 +2463,7 @@ def duplicate_transition_raise_error(old_transition, new_transition):
Alternative function for handling duplicate transitions in finite
state machines.

This implementation raises a :class:`ValueError`.
This implementation raises a :exc:`ValueError`.

See the documentation of the ``on_duplicate_transition`` parameter
of :class:`FiniteStateMachine`.
Expand All @@ -2475,7 +2475,7 @@ def duplicate_transition_raise_error(old_transition, new_transition):
- ``new_transition`` -- a transition, identical to ``old_transition``,
which is to be inserted into the finite state machine

OUTPUT: nothing. A :class:`ValueError` is raised
OUTPUT: nothing. A :exc:`ValueError` is raised

EXAMPLES::

Expand Down Expand Up @@ -2734,7 +2734,7 @@ class FiniteStateMachine(SageObject):
non-deterministic).

If the transition does not exist, the function should raise a
:class:`LookupError` or return an empty list.
:exc:`LookupError` or return an empty list.

When constructing a finite state machine in this way, some
initial states and an input alphabet have to be specified.
Expand Down Expand Up @@ -5345,7 +5345,7 @@ def state(self, state):

OUTPUT: the state of the finite state machine corresponding to ``state``

If no state is found, then a :class:`LookupError` is thrown.
If no state is found, then a :exc:`LookupError` is thrown.

EXAMPLES::

Expand Down Expand Up @@ -5389,7 +5389,7 @@ def transition(self, transition):
OUTPUT: the transition of the finite state machine corresponding
to ``transition``

If no transition is found, then a :class:`LookupError` is thrown.
If no transition is found, then a :exc:`LookupError` is thrown.

EXAMPLES::

Expand Down Expand Up @@ -7411,7 +7411,7 @@ def product_FiniteStateMachine(self, other, function,
for `j\in\{1, \ldots, d\}` and returns a pair ``(word_in, word_out)``
which is the label of the transition `A=(A_1, \ldots, A_d)` to `B=(B_1,
\ldots, B_d)`. If there is no transition from `A` to `B`,
then ``function`` should raise a :class:`LookupError`.
then ``function`` should raise a :exc:`LookupError`.

- ``new_input_alphabet`` -- (optional) the new input alphabet
as a list
Expand All @@ -7426,7 +7426,7 @@ def product_FiniteStateMachine(self, other, function,
the corresponding state in the new finite state machine. By
default, the final output is the empty word if both final
outputs of the constituent states are empty; otherwise, a
:class:`ValueError` is raised.
:exc:`ValueError` is raised.

- ``new_class`` -- class of the new finite state machine. By
default (``None``), the class of ``self`` is used
Expand Down Expand Up @@ -12397,7 +12397,7 @@ def process(self, *args, **kwargs):
- ``full_output`` -- boolean (default: ``True``); if set,
then the full output is given, otherwise only the generated
output (the third entry below only). If the input is not
accepted, a :class:`ValueError` is raised.
accepted, a :exc:`ValueError` is raised.

- ``always_include_output`` -- if set (not by default), always
include the output. This is inconsequential for a
Expand Down
2 changes: 1 addition & 1 deletion src/sage/combinat/free_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -720,7 +720,7 @@ def _element_constructor_(self, x):
The following originally used to yield ``p[[2]] # p[[2]]``, and if
there was no natural coercion between ``s`` and ``p``, this would
raise a :class:`NotImplementedError`.
raise a :exc:`NotImplementedError`.
Since :issue:`15305`, this takes the
coercion between ``s`` and ``p`` and lifts it to the tensor product. ::
Expand Down
2 changes: 1 addition & 1 deletion src/sage/combinat/fully_commutative_elements.py
Original file line number Diff line number Diff line change
Expand Up @@ -803,7 +803,7 @@ class FullyCommutativeElements(UniqueRepresentation, Parent):
True
Attempting to create an element from an input that is not the reduced word
of a fully commutative element throws a :class:`ValueError`::
of a fully commutative element throws a :exc:`ValueError`::
sage: FC([1,2,1])
Traceback (most recent call last):
Expand Down
2 changes: 1 addition & 1 deletion src/sage/combinat/integer_vectors_mod_permgroup.py
Original file line number Diff line number Diff line change
Expand Up @@ -1126,7 +1126,7 @@ def an_element(self):
r"""
Return an element of ``self``.
Raises an :class:`EmptySetError` when ``self`` is empty.
Raises an :exc:`EmptySetError` when ``self`` is empty.
EXAMPLES::
Expand Down
4 changes: 2 additions & 2 deletions src/sage/combinat/nu_dyck_word.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def replace_dyck_char(x):
- If ``x`` is a closing character, replace ``x`` with the
constant ``ndw_close_symbol``.
- Raise a :class:`ValueError` if ``x`` is neither an opening nor a
- Raise a :exc:`ValueError` if ``x`` is neither an opening nor a
closing character.
.. SEEALSO:: :func:`replace_dyck_symbol`
Expand Down Expand Up @@ -139,7 +139,7 @@ def replace_dyck_symbol(x, open_char='N', close_char='E') -> str:
- If ``x`` is ``ndw_close_symbol``, replace ``x`` with ``close_char``.
- If ``x`` is neither ``ndw_open_symbol`` nor ``ndw_close_symbol``, a
:class:`ValueError` is raised.
:exc:`ValueError` is raised.
.. SEEALSO:: :func:`replace_dyck_char`
Expand Down
8 changes: 4 additions & 4 deletions src/sage/combinat/partition.py
Original file line number Diff line number Diff line change
Expand Up @@ -3218,7 +3218,7 @@ def arm_length(self, i, j):
- ``i``, ``j`` -- two integers
OUTPUT: integer or a :class:`ValueError`
OUTPUT: integer or a :exc:`ValueError`
EXAMPLES::
Expand Down Expand Up @@ -3308,7 +3308,7 @@ def leg_length(self, i, j):
- ``i``, ``j`` -- two integers
OUTPUT: integer or a :class:`ValueError`
OUTPUT: integer or a :exc:`ValueError`
EXAMPLES::
Expand Down Expand Up @@ -6439,7 +6439,7 @@ def subset(self, *args, **kwargs):
r"""
Return ``self`` if no arguments are given.
Otherwise, it raises a :class:`ValueError`.
Otherwise, it raises a :exc:`ValueError`.
EXAMPLES::
Expand Down Expand Up @@ -9260,7 +9260,7 @@ def number_of_partitions(n, algorithm='default'):
sage: len(v)
7
The input must be a nonnegative integer or a :class:`ValueError` is raised.
The input must be a nonnegative integer or a :exc:`ValueError` is raised.
::
Expand Down
2 changes: 1 addition & 1 deletion src/sage/combinat/partition_algebra.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def _int_or_half_int(k):
OUTPUT:
If ``k`` is not in `1/2 \ZZ`, then this raises a :class:`ValueError`.
If ``k`` is not in `1/2 \ZZ`, then this raises a :exc:`ValueError`.
Otherwise, we return the pair:
- boolean; ``True`` if ``k`` is an integer and ``False`` if a half integer
Expand Down
2 changes: 1 addition & 1 deletion src/sage/combinat/partition_shifting_algebras.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def check(self, seq):
r"""
Verify that ``seq`` is a valid shifting sequence.
If it is not, raise a :class:`ValueError`.
If it is not, raise a :exc:`ValueError`.
EXAMPLES::
Expand Down
2 changes: 1 addition & 1 deletion src/sage/combinat/partition_tuple.py
Original file line number Diff line number Diff line change
Expand Up @@ -816,7 +816,7 @@ def diagram(self):

def pp(self):
r"""
Pretty prints this partition tuple. See :meth:`diagram`.
Pretty print this partition tuple. See :meth:`diagram`.
EXAMPLES::
Expand Down
2 changes: 1 addition & 1 deletion src/sage/combinat/perfect_matching.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ def __classcall_private__(cls, parts):
The function checks that the given list or permutation is
a valid perfect matching (i.e. a list of pairs with pairwise
disjoint elements or a fix point free involution) and raises
a :class:`ValueError` otherwise::
a :exc:`ValueError` otherwise::
sage: PerfectMatching([(1, 2, 3), (4, 5)])
Traceback (most recent call last):
Expand Down
2 changes: 1 addition & 1 deletion src/sage/combinat/ranker.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def rank_from_list(l):
sage: r('c')
2
For non elements a :class:`ValueError` is raised, as with the usual
For non elements a :exc:`ValueError` is raised, as with the usual
``index`` method of lists::
sage: r('blah')
Expand Down
4 changes: 2 additions & 2 deletions src/sage/combinat/regular_sequence.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ def __init__(self, parent, mu, left=None, right=None):
- ``allow_degenerated_sequence`` -- boolean (default: ``False``); if
set, then there will be no check if the input is a degenerated
sequence (see :meth:`is_degenerated`). Otherwise the input is checked
and a :class:`DegeneratedSequenceError` is raised if such a sequence
and a :exc:`DegeneratedSequenceError` is raised if such a sequence
is detected.
EXAMPLES::
Expand Down Expand Up @@ -493,7 +493,7 @@ def transposed(self, allow_degenerated_sequence=False):
- ``allow_degenerated_sequence`` -- boolean (default: ``False``); if
set, then there will be no check if the transposed sequence is a
degenerated sequence (see :meth:`is_degenerated`). Otherwise the
transposed sequence is checked and a :class:`DegeneratedSequenceError`
transposed sequence is checked and a :exc:`DegeneratedSequenceError`
is raised if such a sequence is detected.
OUTPUT: a :class:`RegularSequence`
Expand Down
4 changes: 2 additions & 2 deletions src/sage/combinat/skew_partition.py
Original file line number Diff line number Diff line change
Expand Up @@ -1578,7 +1578,7 @@ def from_row_and_column_length(self, rowL, colL):
- If it exists the unique skew-partitions with row lengths ``rowL``
and column lengths ``colL``.
- Raise a :class:`ValueError` if ``rowL`` and ``colL`` are not compatible.
- Raise a :exc:`ValueError` if ``rowL`` and ``colL`` are not compatible.
EXAMPLES::
Expand Down Expand Up @@ -1609,7 +1609,7 @@ def from_row_and_column_length(self, rowL, colL):
If some rows and columns have length zero, there is no way to retrieve
unambiguously the skew partition. We therefore raise
a :class:`ValueError`.
a :exc:`ValueError`.
For examples here are two skew partitions with the same row and column
lengths::
Expand Down
2 changes: 1 addition & 1 deletion src/sage/combinat/tableau_residues.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ def __init__(self, parent, residues, check):

def check(self):
r"""
Raise a :class:`ValueError` if ``self`` is not a residue sequence.
Raise a :exc:`ValueError` if ``self`` is not a residue sequence.
EXAMPLES::
Expand Down
2 changes: 1 addition & 1 deletion src/sage/game_theory/normal_form_game.py
Original file line number Diff line number Diff line change
Expand Up @@ -1586,7 +1586,7 @@ def obtain_nash(self, algorithm=False, maximization=True, solver=None):
[[(0, 0, 1, 0), (0, 0, 1)]]
Running the constant-sum solver on a game which is not a constant sum
game generates a :class:`ValueError`::
game generates a :exc:`ValueError`::
sage: cg = NormalFormGame([A, A])
sage: cg.obtain_nash(algorithm='lp', solver='glpk')
Expand Down
Loading

0 comments on commit 6964c2f

Please sign in to comment.