Skip to content

Commit 5f7578e

Browse files
Use proper class for Congruence
1 parent 59fce8e commit 5f7578e

File tree

17 files changed

+285
-203
lines changed

17 files changed

+285
-203
lines changed

docs/source/conf.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,9 @@ def doc_only_run(self):
5656
docstring = list(node.findall(condition=desc_content))
5757

5858
if not docstring:
59-
logger.warning(f"The docstring for {self.arguments[0]} cannot be found.")
59+
logger.warning(
60+
f"The docstring for {self.arguments[0]} cannot be found."
61+
)
6062
return []
6163

6264
return docstring
@@ -102,7 +104,9 @@ def no_doc_run(self):
102104
source_suffix = ".rst"
103105
master_doc = "index"
104106
project = "libsemigroups_pybind11"
105-
copyright = "2021-2024, Joseph Edwards, James Mitchell, Maria Tsalakou, Murray Whyte"
107+
copyright = (
108+
"2021-2024, Joseph Edwards, James Mitchell, Maria Tsalakou, Murray Whyte"
109+
)
106110
author = "Joseph Edwards, James Mitchell, Maria Tsalakou, Murray Whyte"
107111
version = "1.0.0"
108112
release = "1.0.0"
@@ -215,6 +219,7 @@ def no_doc_run(self):
215219
"KoniecznyBMat8.DClass",
216220
),
217221
],
222+
"Congruence": [("detail::CongruenceCommon", "Congruence")],
218223
}
219224

220225
# This is what sphinx considers to be a signature
Lines changed: 25 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
.. Copyright (c) 2024 J. D. Mitchell
1+
.. Copyright (c) 2025 J. D. Mitchell
22
33
Distributed under the terms of the GPL license version 3.
44
55
The full license is in the file LICENSE, distributed with this software.
66
7-
.. currentmodule:: _libsemigroups_pybind11
7+
.. currentmodule:: libsemigroups_pybind11
88

9-
The CongruenceWord class
10-
========================
9+
The Congruence class
10+
====================
1111

12-
.. autoclass:: CongruenceWord
12+
.. autoclass:: Congruence
1313
:doc-only:
1414
:class-doc-from: class
1515

@@ -19,21 +19,29 @@ Contents
1919
.. autosummary::
2020
:signatures: short
2121

22-
~CongruenceWord
23-
CongruenceWord.add_generating_pair
24-
CongruenceWord.contains
25-
CongruenceWord.copy
26-
CongruenceWord.currently_contains
27-
CongruenceWord.generating_pairs
28-
CongruenceWord.init
29-
CongruenceWord.max_threads
30-
CongruenceWord.number_of_classes
31-
CongruenceWord.number_of_runners
32-
CongruenceWord.presentation
22+
~Congruence
23+
Congruence.add_generating_pair
24+
Congruence.contains
25+
Congruence.copy
26+
Congruence.currently_contains
27+
Congruence.generating_pairs
28+
Congruence.get
29+
Congruence.has
30+
Congruence.init
31+
Congruence.max_threads
32+
Congruence.number_of_classes
33+
Congruence.number_of_runners
34+
Congruence.presentation
3335

3436
Full API
3537
--------
3638

37-
.. autoclass:: CongruenceWord
39+
.. autoclass:: Congruence
3840
:class-doc-from: init
3941
:members:
42+
:exclude-members:
43+
current_state, dead, finished, internal_generating_pairs, kill,
44+
last_report, report, report_every, report_prefix, report_why_we_stopped,
45+
reset_last_report, reset_start_time, run, run_for, run_until, running,
46+
running_for, running_until, start_time, started, state, stopped,
47+
stopped_by_predicate, success, timed_out,

docs/source/main-algorithms/congruence/helpers.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
55
The full license is in the file LICENSE, distributed with this software.
66
7-
CongruenceWord helper functions
8-
===============================
7+
Congruence helper functions
8+
===========================
99

1010
This page contains the documentation for various helper functions for
11-
manipulating :any:`CongruenceWord` objects.
11+
manipulating :any:`Congruence` objects.
1212

1313
Contents
1414
--------

docs/source/main-algorithms/congruence/index.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ Congruence
1010
==========
1111

1212
This page contains links to the documentation for the class
13-
:any:`CongruenceWord`.
13+
:any:`Congruence`.
1414

15-
Helper functions for the class :any:`CongruenceWord` can be found in the
15+
Helper functions for the class :any:`Congruence` can be found in the
1616
submodule :doc:`helpers`. At present the helper
1717
functions in these two namespaces are identical, because there are no helper
18-
functions that only apply to the :any:`CongruenceWord` class.
18+
functions that only apply to the :any:`Congruence` class.
1919

2020
.. toctree::
2121
:maxdepth: 1

docs/source/main-algorithms/congruence/to-cong.rst

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66
77
.. currentmodule:: libsemigroups_pybind11
88

9-
Converting to a CongruenceWord
9+
Converting to a Congruence
1010
==============================
1111

1212
This page contains documentation relating to converting
13-
``libsemigroups_pybind11`` objects into :any:`CongruenceWord` instances using
13+
``libsemigroups_pybind11`` objects into :any:`Congruence` instances using
1414
the :any:`to` function.
1515

1616
.. seealso::
@@ -23,17 +23,17 @@ Various uses
2323

2424
Recall that the signature for the :any:`to` function is ``to(*args, Return)``.
2525
In what follows, we explain how different values of *args* and *Return* may
26-
be used to construct :any:`CongruenceWord` objects. The following options are
26+
be used to construct :any:`Congruence` objects. The following options are
2727
possible:
2828

2929
* :ref:`froidure-pin-to-congruence`.
3030

3131
.. _froidure-pin-to-congruence:
3232

33-
Converting a :any:`FroidurePinPBR` to a :any:`CongruenceWord`
33+
Converting a :any:`FroidurePinPBR` to a :any:`Congruence`
3434
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3535

36-
To construct a :any:`CongruenceWord` from a :any:`FroidurePinPBR`, specify all
36+
To construct a :any:`Congruence` from a :any:`FroidurePinPBR`, specify all
3737
of the following values for *args*:
3838

3939
* **knd** (:any:`congruence_kind`) -- the kind of the congruence being
@@ -44,17 +44,17 @@ of the following values for *args*:
4444

4545
Additionally, specify one of the following tuples for *Return*:
4646

47-
* ``(Congruence, str)`` for constructing a :any:`CongruenceWord` on words
47+
* ``(Congruence, str)`` for constructing a :any:`Congruence` on words
4848
of type ``str``; or
49-
* ``(Congruence, List[int])`` for constructing a :any:`CongruenceWord` on
49+
* ``(Congruence, List[int])`` for constructing a :any:`Congruence` on
5050
words of type ``List[int]``.
5151

5252
This function converts the :any:`FroidurePinPBR` object *fpb* into a
53-
:any:`CongruenceWord` object using the :any:`WordGraph` *wg* (which should be
53+
:any:`Congruence` object using the :any:`WordGraph` *wg* (which should be
5454
either the :any:`FroidurePinBase.left_cayley_graph` or the
5555
:any:`FroidurePinBase.right_cayley_graph` of *fpb*).
5656

57-
This returned :any:`CongruenceWord` object represents the trivial congruence
57+
This returned :any:`Congruence` object represents the trivial congruence
5858
over the semigroup defined by *fpb*.
5959

6060
This will throw a :any:`LibsemigroupsError` if *wg* is not the

docs/source/main-algorithms/froidure-pin/to-froidure-pin.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,13 @@ possible:
3434

3535
.. _congruence-to-froidure-pin:
3636

37-
Converting a :any:`CongruenceWord` to a :any:`FroidurePinPBR`
38-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
37+
Converting a :any:`Congruence` to a :any:`FroidurePinPBR`
38+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3939

40-
To construct a :any:`FroidurePinPBR` from a :any:`CongruenceWord`, specify the
40+
To construct a :any:`FroidurePinPBR` from a :any:`Congruence`, specify the
4141
following values for *args*:
4242

43-
* **cong** (:any:`CongruenceWord`) -- the :any:`CongruenceWord` object being
43+
* **cong** (:any:`Congruence`) -- the :any:`Congruence` object being
4444
converted.
4545

4646
Additionally, specify the following for *Return*:

docs/source/main-algorithms/todd-coxeter/class/common.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Common methods
1010
==============
1111

1212
This page contains documentation of the methods of :any:`ToddCoxeterWord` that
13-
are implemented in all of the classes :any:`CongruenceWord`,
13+
are implemented in all of the classes :any:`Congruence`,
1414
:any:`KambitesMultiStringView`, :any:`KnuthBendixStringRewriteTrie`, and
1515
:any:`ToddCoxeterWord`.
1616

libsemigroups_pybind11/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@
4848
recursive_path_compare,
4949
shortlex_compare,
5050
LibsemigroupsError,
51-
is_obviously_infinite,
5251
BMat8,
5352
side,
5453
AhoCorasick,
@@ -82,6 +81,7 @@
8281
from .adapters import ImageRightAction, ImageLeftAction
8382

8483
from .congruence import Congruence
84+
from .is_obviously_infinite import is_obviously_infinite
8585
from .kambites import Kambites
8686

8787
from .knuth_bendix import KnuthBendix

0 commit comments

Comments
 (0)