Skip to content

Commit aea3740

Browse files
Update cong-hpp etc for v1 (#215)
* Cleanups + add Congruence * Fix codespell * Fix import Self * Uncomment missing function * Delete comment * Fix linting * Try to do TODO * Do some TODOs * Replace ToddCoxeterImpl_ by ToddCoxeterWord * TODO -> DONE * TODO -> DONE * Delete comment * Delete comment * TODO -> DONE * Lint * TMP * Harmonise doc * TODO -> DONE * TODOs -> DONE
1 parent e75b3ff commit aea3740

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+5902
-4524
lines changed

.codespellrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
[codespell]
22
skip = ./.git,./docs/_build/*,./gh-pages
33
ignore-words-list=nd,alph,falsy,toword,noe,groupe,theses
4+
ignore-multiline-regex=codespell:begin-ignore.*codespell:end-ignore

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,4 @@ docs/source/api/Perm.rst
1919
docs/source/api/Transf.rst
2020
gh-pages/
2121
htmlcov
22+
.cache

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ check: doctest
2222
pytest -vv tests/test_*.py
2323

2424
lint:
25+
ruff check --exit-zero setup.py tests/*.py libsemigroups_pybind11/*.py docs/source/conf.py
2526
pylint --exit-zero setup.py tests/*.py libsemigroups_pybind11/*.py docs/source/conf.py
2627
cpplint src/*.hpp src/*.cpp
2728

docs/source/_old/toddcoxeter.rst

Lines changed: 0 additions & 142 deletions
This file was deleted.

docs/source/conf.py

Lines changed: 24 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# -*- coding: utf-8 -*-
33
# pylint:disable=redefined-builtin, invalid-name, too-many-arguments,
44
# pylint:disable=unbalanced-tuple-unpacking, unused-argument, too-many-locals
5-
# pylint:disable=unused-import
5+
# pylint:disable=unused-import, too-many-positional-arguments
66
"""
77
This provides configuration for the generation of the docs
88
"""
@@ -225,7 +225,7 @@ def sig_alternative(doc, signature, return_annotation):
225225
return new_sig, return_annotation
226226

227227

228-
def change_sig( # pylint: disable=too-many-arguments,too-many-positional-arguments
228+
def change_sig(
229229
app=None,
230230
what=None,
231231
name=None,
@@ -300,10 +300,12 @@ def make_only_doc(lines):
300300
del lines[-3:]
301301

302302
if not called_correctly:
303-
raise RuntimeError(
304-
":only-document-once: has been invoked in a function where "
305-
"documentation has not been repeated. Invoked in:\n" + "\n".join(lines)
303+
print(
304+
"\033[93m:only-document-once: has been invoked in a function where "
305+
"documentation has not been repeated. Invoked in:\n"
306+
+ "\n\033[0m".join(lines)
306307
)
308+
return
307309

308310
# If the new doc shouldn't be overloaded, remove the "Overloaded
309311
# function" part
@@ -312,7 +314,7 @@ def make_only_doc(lines):
312314
del lines[0]
313315

314316

315-
def only_doc_once(app, what, name, obj, options, lines): # pylint:disable=too-many-arguments,too-many-positional-arguments
317+
def only_doc_once(app, what, name, obj, options, lines):
316318
"""
317319
Edit docstring to only include one version of the doc for an overloaded
318320
function if necessary
@@ -322,7 +324,7 @@ def only_doc_once(app, what, name, obj, options, lines): # pylint:disable=too-m
322324
make_only_doc(lines)
323325

324326

325-
def fix_overloads(app, what, name, obj, options, lines): # pylint:disable=too-many-arguments,too-many-positional-arguments
327+
def fix_overloads(app, what, name, obj, options, lines):
326328
"""Indent overloaded function documentation and format signatures"""
327329
overloading = False
328330
overloaded_function = ""
@@ -339,8 +341,11 @@ def fix_overloads(app, what, name, obj, options, lines): # pylint:disable=too-m
339341
# Start overloading and capture the name of the overloaded function
340342
if "Overloaded function." in line:
341343
overloading = True
342-
m = re.search(r"\s*?\d+\. (.*?)\(", input[i + 2])
343-
if not m:
344+
try:
345+
m = re.search(r"\s*?\d+\. (.*?)\(", input[i + 2])
346+
if not m:
347+
return
348+
except IndexError:
344349
return
345350
overloaded_function = m.group(1)
346351
new_name = re.sub(r"^.*\.", "", name)
@@ -389,20 +394,25 @@ def fix_overloads(app, what, name, obj, options, lines): # pylint:disable=too-m
389394
# replacements will be made in each docstring, and will be useful for removing
390395
# things like the signatures that sphinx inserts into every docstring
391396
docstring_replacements = {
397+
r"_current_index_of.*$": "",
398+
r"_number_of_classes.*$": "",
399+
r"_small_overlap_class.*$": "",
392400
r"aho_corasick_dot\(.*\)(\s*->\s*(\w+::)*\w*)?": "",
401+
r"congruence_non_trivial_classes.*$": "",
402+
r"congruence_partition.*$": "",
403+
r"kambites_normal_forms.*$": "",
404+
r"knuth_bendix_non_trivial_classes.*$": "",
393405
r"pbr_one\(\*args, \*\*kwargs\)": "",
394-
r"word_graph_dot\(.*\)(\s*->\s*(\w+::)*\w*)?": "",
395406
r"todd_coxeter_is_non_trivial.*$": "",
396407
r"todd_coxeter_non_trivial_class.*$": "",
408+
r"todd_coxeter_normal_forms.*$": "",
397409
r"todd_coxeter_partition.*$": "",
398410
r"todd_coxeter_redundant_rule.*$": "",
399-
r"todd_coxeter_str_normal_forms.*$": "",
400-
r"todd_coxeter_word_normal_forms.*$": "",
401-
r"kambites_normal_forms.*$": "",
411+
r"word_graph_dot\(.*\)(\s*->\s*(\w+::)*\w*)?": "",
402412
}
403413

404414

405-
def remove_doc_annotations(app, what, name, obj, options, lines): # pylint:disable=too-many-arguments,too-many-positional-arguments
415+
def remove_doc_annotations(app, what, name, obj, options, lines):
406416
"""Remove any special decorations from the documentation"""
407417
for i in range(len(lines) - 1, -1, -1):
408418
for bad, good in docstring_replacements.items():

docs/source/data-structures/misc/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,6 @@ In this section we describe some miscellaneous functionality in
1919
runner
2020
reporter
2121
tril
22+
types
2223

2324
.. ukkonen/index
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
.. Copyright (c) 2025 James Mitchell
2+
3+
Distributed under the terms of the GPL license version 3.
4+
5+
The full license is in the file LICENSE, distributed with this software.
6+
7+
.. currentmodule:: libsemigroups_pybind11
8+
9+
The congruence_kind enum
10+
========================
11+
12+
This page describes the enum class ``congruence_kind`` in
13+
``libsemigroups_pybind11`` for representing the whether a congruence is one- or
14+
two-sided.
15+
16+
Full API
17+
--------
18+
19+
.. autoclass:: congruence_kind

docs/source/index.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,15 +65,15 @@ See the installation instructions:
6565
:caption: Main Algorithms
6666
:hidden:
6767

68-
main-algorithms/action/index.rst
69-
main-algorithms/cong-intf/index.rst
70-
main-algorithms/congruences/index
68+
main-algorithms/action/index
69+
main-algorithms/congruence/index
7170
main-algorithms/froidure-pin/index
7271
main-algorithms/kambites/index
7372
main-algorithms/knuth-bendix/index
7473
main-algorithms/konieczny/index
7574
main-algorithms/radoszewski-rytter/index
7675
main-algorithms/schreier-sims/index
76+
main-algorithms/sims/index
7777
main-algorithms/stephen/index
7878
main-algorithms/todd-coxeter/index
7979

docs/source/main-algorithms/cong-intf/class.rst

Lines changed: 0 additions & 31 deletions
This file was deleted.

docs/source/main-algorithms/cong-intf/index.rst

Lines changed: 0 additions & 24 deletions
This file was deleted.

0 commit comments

Comments
 (0)