diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index ca684f8df..2cf0b518b 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -246,7 +246,7 @@ Each class that does not have a helper namespace should have a ``.rst`` file in The full license is in the file LICENSE, distributed with this software. - .. currentmodule:: _libsemigroups_pybind11 + .. currentmodule:: libsemigroups_pybind11 Class-Name ========== @@ -311,7 +311,7 @@ A sample ``class-helpers.rst`` may look like this: The full license is in the file LICENSE, distributed with this software. - .. currentmodule:: _libsemigroups_pybind11 + .. currentmodule:: libsemigroups_pybind11 Class-name helpers ==================== diff --git a/docs/source/_ext/libsemigroups_pybind11_extensions.py b/docs/source/_ext/libsemigroups_pybind11_extensions.py index 5a5da75ba..5814efea7 100644 --- a/docs/source/_ext/libsemigroups_pybind11_extensions.py +++ b/docs/source/_ext/libsemigroups_pybind11_extensions.py @@ -60,7 +60,9 @@ def doc_only_run(self): docstring = list(node.findall(condition=desc_content)) if not docstring: - logger.warning(f"The docstring for {self.arguments[0]} cannot be found.") + logger.warning( + f"The docstring for {self.arguments[0]} cannot be found." + ) return [] return docstring @@ -104,6 +106,7 @@ def no_doc_run(self): r"libsemigroups::Sims2": r"Sims2", r"libsemigroups::RepOrc": r"RepOrc", r"libsemigroups::MinimalRepOrc": r"MinimalRepOrc", + r"_?libsemigroups_pybind11\.": "", } # This dictionary should be of the form class_name -> (pattern, repl), where diff --git a/docs/source/data-structures/elements/bipart.rst b/docs/source/data-structures/elements/bipart.rst deleted file mode 100644 index f1ccda04e..000000000 --- a/docs/source/data-structures/elements/bipart.rst +++ /dev/null @@ -1,31 +0,0 @@ -.. - Copyright (c) 2021-2024 J. D. Mitchell - - Distributed under the terms of the GPL license version 3. - - The full license is in the file LICENSE, distributed with this software. - -.. currentmodule:: _libsemigroups_pybind11 - -Bipartition -=========== - -This page contains an overview of the functionality in -``libsemigroups_pybind11`` for bipartitions and blocks. - -There are a number of functions for computing things about -:py:class:`Bipartition` objects detailed below. - -.. toctree:: - :maxdepth: 1 - - bipart-helpers - -Full API --------- - -.. autoclass:: Bipartition - :class-doc-from: class - :members: - :inherited-members: - :special-members: __init__ diff --git a/docs/source/data-structures/elements/bipart/class.rst b/docs/source/data-structures/elements/bipart/class.rst new file mode 100644 index 000000000..2b57233bd --- /dev/null +++ b/docs/source/data-structures/elements/bipart/class.rst @@ -0,0 +1,43 @@ +.. + Copyright (c) 2021-2024 J. D. Mitchell + + Distributed under the terms of the GPL license version 3. + + The full license is in the file LICENSE, distributed with this software. + +.. currentmodule:: libsemigroups_pybind11 + +The Bipartition class +===================== + +.. autoclass:: Bipartition + :doc-only: + :class-doc-from: class + +Contents +-------- + +.. autosummary:: + :signatures: short + + ~Bipartition + Bipartition.copy + Bipartition.degree + Bipartition.is_transverse_block + Bipartition.iterator + Bipartition.left_blocks + Bipartition.lookup + Bipartition.number_of_blocks + Bipartition.number_of_left_blocks + Bipartition.number_of_right_blocks + Bipartition.one + Bipartition.rank + Bipartition.right_blocks + +Full API +-------- + +.. autoclass:: Bipartition + :members: + :class-doc-from: init + :inherited-members: diff --git a/docs/source/data-structures/elements/bipart-helpers.rst b/docs/source/data-structures/elements/bipart/helpers.rst similarity index 100% rename from docs/source/data-structures/elements/bipart-helpers.rst rename to docs/source/data-structures/elements/bipart/helpers.rst diff --git a/docs/source/data-structures/elements/bipart/index.rst b/docs/source/data-structures/elements/bipart/index.rst new file mode 100644 index 000000000..67718bee2 --- /dev/null +++ b/docs/source/data-structures/elements/bipart/index.rst @@ -0,0 +1,18 @@ +.. + Copyright (c) 2025 Joseph Edwards + + Distributed under the terms of the GPL license version 3. + + The full license is in the file LICENSE, distributed with this software. + +Bipartitions +============ + +This page describes the functionality for bipartitions in +``libsemigroups_pybind11``. + +.. toctree:: + :maxdepth: 1 + + class + helpers diff --git a/docs/source/data-structures/elements/blocks.rst b/docs/source/data-structures/elements/blocks/class.rst similarity index 56% rename from docs/source/data-structures/elements/blocks.rst rename to docs/source/data-structures/elements/blocks/class.rst index aa44ccf3f..f38b966b8 100644 --- a/docs/source/data-structures/elements/blocks.rst +++ b/docs/source/data-structures/elements/blocks/class.rst @@ -5,22 +5,14 @@ The full license is in the file LICENSE, distributed with this software. -.. currentmodule:: _libsemigroups_pybind11 +.. currentmodule:: libsemigroups_pybind11 -Blocks -====== +The Blocks class +================ -This page contains an overview of the functionality in -``libsemigroups_pybind11`` for blocks. See also :any:`Bipartition` for more -details and context. - -There are a number of functions for computing things about :py:class:`Blocks` -objects detailed below. - -.. toctree:: - :maxdepth: 1 - - blocks-helpers +.. autoclass:: Blocks + :doc-only: + :class-doc-from: class Contents -------- @@ -41,7 +33,6 @@ Full API -------- .. autoclass:: Blocks - :class-doc-from: class :members: + :class-doc-from: init :inherited-members: - :special-members: __init__ diff --git a/docs/source/data-structures/elements/blocks-helpers.rst b/docs/source/data-structures/elements/blocks/helpers.rst similarity index 100% rename from docs/source/data-structures/elements/blocks-helpers.rst rename to docs/source/data-structures/elements/blocks/helpers.rst diff --git a/docs/source/data-structures/elements/blocks/index.rst b/docs/source/data-structures/elements/blocks/index.rst new file mode 100644 index 000000000..54d791fef --- /dev/null +++ b/docs/source/data-structures/elements/blocks/index.rst @@ -0,0 +1,17 @@ +.. + Copyright (c) 2025 Joseph Edwards + + Distributed under the terms of the GPL license version 3. + + The full license is in the file LICENSE, distributed with this software. + +Blocks +====== + +This page describes the functionality for blocks in ``libsemigroups_pybind11``. + +.. toctree:: + :maxdepth: 1 + + class + helpers diff --git a/docs/source/data-structures/elements/index.rst b/docs/source/data-structures/elements/index.rst index 4720eada8..17599cfbe 100644 --- a/docs/source/data-structures/elements/index.rst +++ b/docs/source/data-structures/elements/index.rst @@ -14,10 +14,8 @@ for defining elements of semigroups. .. toctree:: :maxdepth: 1 - bipart - blocks + bipart/index + blocks/index matrix/index - pperm - perm - pbr - transf + pbr/index + transformations/index diff --git a/docs/source/data-structures/elements/matrix/bmat8-helpers.rst b/docs/source/data-structures/elements/matrix/bmat8-helpers.rst index 0d453e10f..ec9c71fa7 100644 --- a/docs/source/data-structures/elements/matrix/bmat8-helpers.rst +++ b/docs/source/data-structures/elements/matrix/bmat8-helpers.rst @@ -5,10 +5,10 @@ The full license is in the file LICENSE, distributed with this software. -.. currentmodule:: _libsemigroups_pybind11 +.. currentmodule:: libsemigroups_pybind11 -The bmat8 submodule -=================== +BMat8 helpers +============= This page contains the documentation for various helper functions for manipulating :any:`BMat8` objects. All these functions are contained in the diff --git a/docs/source/data-structures/elements/matrix/bmat8.rst b/docs/source/data-structures/elements/matrix/bmat8.rst index ee2efcb08..7abe12f23 100644 --- a/docs/source/data-structures/elements/matrix/bmat8.rst +++ b/docs/source/data-structures/elements/matrix/bmat8.rst @@ -5,10 +5,10 @@ The full license is in the file LICENSE, distributed with this software. -.. currentmodule:: _libsemigroups_pybind11 +.. currentmodule:: libsemigroups_pybind11 -BMat8 -===== +The BMat8 class +=============== .. autoclass:: BMat8 :doc-only: @@ -21,6 +21,8 @@ Contents :signatures: short ~BMat8 + BMat8.copy + BMat8.degree BMat8.swap BMat8.to_int diff --git a/docs/source/data-structures/elements/matrix/index.rst b/docs/source/data-structures/elements/matrix/index.rst index 387b90e72..51203b518 100644 --- a/docs/source/data-structures/elements/matrix/index.rst +++ b/docs/source/data-structures/elements/matrix/index.rst @@ -10,12 +10,13 @@ Matrix ====== -It is possible to represent matrices over various semirings in -``libsemigroups_pybind11``. The classes for matrices in -``libsemigroups_pybind11`` are: +This page describes the functionality for matrices over various semirings in +``libsemigroups_pybind11``. .. toctree:: :maxdepth: 1 bmat8 + bmat8-helpers matrix + matrix-helpers diff --git a/docs/source/data-structures/elements/matrix/matrix-helpers.rst b/docs/source/data-structures/elements/matrix/matrix-helpers.rst index dc37ffd5a..745526a73 100644 --- a/docs/source/data-structures/elements/matrix/matrix-helpers.rst +++ b/docs/source/data-structures/elements/matrix/matrix-helpers.rst @@ -7,8 +7,8 @@ .. currentmodule:: libsemigroups_pybind11 -The matrix submodule -==================== +Matrix helpers +============== This page contains the documentation for various helper functions for manipulating :any:`Matrix` objects. All these functions are contained in the diff --git a/docs/source/data-structures/elements/matrix/matrix.rst b/docs/source/data-structures/elements/matrix/matrix.rst index 946abd359..90f07303e 100644 --- a/docs/source/data-structures/elements/matrix/matrix.rst +++ b/docs/source/data-structures/elements/matrix/matrix.rst @@ -26,12 +26,7 @@ While :py:class:`Matrix` is not a class the objects returned by as if it was a class. Some helper functions for :py:class:`Matrix` objects are documented in the -submodule ``matrix``. - -.. toctree:: - :maxdepth: 1 - - matrix-helpers +submodule :any:`libsemigroups_pybind11.matrix`. .. doctest:: @@ -155,40 +150,6 @@ MatrixKind ---------- .. autoclass:: MatrixKind - :show-inheritance: - - .. autoattribute:: Boolean - - For matrices over the Boolean semiring. - - .. autoattribute:: Integer - - For matrices over the usual ring of integers. - - .. autoattribute:: MaxPlus - - For matrices over the max-plus semiring. - - .. autoattribute:: MinPlus - - For matrices over the min-plus semiring. - - .. autoattribute:: ProjMaxPlus - - For projective matrices over the max-plus semiring. - - .. autoattribute:: MaxPlusTrunc - - For matrices over the truncated max-plus semiring. - - .. autoattribute:: MinPlusTrunc - - For matrices over the truncated min-plus semiring. - - .. autoattribute:: NTP - - For matrices over the semiring of natural numbers quotiented by `t = t + - p`. .. TODO later summary diff --git a/docs/source/data-structures/elements/pbr.rst b/docs/source/data-structures/elements/pbr/class.rst similarity index 59% rename from docs/source/data-structures/elements/pbr.rst rename to docs/source/data-structures/elements/pbr/class.rst index 7010e156b..010791016 100644 --- a/docs/source/data-structures/elements/pbr.rst +++ b/docs/source/data-structures/elements/pbr/class.rst @@ -7,19 +7,12 @@ .. currentmodule:: libsemigroups_pybind11 -PBR -=== +The PBR class +============= -This page contains an overview of the functionality in -``libsemigroups_pybind11`` for partitioned binary relations (PBRs). - -There are a number of functions for computing things about :py:class:`PBR` -objects detailed below. - -.. toctree:: - :maxdepth: 1 - - pbr-helpers +.. autoclass:: PBR + :doc-only: + :class-doc-from: class Contents -------- @@ -27,15 +20,16 @@ Contents .. autosummary:: :signatures: short + ~PBR PBR.copy PBR.degree PBR.number_of_points + PBR.product_inplace Full API -------- .. autoclass:: PBR - :class-doc-from: class :members: + :class-doc-from: init :inherited-members: - :special-members: __init__ diff --git a/docs/source/data-structures/elements/pbr-helpers.rst b/docs/source/data-structures/elements/pbr/helpers.rst similarity index 100% rename from docs/source/data-structures/elements/pbr-helpers.rst rename to docs/source/data-structures/elements/pbr/helpers.rst diff --git a/docs/source/data-structures/elements/pbr/index.rst b/docs/source/data-structures/elements/pbr/index.rst new file mode 100644 index 000000000..680302db8 --- /dev/null +++ b/docs/source/data-structures/elements/pbr/index.rst @@ -0,0 +1,18 @@ +.. + Copyright (c) 2025 Joseph Edwards + + Distributed under the terms of the GPL license version 3. + + The full license is in the file LICENSE, distributed with this software. + +Partitioned binary relations (PBRs) +=================================== + +This page describes the functionality for partitioned binary relations (PBRs) in +``libsemigroups_pybind11``. + +.. toctree:: + :maxdepth: 1 + + class + helpers diff --git a/docs/source/data-structures/elements/pperm.rst b/docs/source/data-structures/elements/pperm.rst deleted file mode 100644 index 7fc1d5b84..000000000 --- a/docs/source/data-structures/elements/pperm.rst +++ /dev/null @@ -1,62 +0,0 @@ -.. - Copyright (c) 2021-2024 J. D. Mitchell - - Distributed under the terms of the GPL license version 3. - - The full license is in the file LICENSE, distributed with this software. - -.. currentmodule:: libsemigroups_pybind11 - -Partial perms -============= - -This page contains the documentation for functionality in -``libsemigroups_pybind11`` for partial permutations in the :py:class:`PPerm` -class. - -These partial permutations are optimised for the number of points in the image -with fewer points requiring less space per point. - -.. - TODO(0) use somewhere? - -.. - If ``libsemigroups`` has been - -.. - compiled with ``HPCombi`` enabled, then partial permutations with degree at most 16 - -.. - use the SSE and AVX instruction sets for very fast manipulation. - -There are numerous functions for computing things about :py:class:`PPerm` -objects detailed below. - -.. toctree:: - :maxdepth: 1 - - transf-helpers - -Contents --------- - -.. autosummary:: - :signatures: short - - ~PPerm - PPerm.copy - PPerm.images - PPerm.increase_degree_by - PPerm.one - PPerm.product_inplace - PPerm.rank - PPerm.swap - -Full API --------- - -.. autoclass:: PPerm - :class-doc-from: init - :members: - :inherited-members: - :exclude-members: init_cxx_obj, py_template_params_from_cxx_obj diff --git a/docs/source/data-structures/elements/transf-helpers.rst b/docs/source/data-structures/elements/transformations/helpers.rst similarity index 100% rename from docs/source/data-structures/elements/transf-helpers.rst rename to docs/source/data-structures/elements/transformations/helpers.rst diff --git a/docs/source/data-structures/elements/transformations/index.rst b/docs/source/data-structures/elements/transformations/index.rst new file mode 100644 index 000000000..8a080d759 --- /dev/null +++ b/docs/source/data-structures/elements/transformations/index.rst @@ -0,0 +1,20 @@ +.. + Copyright (c) 2025 Joseph Edwards + + Distributed under the terms of the GPL license version 3. + + The full license is in the file LICENSE, distributed with this software. + +Transformations +=============== + +This page describes the functionality for various partial transformations in +``libsemigroups_pybind11``. + +.. toctree:: + :maxdepth: 1 + + perm + pperm + transf + helpers diff --git a/docs/source/data-structures/elements/perm.rst b/docs/source/data-structures/elements/transformations/perm.rst similarity index 96% rename from docs/source/data-structures/elements/perm.rst rename to docs/source/data-structures/elements/transformations/perm.rst index 7bf671e6d..d595095ee 100644 --- a/docs/source/data-structures/elements/perm.rst +++ b/docs/source/data-structures/elements/transformations/perm.rst @@ -14,8 +14,8 @@ .. currentmodule:: libsemigroups_pybind11 -Permutations -============ +The Perm class +============== .. autoclass:: Perm :doc-only: diff --git a/docs/source/data-structures/elements/transformations/pperm.rst b/docs/source/data-structures/elements/transformations/pperm.rst new file mode 100644 index 000000000..c2167557f --- /dev/null +++ b/docs/source/data-structures/elements/transformations/pperm.rst @@ -0,0 +1,39 @@ +.. + Copyright (c) 2021-2024 J. D. Mitchell + + Distributed under the terms of the GPL license version 3. + + The full license is in the file LICENSE, distributed with this software. + +.. currentmodule:: libsemigroups_pybind11 + +The PPerm class +=============== + +.. autoclass:: PPerm + :doc-only: + :class-doc-from: class + +Contents +-------- + +.. autosummary:: + :signatures: short + + ~PPerm + PPerm.copy + PPerm.images + PPerm.increase_degree_by + PPerm.one + PPerm.product_inplace + PPerm.rank + PPerm.swap + +Full API +-------- + +.. autoclass:: PPerm + :class-doc-from: init + :members: + :inherited-members: + :exclude-members: init_cxx_obj, py_template_params_from_cxx_obj diff --git a/docs/source/data-structures/elements/transf.rst b/docs/source/data-structures/elements/transformations/transf.rst similarity index 95% rename from docs/source/data-structures/elements/transf.rst rename to docs/source/data-structures/elements/transformations/transf.rst index 3da130d9f..0364f3ddc 100644 --- a/docs/source/data-structures/elements/transf.rst +++ b/docs/source/data-structures/elements/transformations/transf.rst @@ -7,8 +7,8 @@ .. currentmodule:: libsemigroups_pybind11 -Transformations -=============== +The Transf class +================ .. autoclass:: Transf :doc-only: diff --git a/docs/source/data-structures/misc/obvinf.rst b/docs/source/data-structures/misc/obvinf.rst index 1a8ae0852..482cf52ce 100644 --- a/docs/source/data-structures/misc/obvinf.rst +++ b/docs/source/data-structures/misc/obvinf.rst @@ -5,7 +5,7 @@ The full license is in the file LICENSE, distributed with this software. -.. currentmodule:: _libsemigroups_pybind11 +.. currentmodule:: libsemigroups_pybind11 Obviously infinite ================== diff --git a/docs/source/data-structures/misc/reporter.rst b/docs/source/data-structures/misc/reporter.rst index 823c11cfe..4de72d90f 100644 --- a/docs/source/data-structures/misc/reporter.rst +++ b/docs/source/data-structures/misc/reporter.rst @@ -7,8 +7,8 @@ .. currentmodule:: _libsemigroups_pybind11 -Reporter -======== +The Reporter class +================== .. autoclass:: Reporter :doc-only: @@ -21,6 +21,7 @@ Contents :signatures: short ~Reporter + Reporter.copy Reporter.init Reporter.last_report Reporter.report diff --git a/docs/source/data-structures/misc/runner.rst b/docs/source/data-structures/misc/runner.rst index eec289673..5fc79a081 100644 --- a/docs/source/data-structures/misc/runner.rst +++ b/docs/source/data-structures/misc/runner.rst @@ -7,8 +7,8 @@ .. currentmodule:: _libsemigroups_pybind11 -Runner -====== +The Runner class +================ .. autoclass:: Runner :doc-only: @@ -21,20 +21,24 @@ Contents :signatures: short ~Runner - Runner.current_state - Runner.dead - Runner.finished - Runner.kill - Runner.run - Runner.run_for - Runner.running - Runner.running_for - Runner.running_until - Runner.started - Runner.state - Runner.stopped - Runner.stopped_by_predicate - Runner.timed_out + Runner.current_state + Runner.dead + Runner.finished + Runner.init + Runner.kill + Runner.report_why_we_stopped + Runner.run + Runner.run_for + Runner.run_until + Runner.running + Runner.running_for + Runner.running_until + Runner.started + Runner.state + Runner.stopped + Runner.stopped_by_predicate + Runner.success + Runner.timed_out Full API -------- @@ -42,10 +46,3 @@ Full API .. autoclass:: Runner :no-doc: :members: - -Methods inherited from Reporter -------------------------------- - -.. autoclass:: Reporter - :members: - :noindex: diff --git a/docs/source/data-structures/presentations/examples.rst b/docs/source/data-structures/presentations/examples.rst index b780d473a..6fe766fb5 100644 --- a/docs/source/data-structures/presentations/examples.rst +++ b/docs/source/data-structures/presentations/examples.rst @@ -5,7 +5,7 @@ The full license is in the file LICENSE, distributed with this software. -.. currentmodule:: libsemigroups_pybind11 +.. currentmodule:: libsemigroups_pybind11.presentation.examples Presentations for standard examples =================================== @@ -13,8 +13,6 @@ Presentations for standard examples This page contains the documentation for various examples of presentations for finitely presented semigroups and monoids. -.. currentmodule:: libsemigroups_pybind11.presentation.examples - .. _default-presentations: Default presentations diff --git a/docs/source/data-structures/presentations/index.rst b/docs/source/data-structures/presentations/index.rst index 0527113cb..9636b1d63 100644 --- a/docs/source/data-structures/presentations/index.rst +++ b/docs/source/data-structures/presentations/index.rst @@ -31,8 +31,8 @@ letters and words cannot be interchanged once a presentation is constructed. All of the classes for finitely presented semigroups and monoids in ``libsemigroups_pybind11`` can be used "interactively", in the sense that they can be run for a particular amount of time, or until some condition is met; for -further details see, for example, :py:meth:`.KnuthBendix.run_for` and -:py:meth:`.KnuthBendix.run_until`. +further details see, for example, :any:`Runner.run_for` and +:any:`Runner.run_until`. The classes and modules in ``libsemigroups_pybind11`` for finitely presented semigroups and monoids are: diff --git a/docs/source/data-structures/presentations/inverse-present.rst b/docs/source/data-structures/presentations/inverse-present.rst index 98a2a9a10..acbfe9553 100644 --- a/docs/source/data-structures/presentations/inverse-present.rst +++ b/docs/source/data-structures/presentations/inverse-present.rst @@ -47,5 +47,4 @@ Full API .. autoclass:: InversePresentation :members: - :class-doc-from: class :no-doc: diff --git a/docs/source/data-structures/presentations/present-helpers.rst b/docs/source/data-structures/presentations/present-helpers.rst index 989c3479f..75b521ffb 100644 --- a/docs/source/data-structures/presentations/present-helpers.rst +++ b/docs/source/data-structures/presentations/present-helpers.rst @@ -5,8 +5,8 @@ The full license is in the file LICENSE, distributed with this software. -Helper functions for presentations -================================== +Presentation helpers +==================== This page contains the documentation for various helper functions for manipulating presentations. @@ -37,6 +37,7 @@ Contents add_identity_rules add_inverse_rules add_rule + add_rules add_zero_rules are_rules_sorted change_alphabet @@ -66,6 +67,7 @@ Contents sort_rules strongly_compress throw_if_bad_inverses + to_gap_string Full API -------- diff --git a/docs/source/data-structures/presentations/present.rst b/docs/source/data-structures/presentations/present.rst index 3d4968479..f178dc2ba 100644 --- a/docs/source/data-structures/presentations/present.rst +++ b/docs/source/data-structures/presentations/present.rst @@ -40,6 +40,7 @@ Contents Presentation.alphabet Presentation.alphabet_from_rules Presentation.contains_empty_word + Presentation.copy Presentation.in_alphabet Presentation.index Presentation.init diff --git a/docs/source/data-structures/presentations/to-present.rst b/docs/source/data-structures/presentations/to-present.rst index bb93cfb74..a3a4aca8c 100644 --- a/docs/source/data-structures/presentations/to-present.rst +++ b/docs/source/data-structures/presentations/to-present.rst @@ -264,5 +264,3 @@ to calling this function. >>> p = to(S, Return=(Presentation, str)) >>> len(p.alphabet()) == 4 True - -.. py:class:: Thing(arg) diff --git a/docs/source/data-structures/suffix-trees/class.rst b/docs/source/data-structures/suffix-trees/class.rst index ba0526d0b..b0baae970 100644 --- a/docs/source/data-structures/suffix-trees/class.rst +++ b/docs/source/data-structures/suffix-trees/class.rst @@ -17,15 +17,19 @@ The Ukkonen class Contents -------- +.. TODO(1): Add Ukkonen.Node.link and Ukkonen.Node.is_real_suffix? + .. autosummary:: :signatures: short ~Ukkonen.State + Ukkonen.State.copy Ukkonen.State.pos Ukkonen.State.v ~Ukkonen.Node Ukkonen.Node.child Ukkonen.Node.children + Ukkonen.Node.copy Ukkonen.Node.is_leaf Ukkonen.Node.is_root Ukkonen.Node.l @@ -33,6 +37,7 @@ Contents Ukkonen.Node.parent Ukkonen.Node.r ~Ukkonen + Ukkonen.copy Ukkonen.distance_from_root Ukkonen.index Ukkonen.init diff --git a/docs/source/data-structures/suffix-trees/helpers.rst b/docs/source/data-structures/suffix-trees/helpers.rst index 815078db7..e5c8d134b 100644 --- a/docs/source/data-structures/suffix-trees/helpers.rst +++ b/docs/source/data-structures/suffix-trees/helpers.rst @@ -5,8 +5,8 @@ The full license is in the file LICENSE, distributed with this software. -Ukkonen helper functions -======================== +Ukkonen helpers +=============== This page contains the documentation for various helper functions for manipulating :any:`Ukkonen` objects. diff --git a/docs/source/data-structures/tries/class.rst b/docs/source/data-structures/tries/class.rst index 20871c0bc..94bac4ca2 100644 --- a/docs/source/data-structures/tries/class.rst +++ b/docs/source/data-structures/tries/class.rst @@ -5,10 +5,10 @@ The full license is in the file LICENSE, distributed with this software. -.. currentmodule:: _libsemigroups_pybind11 +.. currentmodule:: libsemigroups_pybind11 -Aho-Corasick -============ +The AhoCorasick class +===================== .. autoclass:: AhoCorasick :doc-only: @@ -20,7 +20,9 @@ Contents .. autosummary:: :signatures: short + ~AhoCorasick AhoCorasick.child + AhoCorasick.copy AhoCorasick.height AhoCorasick.init AhoCorasick.is_terminal @@ -35,6 +37,5 @@ Full API -------- .. autoclass:: AhoCorasick - :no-doc: - :special-members: __init__ :members: + :class-doc-from: init diff --git a/docs/source/data-structures/tries/helpers.rst b/docs/source/data-structures/tries/helpers.rst index 487d02ab7..d19f6330d 100644 --- a/docs/source/data-structures/tries/helpers.rst +++ b/docs/source/data-structures/tries/helpers.rst @@ -5,8 +5,8 @@ The full license is in the file LICENSE, distributed with this software. -Aho-Corasick helper functions -============================= +AhoCorasick helpers +=================== .. automodule:: libsemigroups_pybind11.aho_corasick :noindex: diff --git a/docs/source/data-structures/visualisation/dot.rst b/docs/source/data-structures/visualisation/dot.rst index 55952606b..35928068f 100644 --- a/docs/source/data-structures/visualisation/dot.rst +++ b/docs/source/data-structures/visualisation/dot.rst @@ -5,7 +5,7 @@ The full license is in the file LICENSE, distributed with this software. -.. currentmodule:: _libsemigroups_pybind11 +.. currentmodule:: libsemigroups_pybind11 The Dot class ============= @@ -20,15 +20,13 @@ Contents .. autosummary:: :signatures: short - ~Dot - Dot.Edge - Dot.Node Dot.add_attr Dot.add_edge Dot.add_node Dot.add_subgraph Dot.attrs Dot.colors + Dot.copy Dot.edge Dot.edges Dot.is_node @@ -36,7 +34,6 @@ Contents Dot.name Dot.node Dot.nodes - Dot.nodes Dot.subgraphs Dot.to_string diff --git a/docs/source/data-structures/visualisation/index.rst b/docs/source/data-structures/visualisation/index.rst index f2e89be4a..87a2fed7d 100644 --- a/docs/source/data-structures/visualisation/index.rst +++ b/docs/source/data-structures/visualisation/index.rst @@ -30,7 +30,9 @@ Functions for creating Dot objects The function ``dot`` can be used to produce initial :any:`Dot` objects for various of the data structures and algorithms in libsemigroups: -.. currentmodule:: _libsemigroups_pybind11 +.. currentmodule:: libsemigroups_pybind11 - :any:`aho_corasick.dot` -- TODO more +- :any:`stephen.dot` +- :any:`ukkonen.dot` +- :any:`word_graph.dot` diff --git a/docs/source/data-structures/word-graph/forest.rst b/docs/source/data-structures/word-graph/forest.rst index 2413209cb..be8b68b77 100644 --- a/docs/source/data-structures/word-graph/forest.rst +++ b/docs/source/data-structures/word-graph/forest.rst @@ -7,8 +7,8 @@ .. currentmodule:: libsemigroups_pybind11 -Forest -====== +The Forest class +================ .. autoclass:: Forest :doc-only: diff --git a/docs/source/data-structures/word-graph/gabow/index.rst b/docs/source/data-structures/word-graph/gabow.rst similarity index 86% rename from docs/source/data-structures/word-graph/gabow/index.rst rename to docs/source/data-structures/word-graph/gabow.rst index 62270760c..3e7ee7434 100644 --- a/docs/source/data-structures/word-graph/gabow/index.rst +++ b/docs/source/data-structures/word-graph/gabow.rst @@ -5,10 +5,10 @@ The full license is in the file LICENSE, distributed with this software. -.. currentmodule:: _libsemigroups_pybind11 +.. currentmodule:: libsemigroups_pybind11 -Gabow -===== +The Gabow class +=============== .. autoclass:: Gabow :doc-only: @@ -20,9 +20,11 @@ Contents .. autosummary:: :signatures: short + ~Gabow Gabow.component Gabow.component_of Gabow.components + Gabow.copy Gabow.has_components Gabow.id Gabow.init diff --git a/docs/source/data-structures/word-graph/helpers.rst b/docs/source/data-structures/word-graph/helpers.rst index 8091b9b2c..a2f7471bd 100644 --- a/docs/source/data-structures/word-graph/helpers.rst +++ b/docs/source/data-structures/word-graph/helpers.rst @@ -5,8 +5,8 @@ The full license is in the file LICENSE, distributed with this software. -Helper functions for word graphs -================================ +WordGraph helpers +================= This page contains the documentation for various helper functions for manipulating word graphs. diff --git a/docs/source/data-structures/word-graph/index.rst b/docs/source/data-structures/word-graph/index.rst index 27a37ff6b..3e7e521f9 100644 --- a/docs/source/data-structures/word-graph/index.rst +++ b/docs/source/data-structures/word-graph/index.rst @@ -17,9 +17,9 @@ This page contains links to the documentation for the parts of :maxdepth: 1 forest - gabow/index + gabow joiner meeter - paths/index + paths word-graph helpers diff --git a/docs/source/data-structures/word-graph/joiner.rst b/docs/source/data-structures/word-graph/joiner.rst index 7440a730a..2b05185e9 100644 --- a/docs/source/data-structures/word-graph/joiner.rst +++ b/docs/source/data-structures/word-graph/joiner.rst @@ -5,7 +5,7 @@ The full license is in the file LICENSE, distributed with this software. -.. currentmodule:: _libsemigroups_pybind11 +.. currentmodule:: libsemigroups_pybind11 The Joiner class ================ @@ -30,5 +30,5 @@ Full API .. autoclass:: Joiner :members: - :special-members: __init__, __call__ + :special-members: __call__ :class-doc-from: init diff --git a/docs/source/data-structures/word-graph/meeter.rst b/docs/source/data-structures/word-graph/meeter.rst index 2cdf2cb7d..ce2b0c335 100644 --- a/docs/source/data-structures/word-graph/meeter.rst +++ b/docs/source/data-structures/word-graph/meeter.rst @@ -5,7 +5,7 @@ The full license is in the file LICENSE, distributed with this software. -.. currentmodule:: _libsemigroups_pybind11 +.. currentmodule:: libsemigroups_pybind11 The Meeter class ================ @@ -30,5 +30,5 @@ Full API .. autoclass:: Meeter :members: - :special-members: __init__, __call__ + :special-members: __call__ :class-doc-from: init diff --git a/docs/source/data-structures/word-graph/paths/paths.rst b/docs/source/data-structures/word-graph/paths.rst similarity index 92% rename from docs/source/data-structures/word-graph/paths/paths.rst rename to docs/source/data-structures/word-graph/paths.rst index f2809f707..4466e94c2 100644 --- a/docs/source/data-structures/word-graph/paths/paths.rst +++ b/docs/source/data-structures/word-graph/paths.rst @@ -20,12 +20,15 @@ Contents .. autosummary:: :signatures: short + ~Paths Paths.at_end + Paths.copy Paths.count Paths.current_target Paths.get Paths.init Paths.max + Paths.min Paths.next Paths.order Paths.source diff --git a/docs/source/data-structures/word-graph/paths/index.rst b/docs/source/data-structures/word-graph/paths/index.rst deleted file mode 100644 index 92da0f5e2..000000000 --- a/docs/source/data-structures/word-graph/paths/index.rst +++ /dev/null @@ -1,23 +0,0 @@ -.. - Copyright (c) 2021-2024 J. D. Mitchell - - Distributed under the terms of the GPL license version 3. - - The full license is in the file LICENSE, distributed with this software. - -.. currentmodule:: _libsemigroups_pybind11 - -Paths -===== - -This page contains links to the documentationin ``libsemigroups_pybind11`` for -finding and counting paths in a word graph. The relevant classes are: - -.. toctree:: - :maxdepth: 1 - - paths - -.. - Decided to not make bindings for paths::algorithm, and number_of_paths, or - cbegin_pislo etc since their functionality is exposed by Paths. diff --git a/docs/source/data-structures/word-graph/word-graph.rst b/docs/source/data-structures/word-graph/word-graph.rst index c3a58b213..dd406a916 100644 --- a/docs/source/data-structures/word-graph/word-graph.rst +++ b/docs/source/data-structures/word-graph/word-graph.rst @@ -5,7 +5,7 @@ The full license is in the file LICENSE, distributed with this software. -.. currentmodule:: _libsemigroups_pybind11 +.. currentmodule:: libsemigroups_pybind11 The WordGraph class =================== diff --git a/docs/source/data-structures/words/string-range.rst b/docs/source/data-structures/words/string-range.rst index 8bbb0763b..0eb009034 100644 --- a/docs/source/data-structures/words/string-range.rst +++ b/docs/source/data-structures/words/string-range.rst @@ -5,9 +5,9 @@ The full license is in the file LICENSE, distributed with this software. -.. currentmodule:: _libsemigroups_pybind11 +.. currentmodule:: libsemigroups_pybind11 -The StringRange Class +The StringRange class ===================== .. autoclass:: StringRange @@ -23,6 +23,7 @@ Contents ~StringRange StringRange.alphabet StringRange.at_end + StringRange.copy StringRange.count StringRange.first StringRange.get diff --git a/docs/source/data-structures/words/to-string.rst b/docs/source/data-structures/words/to-string.rst index 0503d6f52..98b5c7b43 100644 --- a/docs/source/data-structures/words/to-string.rst +++ b/docs/source/data-structures/words/to-string.rst @@ -7,7 +7,7 @@ .. currentmodule:: libsemigroups_pybind11 -The ToString Class +The ToString class ================== .. autoclass:: ToString @@ -23,6 +23,7 @@ Contents ~ToString ToString.alphabet ToString.can_convert_letter + ToString.copy ToString.empty ToString.init diff --git a/docs/source/data-structures/words/to-word.rst b/docs/source/data-structures/words/to-word.rst index 702e9f38e..0d413328b 100644 --- a/docs/source/data-structures/words/to-word.rst +++ b/docs/source/data-structures/words/to-word.rst @@ -7,7 +7,7 @@ .. currentmodule:: libsemigroups_pybind11 -The ToWord Class +The ToWord class ================ .. autoclass:: ToWord @@ -23,6 +23,7 @@ Contents ~ToWord ToWord.alphabet ToWord.can_convert_letter + ToWord.copy ToWord.empty ToWord.init diff --git a/docs/source/data-structures/words/word-range.rst b/docs/source/data-structures/words/word-range.rst index 72411cff2..54d05c34d 100644 --- a/docs/source/data-structures/words/word-range.rst +++ b/docs/source/data-structures/words/word-range.rst @@ -7,7 +7,7 @@ .. currentmodule:: libsemigroups_pybind11 -The WordRange Class +The WordRange class =================== .. autoclass:: WordRange @@ -23,6 +23,7 @@ Contents ~WordRange WordRange.alphabet_size WordRange.at_end + WordRange.copy WordRange.count WordRange.first WordRange.get diff --git a/docs/source/main-algorithms/action/action.rst b/docs/source/main-algorithms/action/action.rst index 7f56e97a6..bca594dac 100644 --- a/docs/source/main-algorithms/action/action.rst +++ b/docs/source/main-algorithms/action/action.rst @@ -23,12 +23,16 @@ Contents ~Action Action.add_generator Action.add_seed + Action.apply Action.cache_scc_multipliers + Action.copy Action.current_size Action.empty + Action.generators Action.init Action.multiplier_from_scc_root Action.multiplier_to_scc_root + Action.number_of_generators Action.position Action.reserve Action.root_of_scc diff --git a/docs/source/main-algorithms/action/index.rst b/docs/source/main-algorithms/action/index.rst index 13a9dd525..8a89f8d86 100644 --- a/docs/source/main-algorithms/action/index.rst +++ b/docs/source/main-algorithms/action/index.rst @@ -17,6 +17,6 @@ This page contains links to the documentation for the classes in :maxdepth: 1 action - rightaction leftaction + rightaction side diff --git a/docs/source/main-algorithms/congruence/class.rst b/docs/source/main-algorithms/congruence/class.rst index ab55356f2..fa43d2a6f 100644 --- a/docs/source/main-algorithms/congruence/class.rst +++ b/docs/source/main-algorithms/congruence/class.rst @@ -29,10 +29,14 @@ Contents Congruence.get Congruence.has Congruence.init + Congruence.kind Congruence.max_threads Congruence.number_of_classes + Congruence.number_of_generating_pairs Congruence.number_of_runners Congruence.presentation + Congruence.reduce + Congruence.reduce_no_run Full API -------- diff --git a/docs/source/main-algorithms/congruence/helpers.rst b/docs/source/main-algorithms/congruence/helpers.rst index a1cbdacf1..878f8efe0 100644 --- a/docs/source/main-algorithms/congruence/helpers.rst +++ b/docs/source/main-algorithms/congruence/helpers.rst @@ -5,8 +5,8 @@ The full license is in the file LICENSE, distributed with this software. -Congruence helper functions -=========================== +Congruence helpers +================== This page contains the documentation for various helper functions for manipulating :any:`Congruence` objects. diff --git a/docs/source/main-algorithms/congruence/index.rst b/docs/source/main-algorithms/congruence/index.rst index b5b34a0a3..41a8df7a3 100644 --- a/docs/source/main-algorithms/congruence/index.rst +++ b/docs/source/main-algorithms/congruence/index.rst @@ -5,7 +5,7 @@ The full license is in the file LICENSE, distributed with this software. -.. currentmodule:: _libsemigroups_pybind11 +.. currentmodule:: libsemigroups_pybind11 Congruence ========== diff --git a/docs/source/main-algorithms/froidure-pin/class.rst b/docs/source/main-algorithms/froidure-pin/class.rst index 49be9849f..5cbf0093a 100644 --- a/docs/source/main-algorithms/froidure-pin/class.rst +++ b/docs/source/main-algorithms/froidure-pin/class.rst @@ -20,6 +20,7 @@ Contents .. autosummary:: :signatures: short + ~FroidurePin FroidurePin.add_generator FroidurePin.add_generators FroidurePin.batch_size @@ -29,6 +30,7 @@ Contents FroidurePin.copy FroidurePin.copy_add_generators FroidurePin.copy_closure + FroidurePin.current_elements FroidurePin.current_left_cayley_graph FroidurePin.current_length FroidurePin.current_max_word_length @@ -54,6 +56,7 @@ Contents FroidurePin.number_of_idempotents FroidurePin.number_of_rules FroidurePin.position + FroidurePin.position_of_generator FroidurePin.prefix FroidurePin.reserve FroidurePin.right_cayley_graph diff --git a/docs/source/main-algorithms/froidure-pin/helpers.rst b/docs/source/main-algorithms/froidure-pin/helpers.rst index 93f325b31..47d03a6d2 100644 --- a/docs/source/main-algorithms/froidure-pin/helpers.rst +++ b/docs/source/main-algorithms/froidure-pin/helpers.rst @@ -1,5 +1,5 @@ -Helper functions for FroidurePin objects -======================================== +FroidurePin helpers +=================== This page contains the documentation for various helper functions for manipulating :any:`FroidurePin` objects. @@ -12,9 +12,9 @@ Contents .. autosummary:: :signatures: short - current_position current_minimal_factorisation current_normal_forms + current_position current_rules equal_to factorisation diff --git a/docs/source/main-algorithms/kambites/helpers.rst b/docs/source/main-algorithms/kambites/helpers.rst index 3e40285cd..ded7babb9 100644 --- a/docs/source/main-algorithms/kambites/helpers.rst +++ b/docs/source/main-algorithms/kambites/helpers.rst @@ -7,8 +7,8 @@ .. currentmodule:: libsemigroups_pybind11.kambites -Kambites helper functions -========================= +Kambites helpers +================ This page contains the documentation for various helper functions for manipulating :any:`Kambites` objects. @@ -19,8 +19,8 @@ Contents .. autosummary:: :signatures: short - normal_forms non_trivial_classes + normal_forms partition Full API diff --git a/docs/source/main-algorithms/knuth-bendix/class/index.rst b/docs/source/main-algorithms/knuth-bendix/class/index.rst index fdd75b2a5..7373c10b2 100644 --- a/docs/source/main-algorithms/knuth-bendix/class/index.rst +++ b/docs/source/main-algorithms/knuth-bendix/class/index.rst @@ -27,6 +27,7 @@ Contents ~KnuthBendix KnuthBendix.active_rules + KnuthBendix.add_generating_pair KnuthBendix.check_confluence_interval KnuthBendix.confluent KnuthBendix.confluent_known @@ -36,11 +37,14 @@ Contents KnuthBendix.generating_pairs KnuthBendix.gilman_graph KnuthBendix.gilman_graph_node_labels + KnuthBendix.init + KnuthBendix.kind KnuthBendix.max_overlap KnuthBendix.max_pending_rules KnuthBendix.max_rules KnuthBendix.number_of_active_rules KnuthBendix.number_of_classes + KnuthBendix.number_of_generating_pairs KnuthBendix.number_of_inactive_rules KnuthBendix.overlap_policy KnuthBendix.presentation @@ -57,7 +61,7 @@ Full API :inherited-members: :exclude-members: options, run_for, run_until, run, finished, stopped, current_state, dead, - internal_generating_pairs, kill, kind, last_report, report, report_every, + internal_generating_pairs, kill, last_report, report, report_every, report_prefix, report_why_we_stopped, reset_last_report, reset_start_time, running, running_for, running_until, start_time, started, state, stopped_by_predicate, success, timed_out diff --git a/docs/source/main-algorithms/knuth-bendix/helpers.rst b/docs/source/main-algorithms/knuth-bendix/helpers.rst index 9bd055b81..24df7ba90 100644 --- a/docs/source/main-algorithms/knuth-bendix/helpers.rst +++ b/docs/source/main-algorithms/knuth-bendix/helpers.rst @@ -5,8 +5,8 @@ The full license is in the file LICENSE, distributed with this software. -Knuth-Bendix helpers -==================== +KnuthBendix helpers +=================== This page contains the documentation for various helper functions for manipulating :any:`KnuthBendix` objects. All such functions are contained in the diff --git a/docs/source/main-algorithms/low-index/classes/index.rst b/docs/source/main-algorithms/low-index/classes/index.rst index e92ba1886..1120f91e1 100644 --- a/docs/source/main-algorithms/low-index/classes/index.rst +++ b/docs/source/main-algorithms/low-index/classes/index.rst @@ -5,7 +5,7 @@ The full license is in the file LICENSE, distributed with this software. -.. currentmodule:: _libsemigroups_pybind11 +.. currentmodule:: libsemigroups_pybind11 Classes for low-index congruences ================================= diff --git a/docs/source/main-algorithms/low-index/classes/minimalreporc.rst b/docs/source/main-algorithms/low-index/classes/minimalreporc.rst index 00d3025c1..e0765dc4b 100644 --- a/docs/source/main-algorithms/low-index/classes/minimalreporc.rst +++ b/docs/source/main-algorithms/low-index/classes/minimalreporc.rst @@ -5,7 +5,7 @@ The full license is in the file LICENSE, distributed with this software. -.. currentmodule:: _libsemigroups_pybind11 +.. currentmodule:: libsemigroups_pybind11 The MinimalRepOrc class ======================= @@ -21,7 +21,6 @@ Contents :signatures: short ~MinimalRepOrc - MinimalRepOrc.__init__ MinimalRepOrc.add_excluded_pair MinimalRepOrc.add_included_pair MinimalRepOrc.add_pruner @@ -41,13 +40,13 @@ Contents MinimalRepOrc.presentation MinimalRepOrc.pruners MinimalRepOrc.stats + MinimalRepOrc.target_size + MinimalRepOrc.word_graph Full API -------- .. autoclass:: MinimalRepOrc - :no-doc: - :class-doc-from: class + :class-doc-from: init :members: :inherited-members: - :special-members: __init__ diff --git a/docs/source/main-algorithms/low-index/classes/reporc.rst b/docs/source/main-algorithms/low-index/classes/reporc.rst index 1929989aa..3c82aaff7 100644 --- a/docs/source/main-algorithms/low-index/classes/reporc.rst +++ b/docs/source/main-algorithms/low-index/classes/reporc.rst @@ -5,7 +5,7 @@ The full license is in the file LICENSE, distributed with this software. -.. currentmodule:: _libsemigroups_pybind11 +.. currentmodule:: libsemigroups_pybind11 The RepOrc class ================ @@ -21,7 +21,6 @@ Contents :signatures: short ~RepOrc - RepOrc.__init__ RepOrc.add_excluded_pair RepOrc.add_included_pair RepOrc.add_pruner @@ -36,18 +35,20 @@ Contents RepOrc.init RepOrc.long_rule_length RepOrc.long_rules + RepOrc.max_nodes + RepOrc.min_nodes RepOrc.number_of_long_rules RepOrc.number_of_threads RepOrc.presentation RepOrc.pruners RepOrc.stats + RepOrc.target_size + RepOrc.word_graph Full API -------- .. autoclass:: RepOrc - :no-doc: - :class-doc-from: class + :class-doc-from: init :members: :inherited-members: - :special-members: __init__ diff --git a/docs/source/main-algorithms/low-index/classes/sims1.rst b/docs/source/main-algorithms/low-index/classes/sims1.rst index 30395ac95..3f8130d4a 100644 --- a/docs/source/main-algorithms/low-index/classes/sims1.rst +++ b/docs/source/main-algorithms/low-index/classes/sims1.rst @@ -5,7 +5,7 @@ The full license is in the file LICENSE, distributed with this software. -.. currentmodule:: _libsemigroups_pybind11 +.. currentmodule:: libsemigroups_pybind11 The Sims1 class =============== @@ -49,10 +49,6 @@ Contents Full API -------- -.. - TODO(0) document __init__ directly, the same trick that works for RepOrc + - MinimalRepOrc doesn't work here for some reason. - .. autoclass:: Sims1 :class-doc-from: init :members: diff --git a/docs/source/main-algorithms/low-index/classes/sims2.rst b/docs/source/main-algorithms/low-index/classes/sims2.rst index 84f30a1b5..fd15e78b0 100644 --- a/docs/source/main-algorithms/low-index/classes/sims2.rst +++ b/docs/source/main-algorithms/low-index/classes/sims2.rst @@ -5,7 +5,7 @@ The full license is in the file LICENSE, distributed with this software. -.. currentmodule:: _libsemigroups_pybind11 +.. currentmodule:: libsemigroups_pybind11 The Sims2 class =============== @@ -49,10 +49,6 @@ Contents Full API -------- -.. - TODO(0) document __init__ directly, the same trick that works for RepOrc + - MinimalRepOrc doesn't work here for some reason. - .. autoclass:: Sims2 :class-doc-from: init :members: diff --git a/docs/source/main-algorithms/low-index/classes/simsrefinerfaithful.rst b/docs/source/main-algorithms/low-index/classes/simsrefinerfaithful.rst index f9e1304ca..ab838a6a0 100644 --- a/docs/source/main-algorithms/low-index/classes/simsrefinerfaithful.rst +++ b/docs/source/main-algorithms/low-index/classes/simsrefinerfaithful.rst @@ -5,7 +5,7 @@ The full license is in the file LICENSE, distributed with this software. -.. currentmodule:: _libsemigroups_pybind11 +.. currentmodule:: libsemigroups_pybind11 The SimsRefinerFaithful class ============================= @@ -21,7 +21,6 @@ Contents :signatures: short ~SimsRefinerFaithful - SimsRefinerFaithful.__init__ SimsRefinerFaithful.__call__ SimsRefinerFaithful.forbid SimsRefinerFaithful.init @@ -30,8 +29,7 @@ Full API -------- .. autoclass:: SimsRefinerFaithful - :no-doc: - :class-doc-from: class + :class-doc-from: init :members: :inherited-members: - :special-members: __call__, __init__ + :special-members: __call__ diff --git a/docs/source/main-algorithms/low-index/classes/simsrefinerideals.rst b/docs/source/main-algorithms/low-index/classes/simsrefinerideals.rst index 75c73f4fd..4a603aaf4 100644 --- a/docs/source/main-algorithms/low-index/classes/simsrefinerideals.rst +++ b/docs/source/main-algorithms/low-index/classes/simsrefinerideals.rst @@ -5,7 +5,7 @@ The full license is in the file LICENSE, distributed with this software. -.. currentmodule:: _libsemigroups_pybind11 +.. currentmodule:: libsemigroups_pybind11 The SimsRefinerIdeals class =========================== @@ -22,7 +22,6 @@ Contents ~SimsRefinerIdeals SimsRefinerIdeals.__call__ - SimsRefinerIdeals.__init__ SimsRefinerIdeals.init SimsRefinerIdeals.presentation @@ -30,8 +29,7 @@ Full API -------- .. autoclass:: SimsRefinerIdeals - :no-doc: - :class-doc-from: class + :class-doc-from: init :members: :inherited-members: - :special-members: __call__, __init__ + :special-members: __call__ diff --git a/docs/source/main-algorithms/low-index/classes/simsstats.rst b/docs/source/main-algorithms/low-index/classes/simsstats.rst index 0fc75e2c3..6f5bb05b7 100644 --- a/docs/source/main-algorithms/low-index/classes/simsstats.rst +++ b/docs/source/main-algorithms/low-index/classes/simsstats.rst @@ -21,6 +21,15 @@ Contents :signatures: short ~SimsStats + SimsStats.copy + SimsStats.count_last + SimsStats.count_now + SimsStats.init + SimsStats.max_pending + SimsStats.stats_check_point + SimsStats.stats_zero + SimsStats.total_pending_last + SimsStats.total_pending_now Full API -------- diff --git a/docs/source/main-algorithms/radoszewski-rytter/index.rst b/docs/source/main-algorithms/radoszewski-rytter/index.rst index 5e364515d..da1877e5a 100644 --- a/docs/source/main-algorithms/radoszewski-rytter/index.rst +++ b/docs/source/main-algorithms/radoszewski-rytter/index.rst @@ -5,7 +5,7 @@ The full license is in the file LICENSE, distributed with this software. -.. currentmodule:: _libsemigroups_pybind11 +.. currentmodule:: libsemigroups_pybind11 Radoszewski-Rytter ================== diff --git a/docs/source/main-algorithms/schreier-sims/class.rst b/docs/source/main-algorithms/schreier-sims/class.rst index 3756f411e..37c39d366 100644 --- a/docs/source/main-algorithms/schreier-sims/class.rst +++ b/docs/source/main-algorithms/schreier-sims/class.rst @@ -20,11 +20,13 @@ Contents .. autosummary:: :signatures: short + ~SchreierSims SchreierSims.add_base_point SchreierSims.add_generator SchreierSims.base SchreierSims.base_size SchreierSims.contains + SchreierSims.copy SchreierSims.current_size SchreierSims.currently_contains SchreierSims.empty diff --git a/docs/source/main-algorithms/schreier-sims/helpers.rst b/docs/source/main-algorithms/schreier-sims/helpers.rst index 4949171ac..5d43efb60 100644 --- a/docs/source/main-algorithms/schreier-sims/helpers.rst +++ b/docs/source/main-algorithms/schreier-sims/helpers.rst @@ -5,8 +5,8 @@ The full license is in the file LICENSE, distributed with this software. -Schreier-Sims helper functions -============================== +SchreierSims helpers +==================== This page contains the documentation for various helper functions for manipulating :any:`SchreierSims` objects. @@ -14,8 +14,6 @@ manipulating :any:`SchreierSims` objects. Contents -------- -In ``libsemigroups_pybind11``: - .. currentmodule:: libsemigroups_pybind11.schreier_sims .. autosummary:: diff --git a/docs/source/main-algorithms/stephen/class.rst b/docs/source/main-algorithms/stephen/class.rst index 954227400..29cb2519f 100644 --- a/docs/source/main-algorithms/stephen/class.rst +++ b/docs/source/main-algorithms/stephen/class.rst @@ -22,13 +22,14 @@ Contents ~Stephen Stephen.accept_state + Stephen.copy Stephen.init + Stephen.initial_state Stephen.is_word_set Stephen.presentation Stephen.set_word Stephen.word Stephen.word_graph - Stephen.initial_state Full API -------- diff --git a/docs/source/main-algorithms/stephen/helpers.rst b/docs/source/main-algorithms/stephen/helpers.rst index 47cf0b53a..c51fc3301 100644 --- a/docs/source/main-algorithms/stephen/helpers.rst +++ b/docs/source/main-algorithms/stephen/helpers.rst @@ -5,8 +5,8 @@ The full license is in the file LICENSE, distributed with this software. -Stephen helper functions -======================== +Stephen helpers +=============== This page contains the documentation for various helper functions for manipulating :any:`Stephen` objects. diff --git a/docs/source/main-algorithms/todd-coxeter/helpers.rst b/docs/source/main-algorithms/todd-coxeter/helpers.rst index 8fad8daa3..4e6e323ba 100644 --- a/docs/source/main-algorithms/todd-coxeter/helpers.rst +++ b/docs/source/main-algorithms/todd-coxeter/helpers.rst @@ -5,8 +5,8 @@ The full license is in the file LICENSE, distributed with this software. -Todd-Coxeter helper functions -============================= +ToddCoxeter helpers +=================== This page contains the documentation for various helper functions for manipulating :any:`ToddCoxeter` objects. @@ -21,9 +21,9 @@ Contents class_by_index class_of - normal_forms is_non_trivial non_trivial_classes + normal_forms partition redundant_rule diff --git a/docs/source/main-algorithms/todd-coxeter/index.rst b/docs/source/main-algorithms/todd-coxeter/index.rst index af22e1041..88c07413e 100644 --- a/docs/source/main-algorithms/todd-coxeter/index.rst +++ b/docs/source/main-algorithms/todd-coxeter/index.rst @@ -5,7 +5,7 @@ The full license is in the file LICENSE, distributed with this software. -.. currentmodule:: _libsemigroups_pybind11 +.. currentmodule:: libsemigroups_pybind11 Todd-Coxeter ============ diff --git a/src/bipart.cpp b/src/bipart.cpp index d85b2cb00..ad3162386 100644 --- a/src/bipart.cpp +++ b/src/bipart.cpp @@ -42,6 +42,8 @@ It is possible to associate to every :any:`Bipartition` a pair of blocks, which determine the Green's :math:`\mathscr{L}`- and :math:`\mathscr{R}`-classes of the :any:`Bipartition` in the monoid of all bipartitions. This is the purpose of this class. + +See also :any:`Bipartition` for more details and context. )pbdoc"); thing.def("__repr__", [](Blocks const& self) { return to_human_readable_repr(self, "[]"); diff --git a/src/dot.cpp b/src/dot.cpp index 8f46d19e4..96daa1d2a 100644 --- a/src/dot.cpp +++ b/src/dot.cpp @@ -32,10 +32,12 @@ namespace libsemigroups { namespace py = pybind11; void init_dot(py::module& m) { + //////////////////////////////////////////////////////////////////////////// + // Dot class declaration + //////////////////////////////////////////////////////////////////////////// py::class_ dot(m, "Dot", - R"pbdoc( -A representation of a graph in the `DOT + R"pbdoc(A representation of a graph in the `DOT `_ language of `Graphviz `_. @@ -51,6 +53,128 @@ source code string (:any:`Dot.to_string`). Write the source code to a file and render it with the `Graphviz `_ installation on your system. )pbdoc"); + + //////////////////////////////////////////////////////////////////////////// + // Node nested class + //////////////////////////////////////////////////////////////////////////// + py::class_ n(dot, + "Node", + R"pbdoc( +This nested class represents a node in the represented graph. +)pbdoc"); + n.def("__repr__", + py::overload_cast(&to_human_readable_repr)); + n.def_property_readonly( + "attrs", + [](Dot::Node& self) { return self.attrs; }, + R"pbdoc( + Read-only dictionary containing the attributes of the node. + )pbdoc"); + n.def_readonly("name", + &Dot::Node::name, + R"pbdoc( +The name of the node. +)pbdoc"); + n.def("add_attr", + &Dot::Node::add_attr, + py::arg("key"), + py::arg("val"), + R"pbdoc(Add an attribute to an node. + +This function adds a new attribute, or replaces the value of an existing +attribute of a :any:`Dot.Node`. + +:param key: the name of the attribute. +:type key: str +:param val: the value of the attribute. +:type val: str + +:returns: ``self`` +:rtype: Dot.Node +)pbdoc", + py::return_value_policy::reference); + + //////////////////////////////////////////////////////////////////////////// + // Edge nested class + //////////////////////////////////////////////////////////////////////////// + py::class_ e(dot, + "Edge", + R"pbdoc( +Instances of this nested class represents an edge in the represented graph. + +:any:`Edge` objects can only be constructed by calling :any:`Dot.add_edge`. +)pbdoc"); + e.def("__repr__", + py::overload_cast(&to_human_readable_repr)); + e.def_property_readonly( + "attrs", + [](Dot::Edge& self) { return self.attrs; }, + R"pbdoc( +Read-only dictionary containing containing the attributes of the :any:`Edge`. + )pbdoc"); + e.def_readonly("head", + &Dot::Edge::head, + R"pbdoc( +The name (read-only `str`) of the head of the edge. +)pbdoc"); + e.def_readonly("tail", + &Dot::Edge::tail, + R"pbdoc( +The name (read-only `str`) of the tail of the edge. +)pbdoc"); + e.def("add_attr", + &Dot::Edge::add_attr, + py::arg("key"), + py::arg("val"), + R"pbdoc(Add an attribute to an edge. + +This function adds a new attribute, or replaces the value of an existing +attribute of an :any:`Edge`. + +:param key: the name of the attribute. +:type key: str +:param val: the value of the attribute. +:type val: str + +:returns: ``self`` +:rtype: Dot.Edge +)pbdoc"); + + //////////////////////////////////////////////////////////////////////////// + // Kind enum + //////////////////////////////////////////////////////////////////////////// + py::options options; + options.disable_enum_members_docstring(); + py::enum_ kind(dot, "Kind", R"pbdoc( +The values in this enum can be used to indicate the type of a graph. + +The valid values are: + +.. py:attribute:: Kind.digraph + :value: + + Value indicating that the represented graph has directed edges ->. + +.. py:attribute:: Kind.graph + :value: + + Value indicating that the represented graph has undirected edges --. + +.. py:attribute:: Kind.subgraph + :value: + + Value indicating that the represented graph is a subgraph of another Dot object. +)pbdoc"); + kind.value("digraph", Dot::Kind::digraph) + .value("graph", Dot::Kind::graph) + .value("subgraph", Dot::Kind::subgraph); + kind.def("__repr__", [](Dot::Kind const& knd) { + return to_human_readable_repr(knd, "."); + }); + + //////////////////////////////////////////////////////////////////////////// + // Dot members + //////////////////////////////////////////////////////////////////////////// dot.def("__repr__", py::overload_cast(&to_human_readable_repr)); // This does not return by reference, not sure how to get it to, given that @@ -387,107 +511,6 @@ attribute of an :any:`Dot`. :rtype: Dot )pbdoc", py::return_value_policy::reference); - - py::enum_ kind( - dot, - "Kind", - R"pbdoc(Enum indicating what type of graph is represented by a :any:`Dot` object.)pbdoc"); - kind.value( - "digraph", - Dot::Kind::digraph, - R"pbdoc(Value indicating that the represented graph has directed edges ``->``.)pbdoc") - .value( - "graph", - Dot::Kind::graph, - R"pbdoc(Value indicating that the represented graph has (undirected) edges ``--``.)pbdoc") - .value( - "subgraph", - Dot::Kind::subgraph, - R"pbdoc(Value indicating that a :any:`Dot` object is a subgraph of another :any:`Dot` object.)pbdoc"); - - kind.def("__repr__", [](Dot::Kind const& knd) { - return to_human_readable_repr(knd, "."); - }); - - py::class_ n(dot, - "Node", - R"pbdoc( -This nested class represents a node in the represented graph. -)pbdoc"); - n.def("__repr__", - py::overload_cast(&to_human_readable_repr)); - n.def_property_readonly( - "attrs", - [](Dot::Node& self) { return self.attrs; }, - R"pbdoc( - Read-only dictionary containing the attributes of the node. - )pbdoc"); - n.def_readonly("name", - &Dot::Node::name, - R"pbdoc( -The name of the node. -)pbdoc"); - n.def("add_attr", - &Dot::Node::add_attr, - py::arg("key"), - py::arg("val"), - R"pbdoc(Add an attribute to an node. - -This function adds a new attribute, or replaces the value of an existing -attribute of a :any:`Dot.Node`. - -:param key: the name of the attribute. -:type key: str -:param val: the value of the attribute. -:type val: str - -:returns: ``self`` -:rtype: Dot.Node -)pbdoc", - py::return_value_policy::reference); - - py::class_ e(dot, - "Edge", - R"pbdoc( -Instances of this nested class represents an edge in the represented graph. - -:any:`Edge` objects can only be constructed by calling :any:`Dot.add_edge`. -)pbdoc"); - e.def("__repr__", - py::overload_cast(&to_human_readable_repr)); - e.def_property_readonly( - "attrs", - [](Dot::Edge& self) { return self.attrs; }, - R"pbdoc( -Read-only dictionary containing containing the attributes of the :any:`Edge`. - )pbdoc"); - e.def_readonly("head", - &Dot::Edge::head, - R"pbdoc( -The name (read-only `str`) of the head of the edge. -)pbdoc"); - e.def_readonly("tail", - &Dot::Edge::tail, - R"pbdoc( -The name (read-only `str`) of the tail of the edge. -)pbdoc"); - e.def("add_attr", - &Dot::Edge::add_attr, - py::arg("key"), - py::arg("val"), - R"pbdoc(Add an attribute to an edge. - -This function adds a new attribute, or replaces the value of an existing -attribute of an :any:`Edge`. - -:param key: the name of the attribute. -:type key: str -:param val: the value of the attribute. -:type val: str - -:returns: ``self`` -:rtype: Dot.Edge -)pbdoc"); } // init_dot } // namespace libsemigroups diff --git a/src/libsemigroups_pybind11/congruence.py b/src/libsemigroups_pybind11/congruence.py index 5d71e6f94..0cab119b3 100644 --- a/src/libsemigroups_pybind11/congruence.py +++ b/src/libsemigroups_pybind11/congruence.py @@ -12,7 +12,7 @@ the submodule ``congruence``. """ -from typing import Union +from typing import Union as _Union from typing_extensions import Self as _Self from _libsemigroups_pybind11 import ( # pylint: disable=no-name-in-module @@ -73,7 +73,7 @@ def __init__(self: _Self, *args, **kwargs) -> None: def get( self: _Self, t: type - ) -> Union[_Kambites, _KnuthBendix, _ToddCoxeter]: + ) -> _Union[_Kambites, _KnuthBendix, _ToddCoxeter]: """ :sig=(self: Congruence, t: type) -> Kambites | KnuthBendix | ToddCoxeter: Returns the *t* instance used to compute the congruence (if any). diff --git a/src/libsemigroups_pybind11/froidure_pin.py b/src/libsemigroups_pybind11/froidure_pin.py index 2bb59a69f..97d26862c 100644 --- a/src/libsemigroups_pybind11/froidure_pin.py +++ b/src/libsemigroups_pybind11/froidure_pin.py @@ -11,7 +11,7 @@ # pylint: disable=missing-module-docstring -from typing import TypeVar as _TypeVar, Iterator +from typing import TypeVar as _TypeVar, Iterator as _Iterator from typing_extensions import Self as _Self from _libsemigroups_pybind11 import ( # pylint: disable=no-name-in-module,unused-import @@ -176,7 +176,7 @@ def __getitem__(self: _Self, i: int) -> Element: self._raise_if_element_not_implemented() return _to_py(_to_cxx(self)[i]) - def __iter__(self: _Self) -> Iterator[Element]: + def __iter__(self: _Self) -> _Iterator[Element]: self._raise_if_element_not_implemented() return map(_to_py, iter(_to_cxx(self))) @@ -189,7 +189,7 @@ def __iter__(self: _Self) -> Iterator[Element]: @_copydoc(_FroidurePinPBR.current_elements) def current_elements( # pylint: disable=missing-function-docstring self: _Self, - ) -> Iterator[Element]: + ) -> _Iterator[Element]: self._raise_if_element_not_implemented() return map( _to_py, @@ -199,7 +199,7 @@ def current_elements( # pylint: disable=missing-function-docstring @_copydoc(_FroidurePinPBR.idempotents) def idempotents( # pylint: disable=missing-function-docstring self: _Self, - ) -> Iterator[Element]: + ) -> _Iterator[Element]: self._raise_if_element_not_implemented() return map( _to_py, @@ -209,7 +209,7 @@ def idempotents( # pylint: disable=missing-function-docstring @_copydoc(_FroidurePinPBR.sorted_elements) def sorted_elements( # pylint: disable=missing-function-docstring self: _Self, - ) -> Iterator[Element]: + ) -> _Iterator[Element]: self._raise_if_element_not_implemented() return map( _to_py, diff --git a/src/libsemigroups_pybind11/kambites.py b/src/libsemigroups_pybind11/kambites.py index ac424544f..9c791579b 100644 --- a/src/libsemigroups_pybind11/kambites.py +++ b/src/libsemigroups_pybind11/kambites.py @@ -11,7 +11,7 @@ contains helper functions for the :any:`Kambites` class. """ -from typing_extensions import Self +from typing_extensions import Self as _Self from _libsemigroups_pybind11 import ( # pylint: disable=no-name-in-module KambitesMultiStringView as _KambitesMultiStringView, @@ -58,7 +58,7 @@ class Kambites(_CongruenceCommon): # pylint: disable=missing-class-docstring _all_wrapped_cxx_types = {*_cxx_type_to_py_template_params.keys()} @_copydoc(_KambitesWord.__init__) - def __init__(self: Self, *args, **kwargs) -> None: + def __init__(self: _Self, *args, **kwargs) -> None: super().__init__(*args, **kwargs) if _to_cxx(self) is not None: return diff --git a/src/libsemigroups_pybind11/konieczny.py b/src/libsemigroups_pybind11/konieczny.py index 860d69b70..12ab06cdf 100644 --- a/src/libsemigroups_pybind11/konieczny.py +++ b/src/libsemigroups_pybind11/konieczny.py @@ -11,8 +11,8 @@ contains helper functions for the :any:`Konieczny` class. """ -from typing import TypeVar as _TypeVar, Iterator -from typing_extensions import Self +from typing import TypeVar as _TypeVar, Iterator as _Iterator +from typing_extensions import Self as _Self from _libsemigroups_pybind11 import ( # pylint: disable=no-name-in-module BMat as _BMat, @@ -109,11 +109,11 @@ class DClass(_CxxWrapper): # pylint: disable=missing-class-docstring _all_wrapped_cxx_types = {*_py_template_params_to_cxx_type.values()} - def __contains__(self: Self, x: Element) -> bool: + def __contains__(self: _Self, x: Element) -> bool: return _to_cxx(self).contains(_to_cxx(x)) @_copydoc(_KoniecznyBMat8DClass.__init__) - def __init__(self: Self, *args) -> None: + def __init__(self: _Self, *args) -> None: super().__init__(*args) assert _to_cxx(self) is not None @@ -125,7 +125,7 @@ def __init__(self: Self, *args) -> None: # so that we know which Konieczny type to construct based on the element # and/or the underlying cxx type. @_copydoc(_KoniecznyBMat.__init__) - def __init__(self: Self, *args) -> None: + def __init__(self: _Self, *args) -> None: super().__init__(*args) if _to_cxx(self) is not None: return @@ -140,7 +140,7 @@ def __init__(self: Self, *args) -> None: self.py_template_params = (type(gens[0]),) self.init_cxx_obj(gens) - def __contains__(self: Self, x: Element) -> bool: + def __contains__(self: _Self, x: Element) -> bool: return _to_cxx(self).contains(_to_cxx(x)) ######################################################################## @@ -148,7 +148,7 @@ def __contains__(self: Self, x: Element) -> bool: ######################################################################## @_copydoc(_KoniecznyBMat.generators) - def generators(self: Self) -> Iterator[Element]: + def generators(self: _Self) -> _Iterator[Element]: # pylint: disable=missing-function-docstring return map( _to_py, @@ -156,7 +156,7 @@ def generators(self: Self) -> Iterator[Element]: ) @_copydoc(_KoniecznyBMat.current_D_classes) - def current_D_classes(self: Self) -> Iterator[DClass]: + def current_D_classes(self: _Self) -> _Iterator[DClass]: # pylint: disable=missing-function-docstring,invalid-name return map( _to_py, @@ -164,7 +164,7 @@ def current_D_classes(self: Self) -> Iterator[DClass]: ) @_copydoc(_KoniecznyBMat.D_classes) - def D_classes(self: Self) -> Iterator[DClass]: + def D_classes(self: _Self) -> _Iterator[DClass]: # pylint: disable=missing-function-docstring,invalid-name return map( _to_py, diff --git a/src/libsemigroups_pybind11/todd_coxeter.py b/src/libsemigroups_pybind11/todd_coxeter.py index f0ea8542c..19b27f0e0 100644 --- a/src/libsemigroups_pybind11/todd_coxeter.py +++ b/src/libsemigroups_pybind11/todd_coxeter.py @@ -19,7 +19,6 @@ ToddCoxeterString as _ToddCoxeterString, ToddCoxeterWord as _ToddCoxeterWord, WordGraph as _WordGraph, - congruence_kind as _congruence_kind, todd_coxeter_class_by_index as _todd_coxeter_class_by_index, todd_coxeter_class_of as _todd_coxeter_class_of, todd_coxeter_is_non_trivial as _todd_coxeter_is_non_trivial, @@ -89,7 +88,6 @@ def __init__(self: _Self, *args, **kwargs) -> None: class_by_index = _wrap_cxx_free_fn(_todd_coxeter_class_by_index) class_of = _wrap_cxx_free_fn(_todd_coxeter_class_of) -congruence_kind = _wrap_cxx_free_fn(_congruence_kind) is_non_trivial = _wrap_cxx_free_fn(_todd_coxeter_is_non_trivial) non_trivial_classes = _wrap_cxx_free_fn(_todd_coxeter_non_trivial_classes) normal_forms = _wrap_cxx_free_fn(_todd_coxeter_normal_forms) diff --git a/src/paths.cpp b/src/paths.cpp index 73350e3e2..3e4f3a2f6 100644 --- a/src/paths.cpp +++ b/src/paths.cpp @@ -49,6 +49,8 @@ namespace libsemigroups { py::class_ thing1(m, "Paths", R"pbdoc( +Class for iterating through paths in a :any:`WordGraph`. + This class represents a range object that facilitates iterating through the paths in a :any:`WordGraph` from a given :any:`source` (to a possible :any:`target` node) in a particular :any:`order`. diff --git a/src/pbr.cpp b/src/pbr.cpp index 1093a2c0e..97fd364bd 100644 --- a/src/pbr.cpp +++ b/src/pbr.cpp @@ -76,7 +76,7 @@ A negative value ``i`` corresponds to ``n - i``. :raises LibsemigroupsError: if the resultant PBR: * would not describe a binary relation on an even number of points; or - * would have a point related to a point that is greater than :any:`degree`; + * would have a point related to a point that is greater than :any:`PBR.degree`; )pbdoc"); thing.def( py::init([](PBR::vector_type x) { return make(x); }), @@ -95,7 +95,7 @@ in the :any:`PBR` constructed. :raises LibsemigroupsError: if the resultant PBR: * would not describe a binary relation on an even number of points; or - * would have a point related to a point that is greater than :any:`degree`; + * would have a point related to a point that is greater than :any:`PBR.degree`; * *x* contains a list of points related to a point that is not sorted. )pbdoc"); @@ -110,7 +110,7 @@ Compare for less. :returns: ``True`` if ``self`` is less than ``that``, and ``False`` otherwise. :rtype: bool -:complexity: At worst linear in :any:`degree`. +:complexity: At worst linear in :any:`PBR.degree`. )pbdoc"); thing.def(py::self == py::self, py::arg("that"), @@ -123,7 +123,7 @@ Compare two PBRs for equality. :returns: ``True`` if ``self`` equals ``that``, and ``False`` otherwise. :rtype: bool -:complexity: At worst linear in :any:`degree`. +:complexity: At worst linear in :any:`PBR.degree`. )pbdoc"); thing.def( "__mul__", @@ -220,8 +220,8 @@ then bad things will happen. :type thread_id: int :raises LibsemigroupsError: if: - * the :any:`degree` of *x* is not the same as the :any:`degree` of *y*; - * the :any:`degree` of ``self`` is not the same as the :any:`degree` of *x*; or + * the :any:`PBR.degree` of *x* is not the same as the :any:`PBR.degree` of *y*; + * the :any:`PBR.degree` of ``self`` is not the same as the :any:`PBR.degree` of *x*; or * either *x* or *y* is the same object as `self`. )pbdoc"); thing.def( diff --git a/src/present.cpp b/src/present.cpp index 54055bf86..cf4ef722d 100644 --- a/src/present.cpp +++ b/src/present.cpp @@ -1202,7 +1202,7 @@ modified version. )pbdoc"); m.def( "presentation_to_gap_string", - [](Presentation const& p, std::string const& var_name) { + [](Presentation_ const& p, std::string const& var_name) { return presentation::to_gap_string(p, var_name); }, py::arg("p"), @@ -1222,13 +1222,6 @@ are created by taking quotients of free semigroups or monoids. :param var_name: the name of the variable to be used in GAP. :type var_name: str )pbdoc"); - m.def( - "presentation_to_gap_string", - [](Presentation const& p, std::string const& var_name) { - return presentation::to_gap_string(p, var_name); - }, - py::arg("p"), - py::arg("var_name")); m.def("presentation_throw_if_bad_inverses", &presentation::throw_if_bad_inverses, py::arg("p"), @@ -1399,7 +1392,7 @@ defined in the alphabet, and that the inverses act as semigroup inverses. * :any:`presentation.throw_if_bad_inverses` )pbdoc"); } // bind_inverse_present - } // namespace + } // namespace void init_present(py::module& m) { bind_present(m, "PresentationWord"); diff --git a/src/presentation-examples.cpp b/src/presentation-examples.cpp index 213adfa1c..15b647b8a 100644 --- a/src/presentation-examples.cpp +++ b/src/presentation-examples.cpp @@ -814,7 +814,7 @@ from :any:`plactic_monoid_Knu70`. py::arg("n"), R"pbdoc( :sig=(n: int) -> Presentation: -A presentation for the $0$-rook monoid. +A presentation for the :math:`0`-rook monoid. This function returns a presentation for the :math:`0` -rook monoid of degree *n*, as in Definition 4.1.1 in :cite:`Gay2018aa`. diff --git a/src/runner.cpp b/src/runner.cpp index a35fb084f..b028b59a4 100644 --- a/src/runner.cpp +++ b/src/runner.cpp @@ -253,6 +253,8 @@ a derived class with a possibly long running :any:`run`. These common tasks :any:`finished`? been killed by another thread (:any:`dead`)? has it timed out (:any:`timed_out`)? has it :any:`stopped` for any reason? * permit the function :any:`run` to be killed from another thread (:any:`kill`). + +This class inherits from :any:`Reporter`. )pbdoc"); py::enum_ state(m, "Runner.state", R"pbdoc( @@ -333,7 +335,7 @@ any derived class of :any:`Runner`. .. seealso:: :any:`run_for`)pbdoc"); thing.def("run_until", - (void (Runner::*)(std::function&)) &Runner::run_until, + (void(Runner::*)(std::function&)) & Runner::run_until, py::arg("func"), R"pbdoc( Run until a nullary predicate returns true or finished. diff --git a/src/transf.cpp b/src/transf.cpp index ce15a9d92..ee4baa28e 100644 --- a/src/transf.cpp +++ b/src/transf.cpp @@ -374,13 +374,6 @@ of :math:`f`. A transformation is stored as a list of the images of :math:`\{0, Transformations are optimised for the number of points in the image with fewer points requiring less space per point. -There are a number of helper functions for :py:class:`Transf` objects detailed below. - -.. toctree:: - :maxdepth: 1 - - transf-helpers - .. doctest:: >>> from libsemigroups_pybind11.transf import Transf, one @@ -460,10 +453,12 @@ i.e. :math:`((0)f, (1)f, \ldots, (n - 1)f)` where the value :any:`UNDEFINED` is used to indicate that :math:`(i)f` is undefined (i.e. not among the points where :math:`f` is defined). +These partial permutations are optimised for the number of points in the image +with fewer points requiring less space per point. + .. doctest:: - >>> from libsemigroups_pybind11.transf import PPerm, one, inverse, - ... right_one, left_one, domain, image + >>> from libsemigroups_pybind11.transf import PPerm, one, inverse, right_one, left_one, domain, image >>> from libsemigroups_pybind11 import UNDEFINED >>> x = PPerm([1, 0, 2], [0, 1, 2], 4) >>> x.degree() @@ -664,13 +659,6 @@ of :math:`\{0, 1, \ldots, n - 1\}` for some integer :math:`n` called the Permutations are optimised for the number of points in the image with fewer points requiring less space per point. -There are a number of helper functions for :py:class:`Perm` objects detailed below. - -.. toctree:: - :maxdepth: 1 - - transf-helpers - .. doctest:: >>> from libsemigroups_pybind11.transf import Perm, one, inverse @@ -730,7 +718,7 @@ There are a number of helper functions for :py:class:`Perm` objects detailed bel m.def("transf_inverse", py::overload_cast(&inverse)); } // bind_perm - } // namespace + } // namespace void init_transf(py::module& m) { // Transformations diff --git a/src/ukkonen.cpp b/src/ukkonen.cpp index b97d809cc..ee5d682e8 100644 --- a/src/ukkonen.cpp +++ b/src/ukkonen.cpp @@ -644,8 +644,9 @@ The index of the parent node. R"pbdoc( The index of one past the last letter in the edge leading to the node. )pbdoc"); - node.def_readwrite("link", &Ukkonen::Node::link); - node.def_readwrite("is_real_suffix", &Ukkonen::Node::is_real_suffix); + // TODO(0): Document or remove? These are not documented in libsemigroups + // node.def_readwrite("link", &Ukkonen::Node::link); + // node.def_readwrite("is_real_suffix", &Ukkonen::Node::is_real_suffix); node.def(py::init(), py::arg("l") = 0, py::arg("r") = 0,