Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
3 changes: 3 additions & 0 deletions docs/source/authors.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
Authors
=======

- `Reinis Cirpons`_ (rc234@st-andrews.ac.uk)_
- `Joseph Edwards`_ (jde1@st-andrews.ac.uk)
- `James Mitchell`_ (jdm3@st-andrews.ac.uk)
- `Maria Tsalakou`_ (mt200@st-andrews.ac.uk)
Expand All @@ -21,6 +22,8 @@ Authors

.. _maria tsalakou: https://mariatsalakou.github.io/

.. _reinis cirpons: https://reinisc.id.lv

Contributors
------------

Expand Down
4 changes: 2 additions & 2 deletions docs/source/changelog.rst → docs/source/changelog-v0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@

The full license is in the file LICENSE, distributed with this software.

Changelog
=========
Changelog - version 0
=====================

v0.10.1 (released 29/03/2023)
-----------------------------
Expand Down
14 changes: 14 additions & 0 deletions docs/source/changelog-v1.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
..
Copyright (c) 2025, 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.

Changelog - version 1
=====================

v1.0.0 (released ??/??/202?)
-----------------------------

TODO
6 changes: 4 additions & 2 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

rst_epilog = ""
# Read link all targets from file
with open("links.rst", encoding="utf-8") as f:
with open("_static/links.rst", encoding="utf-8") as f:
rst_epilog += f.read()

autosummary_generate = True
Expand All @@ -46,7 +46,9 @@
# Use the version number of the installed project
version = release = importlib.metadata.version(project)
language = "python"
exclude_patterns = ["_build", "_old", "links.rst"]
exclude_patterns = ["_build", "_old", "_static"]
# Don't copy the prompt characters
copybutton_exclude = ".linenos, .gp"
pygments_style = "sphinx"
highlight_language = "python"
todo_include_todos = False
Expand Down
21 changes: 0 additions & 21 deletions docs/source/data-structures/misc/index.rst

This file was deleted.

51 changes: 0 additions & 51 deletions docs/source/data-structures/misc/libsemigroups-error.rst

This file was deleted.

10 changes: 3 additions & 7 deletions docs/source/data-structures/presentations/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ the finite presentations on which these algorithms can be run is described
below.

In ``libsemigroups_pybind11``, a presentation is modelled as a collection of
*rules*, each of which is a pair of *words*. Each word is made up of *letters*.
*rules*, each of which is a pair of *words* (although these rules are stored as
a non-nested list with the left- and right-hand sides in the even and odd indexed positions respectively). Each word is made up of *letters*.
Presently, for any given presentation, all letters must either be of the type
:any:`str` or :any:`int`. In a presentation where letters are of the type
:any:`str`, words have the type :any:`str`. In a presentation where letters are
Expand All @@ -28,12 +29,6 @@ In what follows, we will use the pseudo-types ``Letter`` and ``Word`` instead of
``str | int`` and ``str | list[int]`` to further indicate that two types of
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, :any:`Runner.run_for` and
:any:`Runner.run_until`.

The classes and modules in ``libsemigroups_pybind11`` for finitely presented
semigroups and monoids are:

Expand All @@ -47,3 +42,4 @@ semigroups and monoids are:
examples
to-present
to-inverse-present
obvinf
92 changes: 14 additions & 78 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,12 @@

.. title:: libsemigroups_pybind11

Python bindings for the C++ library libsemigroups
-------------------------------------------------
|

What is ``libsemigroups``?
What is libsemigroups_?
~~~~~~~~~~~~~~~~~~~~~~~~~~

``libsemigroups`` is a C++14 library containing implementations of several
libsemigroups_ is a C++14 library containing implementations of several
algorithms for computing finite and finitely presented semigroups. Namely:

- the `Froidure-Pin algorithm`_ for computing finite semigroups
Expand All @@ -22,7 +21,7 @@ algorithms for computing finite and finitely presented semigroups. Namely:
algorithm for computing finite semigroups which act on sets.

``libsemigroups_pybind11`` is a python package exposing much (but not all) of
the functionality of ``libsemigroups``.
the functionality of libsemigroups_.

The development version of ``libsemigroups_pybind11`` is available on github_,
and some related projects are here_.
Expand All @@ -46,85 +45,23 @@ and some related projects are here_.
How to use it
~~~~~~~~~~~~~

See the installation instructions:

* :doc:`install`
* :doc:`changelog`

The structure of the module
~~~~~~~~~~~~~~~~~~~~~~~~~~~
The Python module ``libsemigroups_pybind11`` was designed to mirror the C++
library ``libsemigroups`` as closely as possible, whilst navigating the
fundamental difference between Python and C++. This is done with the help of the
tool `pybind11 <https://pybind11.readthedocs.io/en/stable/>`_.

For various implementational reasons (mostly related to Python's lack of an
analogue for C++'s templating system), the Python code exposed by ``pybind11``
is less streamlined and concise than the C++ library. To try and address this,
the authors of ``libsemigroups_pybind11`` have further wrapped the Python code
produced by ``pybind11`` to make the Python and C++ user experience as similar
as possible.

The Python bindings of the ``libsemigroups`` code produced by ``pybind11``
reside in an intermediate module called ``_libsemigroups_pybind11`` (note the
leading underscore), and the public-facing nicely wrapped code resides in this
module — ``libsemigroups_pybind11``.

Should this impact the way you, the user, use ``libsemigroups_pybind11``? For
the most part, no. It should be possible to use ``libsemigroups_pybind11`` in
the ways documented on this site without the knowledge that
``_libsemigroups_pybind11`` even exists. The notable exceptions to this relate
to type names and error messages. A lot of the code in
``libsemigroups_pybind11`` has been imported from ``_libsemigroups_pybind11``,
and this is visible in qualified type names. For example:

.. doctest:: python

>>> from libsemigroups_pybind11 import WordGraph
>>> WordGraph
<class '_libsemigroups_pybind11.WordGraph'>

Additionally, some functions or classes in the ``_libsemigroups_pybind11``
module have additional prefixes and suffixes relative to their
``libsemigroups_pybind11`` counterpart. These usually relate to the module that
the function or class is contained within or a type the function or class is
defined upon. These may appear in error messages. For example:

.. doctest:: python

>>> from libsemigroups_pybind11 import aho_corasick, AhoCorasick
>>> ac = AhoCorasick()
>>> aho_corasick.add_word(ac, False)
Traceback (most recent call last):
...
TypeError: aho_corasick_add_word(): incompatible function arguments. The following argument types are supported:
1. (ac: _libsemigroups_pybind11.AhoCorasick, w: list[int]) -> int
2. (ac: _libsemigroups_pybind11.AhoCorasick, w: str) -> int
<BLANKLINE>
Invoked with: <AhoCorasick with 1 node>, False

The :doc:`authors <authors>` of ``libsemigroups_pybind11`` have gone to a lot of
effort to try and make error messages clear, specific and intelligible; however,
if there you encounter any errors with unclear messages, please raise this on
the `issue tracker`_.

Further Info
------------

For additional information about ``libsemigroups_pybind11``, see the following:

* :doc:`authors`
* :doc:`biblio`
See the installation instructions :doc:`install`.

If you encounter any issues with the package or have any suggestions, then
please let us know on the `issue tracker`_.


.. toctree::
:caption: Package Info
:maxdepth: 1
:hidden:

install
changelog
authors
biblio
changelog-v1
changelog-v0
libsemigroups-error
install

.. toctree::
:caption: Data Structures
Expand All @@ -134,12 +71,11 @@ For additional information about ``libsemigroups_pybind11``, see the following:
data-structures/constants/index
data-structures/elements/index
data-structures/enums/index
data-structures/misc/index
data-structures/order/index
data-structures/presentations/index
data-structures/suffix-trees/index
data-structures/tries/index
data-structures/to-function
data-structures/tries/index
data-structures/visualisation/index
data-structures/word-graph/index
data-structures/words/index
Expand Down
Loading