Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
13 changes: 6 additions & 7 deletions docs/source/data-structures/presentations/to-inverse-present.rst
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,7 @@ of the returned :any:`InversePresentation` will be :math:`\{0, 1, \dots, n-1, n,
\dots, 2n-1\}`, where the inverse of letter :math:`i` is the letter :math:`i +
n\, (\text{mod }2n)`.

This function throws a :any:`LibsemigroupsError` if
``p.throw_if_bad_alphabet_or_rules()`` throws.
This function raises an exception if ``p.throw_if_bad_alphabet_or_rules()`` does.

.. seealso::

Expand Down Expand Up @@ -119,9 +118,9 @@ letter is of type ``str``, then the conversion from one type to another is
of type ``list[int]``, then the conversion from one type to another is
:math:`a_i \mapsto` ``human_readable_letter(a_i)``.

This function throws a :any:`LibsemigroupsError` if the type of words in *ip* is
not the same as that specified in *rtype* and
``p.throw_if_bad_alphabet_rules_or_inverses()`` throws.
This function raises a :any:`LibsemigroupsError` if the type of words in *ip* is
not the same as that specified in *rtype* or
``p.throw_if_bad_alphabet_rules_or_inverses()`` raises.

.. seealso::

Expand Down Expand Up @@ -177,8 +176,8 @@ This function returns an :any:`InversePresentation` equivalent to the input
parameter *f* specifies how to map the letters of one :any:`InversePresentation`
to the other.

This function throws a :any:`LibsemigroupsError` if
``ip.throw_if_bad_alphabet_rules_or_inverses()`` throws, or if the function
This function raises a :any:`LibsemigroupsError` if
``ip.throw_if_bad_alphabet_rules_or_inverses()`` raises, or if the function
specified by *f* does not map letters of the type used in *ip* to letters of the
type of word specified in *rtype*.

Expand Down
10 changes: 5 additions & 5 deletions docs/source/data-structures/presentations/to-present.rst
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@ letter is of type ``str``, then the conversion from one type to another is
of type ``list[int]``, then the conversion from one type to another is
:math:`a_i \mapsto` ``human_readable_letter(a_i)``.

This function throws a :any:`LibsemigroupsError` if the type of words in *p* is
not the same as that specified in *rtype*, and
``p.throw_if_bad_alphabet_or_rules()`` throws.
This function raises a :any:`LibsemigroupsError` if the type of words in *p* is
not the same as that specified in *rtype*, or
``p.throw_if_bad_alphabet_or_rules()`` raises.

.. seealso::

Expand Down Expand Up @@ -128,8 +128,8 @@ example, can be used to convert from :any:`str` to :any:`int`). The second
parameter *f* specifies how to map the letters of one :any:`Presentation` to the
other.

This function throws a :any:`LibsemigroupsError` if
``p.throw_if_bad_alphabet_or_rules()`` throws, or if the function specified by
This function raises a :any:`LibsemigroupsError` if
``p.throw_if_bad_alphabet_or_rules()`` raises, or if the function specified by
*f* does not map letters of the type used in *p* to letters of the type of word
specified in *rtype*.

Expand Down
12 changes: 6 additions & 6 deletions docs/source/main-algorithms/froidure-pin/to-froidure-pin.rst
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ The :any:`FroidurePin` object returned is isomorphic to the quotient of the
underlying semigroup or monoid of *cong* by the congruence represented by
*cong*.

This function throws a :any:`LibsemigroupsError` if ``cong.kind`` is not
This function raises a :any:`LibsemigroupsError` if ``cong.kind`` is not
``congruence_kind.twosided``.

.. doctest:: Python
Expand Down Expand Up @@ -95,7 +95,7 @@ Additionally, specify the following for *rtype*:
The :any:`FroidurePin` object returned is isomorphic to the quotient semigroup
or monoid represented by *k*.

This function throws a :any:`LibsemigroupsError` if the
This function raises a :any:`LibsemigroupsError` if the
:any:`Kambites.small_overlap_class` of *k* is not at least :math:`4`.

.. warning::
Expand Down Expand Up @@ -145,7 +145,7 @@ Additionally, specify the following for *rtype*:
The :any:`FroidurePin` object returned is isomorphic to the quotient semigroup
or monoid represented by *kb*.

This function throws a :any:`LibsemigroupsError` if ``kb.kind()`` is not
This function raises a :any:`LibsemigroupsError` if ``kb.kind()`` is not
``congruence.twosided``.

.. doctest:: Python
Expand Down Expand Up @@ -189,7 +189,7 @@ Additionally, specify the following for *rtype*:
The :any:`FroidurePin` object returned is isomorphic to the quotient semigroup
or monoid represented by *tc*.

This function throws a :any:`LibsemigroupsError` if ``tc.kind()`` is not
This function raises a :any:`LibsemigroupsError` if ``tc.kind()`` is not
``congruence.twosided``.

.. doctest:: Python
Expand Down Expand Up @@ -257,8 +257,8 @@ satisfies :math:`\{a, \ldots, b - 1\}f \subseteq \{a, \ldots, b - 1\}`, then
this function returns the :any:`FroidurePin` object corresponding to the
semigroup or monoid generated by the set of all such transformations.

This function throws a :any:`LibsemigroupsError` if
``throw_if_image_value_out_of_range`` throws for any of the constructed
This function raises a :any:`LibsemigroupsError` if
``throw_if_image_value_out_of_range`` raises for any of the constructed
generators. This can happen if, for example, the :any:`WordGraph` is not
complete (i.e. there exists an edge label and node for which there is no edge
with the given label and given source) or if there is an edge label such that
Expand Down
13 changes: 8 additions & 5 deletions src/aho-corasick.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,8 @@ This function returns the index of the child of the node with index
:returns: The index of the child.
:rtype: int | Undefined

:raises LibsemigroupsError: if ``throw_if_node_index_not_active(parent)`` raises an exception.
:raises LibsemigroupsError:
if ``throw_if_node_index_not_active(parent)`` raises an exception.

:complexity: Constant.

Expand All @@ -129,7 +130,8 @@ Calculate the height of a node.
:returns: The height.
:rtype: int

:raises LibsemigroupsError: if ``throw_if_node_index_not_active(i)`` raises an exception.
:raises LibsemigroupsError:
if ``throw_if_node_index_not_active(i)`` raises an exception.

:complexity:
Linear in the return value which is, at worst, the maximum length
Expand Down Expand Up @@ -205,7 +207,8 @@ the longest proper suffix of :math:`W` contained in the trie.
:returns: The index of the suffix link.
:rtype: int

:raises LibsemigroupsError: if ``throw_if_node_index_not_active(current)`` raises an exception.
:raises LibsemigroupsError:
if ``throw_if_node_index_not_active(current)`` raises an exception.

:complexity: Linear in the height of the node.

Expand Down Expand Up @@ -257,8 +260,8 @@ Check if an index corresponds to a node currently in the trie.
:type i: int

:raises LibsemigroupsError:
if ``throw_if_node_index_out_of_range(i)`` raises an exception, or if *i* is
not an active node.
if ``throw_if_node_index_out_of_range(i)`` raises an exception, or if *i* is
not an active node.

:complexity: Constant

Expand Down
4 changes: 2 additions & 2 deletions src/forest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@ Construct a :any:`Forest` from lists of *parents* and *labels*.
positions (these values indicate where the roots of the trees in the forest
are located and so must coincide).
:raises LibsemigroupsError:
if :any:`set_parent_and_label` throws for ``parents[i]`` and ``labels[i]``
for any value of ``i``.
if :any:`set_parent_and_label` raises an exception for ``parents[i]`` and
``labels[i]`` for any value of ``i``.
)pbdoc");

thing.def("add_nodes",
Expand Down
43 changes: 25 additions & 18 deletions src/present.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -861,8 +861,8 @@ alphabet is already normalized, then no changes are made to the presentation.
:type p: Presentation

:raises LibsemigroupsError:
if :any:`Presentation.throw_if_bad_alphabet_or_rules` throws on the initial
presentation.)pbdoc");
if :any:`Presentation.throw_if_bad_alphabet_or_rules` raises an exception on
the initial presentation.)pbdoc");
m.def("presentation_reduce_complements",
&presentation::reduce_complements<Word>,
py::arg("p"),
Expand Down Expand Up @@ -1294,8 +1294,10 @@ an exception is thrown.
:param p: the presentation.
:type p: Presentation

:raises LibsemigroupsError: if :any:`throw_if_bad_alphabet_or_rules` throws.
:raises LibsemigroupsError: if conflicting inverses for any letter are detected.)pbdoc");
:raises LibsemigroupsError:
if :any:`throw_if_bad_alphabet_or_rules` raises an exception.
:raises LibsemigroupsError:
if conflicting inverses for any letter are detected.)pbdoc");

m.def(
"presentation_balance",
Expand All @@ -1319,14 +1321,16 @@ parameter is defined to be ``p.alphabet()``.
:param inverses: the inverses of the letters.
:type inverses: :ref:`Word<pseudo_word_type_helper>`

:raises LibsemigroupsError: if :any:`throw_if_bad_alphabet_or_rules` throws.
:raises LibsemigroupsError:
if :any:`throw_if_bad_alphabet_or_rules` raises an exception.

:raises LibsemigroupsError:
if :any:`throw_if_bad_inverses` throws when called with ``p.alphabet()`` and
``inverses``. This function does not check that the values in ``inverses``
are actually inverses for the values in ``p.alphabet()``, and balances the
relations as described in :any:`balance` assuming that this is the
case.)pbdoc");
if :any:`throw_if_bad_inverses` raises an exception when called with
``p.alphabet()`` and ``inverses``. This function does not check that the
values in ``inverses`` are actually inverses for the values in
``p.alphabet()``, and balances the relations as described in :any:`balance`
assuming that this is the case.
)pbdoc");

m.def(
"presentation_balance",
Expand Down Expand Up @@ -1360,12 +1364,13 @@ appended to the front of the right-hand side.
:param inverses: the inverses of the letters.
:type inverses: :ref:`Word<pseudo_word_type_helper>`

:raises LibsemigroupsError: if :any:`throw_if_bad_alphabet_or_rules` throws.
:raises LibsemigroupsError:
if :any:`throw_if_bad_alphabet_or_rules` raises an exception.

:raises LibsemigroupsError:
if :any:`throw_if_bad_inverses` throws when called with *letters* and
*inverses*. This does not check that the values in *inverses* are
actually inverses for the values in *letters*, and balances the relations
if :any:`throw_if_bad_inverses` raises an exception when called with
*letters* and *inverses*. This does not check that the values in *inverses*
are actually inverses for the values in *letters*, and balances the relations
as described above.
)pbdoc");

Expand Down Expand Up @@ -1428,7 +1433,8 @@ This function returns the minimum index ``i`` of *lhs* such that ``p.rules[i +
:returns: The index of the rule or :any:`UNDEFINED`.
:rtype: int | Undefined

:raises LibsemigroupsError: if ``p.throw_if_bad_alphabet_or_rules()`` throws.
:raises LibsemigroupsError:
if ``p.throw_if_bad_alphabet_or_rules()`` raises an exception.
)pbdoc");

m.def(
Expand Down Expand Up @@ -1479,7 +1485,7 @@ and *rhs* is the next item in ``p.rules``.
:rtype: bool

:raises LibsemigroupsError:
if :any:`Presentation.throw_if_bad_alphabet_or_rules` throws.
if :any:`Presentation.throw_if_bad_alphabet_or_rules` raises an exception.
)pbdoc");

m.def(
Expand Down Expand Up @@ -1513,7 +1519,7 @@ raised.
:rtype: tuple[str | list[int], str | list[int]]

:raises LibsemigroupsError:
if :any:`throw_if_bad_alphabet_or_rules` throws.
if :any:`throw_if_bad_alphabet_or_rules` raises an exception.
:raises LibsemigroupsError:
if conflicting inverses for any letter are detected.)pbdoc");
} // bind_present
Expand Down Expand Up @@ -1583,7 +1589,8 @@ Returns the inverse of the letter *x*.
:returns: The inverse of *x*.
:rtype: :ref:`Letter<pseudo_letter_type_inv_class>`

:raises LibsemigroupsError: if no inverses have been set, or if ``index(x)`` throws.
:raises LibsemigroupsError:
if no inverses have been set, or if ``index(x)`` raises an exception.
)pbdoc");
thing.def(
"inverses",
Expand Down
2 changes: 1 addition & 1 deletion src/runner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ The valid values are:

Indicates that the Runner is not in any of the previous states and is not
currently running. This can occur when, for example, :any:`Runner.run`
throws an exception.
raises an exception.

.. py:attribute:: state.dead
:value: <state.dead: 8>
Expand Down
20 changes: 14 additions & 6 deletions src/sims.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,8 @@ it is this converted value that is used.
:returns: The first argument *self*.
:rtype: {0}

:raises LibsemigroupsError: if :any:`Presentation.throw_if_bad_alphabet_or_rules` throws.
:raises LibsemigroupsError:
if :any:`Presentation.throw_if_bad_alphabet_or_rules` raises an exception.

:raises LibsemigroupsError: if *p* has 0-generators and 0-relations.
)pbdoc",
Expand Down Expand Up @@ -413,7 +414,9 @@ Add a pair that should be included in every congruence.
:returns: The first argument *self*.
:rtype: {0}

:raises LibsemigroupsError: if :any:`Presentation.throw_if_letter_not_in_alphabet` throws on *lhs* or *rhs*.
:raises LibsemigroupsError:
if :any:`Presentation.throw_if_letter_not_in_alphabet` raises an exception
on *lhs* or *rhs*.
)pbdoc",
doc_type)
.c_str());
Expand Down Expand Up @@ -476,7 +479,9 @@ Add a pair that must be excluded from every congruence.
:returns: The first argument *self*.
:rtype: {0}

:raises LibsemigroupsError: if :any:`Presentation.throw_if_letter_not_in_alphabet` throws on *lhs* or *rhs*.
:raises LibsemigroupsError:
if :any:`Presentation.throw_if_letter_not_in_alphabet` raises
an exception on *lhs* or *rhs*.
)pbdoc",
doc_type)
.c_str());
Expand Down Expand Up @@ -642,9 +647,11 @@ search conducted by an object of this type.
:param p: the presentation to construct from.
:type p: Presentation

:raises LibsemigroupsError: if :any:`Presentation.throw_if_bad_alphabet_or_rules` throws
:raises LibsemigroupsError:
if :any:`Presentation.throw_if_bad_alphabet_or_rules` raises an exception.

:raises LibsemigroupsError: if *p* has 0-generators and 0-relations.
:raises LibsemigroupsError:
if *p* has 0-generators and 0-relations.

.. seealso:: :any:`{0}.presentation`, :any:`{0}.init`
)pbdoc",
Expand Down Expand Up @@ -684,7 +691,8 @@ constructed from the presentation *p*.
:returns: The first argument *self*.
:rtype: {0}

:raises LibsemigroupsError: if :any:`Presentation.throw_if_bad_alphabet_or_rules` throws
:raises LibsemigroupsError:
if :any:`Presentation.throw_if_bad_alphabet_or_rules` raises an exception.

:raises LibsemigroupsError: if *p* has 0-generators and 0-relations.
)pbdoc",
Expand Down
Loading
Loading