From 52993d617fe20389cbffd1e101ddf2f320535cee Mon Sep 17 00:00:00 2001 From: James Mitchell Date: Tue, 17 Jun 2025 14:23:09 +0100 Subject: [PATCH 1/4] Expose Runner/Reporter/delta --- docs/source/main-algorithms/core-classes/delta.rst | 13 +++++++++++++ docs/source/main-algorithms/core-classes/index.rst | 3 ++- src/libsemigroups_pybind11/__init__.py | 3 +++ tests/test_runner.py | 2 +- tests/test_to.py | 3 +++ 5 files changed, 22 insertions(+), 2 deletions(-) create mode 100644 docs/source/main-algorithms/core-classes/delta.rst diff --git a/docs/source/main-algorithms/core-classes/delta.rst b/docs/source/main-algorithms/core-classes/delta.rst new file mode 100644 index 000000000..a70cb80ca --- /dev/null +++ b/docs/source/main-algorithms/core-classes/delta.rst @@ -0,0 +1,13 @@ +.. + 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. + +.. currentmodule:: _libsemigroups_pybind11 + +The delta function +================== + +.. autofunction:: delta diff --git a/docs/source/main-algorithms/core-classes/index.rst b/docs/source/main-algorithms/core-classes/index.rst index b382814b9..519644294 100644 --- a/docs/source/main-algorithms/core-classes/index.rst +++ b/docs/source/main-algorithms/core-classes/index.rst @@ -20,6 +20,7 @@ pages. .. toctree:: :maxdepth: 1 + delta reporter report-guard - runner \ No newline at end of file + runner diff --git a/src/libsemigroups_pybind11/__init__.py b/src/libsemigroups_pybind11/__init__.py index 387639460..5ad2f9f6d 100644 --- a/src/libsemigroups_pybind11/__init__.py +++ b/src/libsemigroups_pybind11/__init__.py @@ -70,6 +70,8 @@ Paths, PositiveInfinity, ReportGuard, + Reporter, + Runner, StringRange, ToString, ToWord, @@ -79,6 +81,7 @@ WordGraph, WordRange, congruence_kind, + delta, error_message_with_prefix, freeband_equal_to, lexicographical_compare, diff --git a/tests/test_runner.py b/tests/test_runner.py index 373af7606..b8784a1d1 100644 --- a/tests/test_runner.py +++ b/tests/test_runner.py @@ -13,7 +13,7 @@ from datetime import timedelta -from _libsemigroups_pybind11 import ( # pylint: disable=no-name-in-module +from libsemigroups_pybind11 import ( # pylint: disable=no-name-in-module Reporter, delta, ) diff --git a/tests/test_to.py b/tests/test_to.py index 8dd07f252..f1e05a504 100644 --- a/tests/test_to.py +++ b/tests/test_to.py @@ -12,6 +12,9 @@ """ import pytest + +# TODO(1) be good to remove the imports from _libsemigroups_pybind11, but +# couldn't immediately figure out how to. from _libsemigroups_pybind11 import ( FroidurePinKBEStringRewriteFromLeft, FroidurePinKBEStringRewriteTrie, From ebeef65cd3ae056bc3b7e4444dfca9539f51cd91 Mon Sep 17 00:00:00 2001 From: James Mitchell Date: Tue, 17 Jun 2025 15:07:13 +0100 Subject: [PATCH 2/4] Fix currentmodule --- docs/source/main-algorithms/core-classes/delta.rst | 2 ++ docs/source/main-algorithms/core-classes/reporter.rst | 2 +- docs/source/main-algorithms/core-classes/runner.rst | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/source/main-algorithms/core-classes/delta.rst b/docs/source/main-algorithms/core-classes/delta.rst index a70cb80ca..e0fc7dc98 100644 --- a/docs/source/main-algorithms/core-classes/delta.rst +++ b/docs/source/main-algorithms/core-classes/delta.rst @@ -10,4 +10,6 @@ The delta function ================== +This page contains the documentation for the :any:`delta` function. + .. autofunction:: delta diff --git a/docs/source/main-algorithms/core-classes/reporter.rst b/docs/source/main-algorithms/core-classes/reporter.rst index a776ffb3c..6d6ef29cc 100644 --- a/docs/source/main-algorithms/core-classes/reporter.rst +++ b/docs/source/main-algorithms/core-classes/reporter.rst @@ -5,7 +5,7 @@ The full license is in the file LICENSE, distributed with this software. -.. currentmodule:: _libsemigroups_pybind11 +.. currentmodule:: libsemigroups_pybind11 The Reporter class ================== diff --git a/docs/source/main-algorithms/core-classes/runner.rst b/docs/source/main-algorithms/core-classes/runner.rst index d92ed05db..ccb865a7d 100644 --- a/docs/source/main-algorithms/core-classes/runner.rst +++ b/docs/source/main-algorithms/core-classes/runner.rst @@ -5,7 +5,7 @@ The full license is in the file LICENSE, distributed with this software. -.. currentmodule:: _libsemigroups_pybind11 +.. currentmodule:: libsemigroups_pybind11 The Runner class ================ From 141701497d6af1fd3d07a415ce471614c72e1f47 Mon Sep 17 00:00:00 2001 From: James Mitchell Date: Tue, 17 Jun 2025 15:09:06 +0100 Subject: [PATCH 3/4] Code review changes --- tests/test_runner.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/tests/test_runner.py b/tests/test_runner.py index b8784a1d1..133ad5674 100644 --- a/tests/test_runner.py +++ b/tests/test_runner.py @@ -13,10 +13,7 @@ from datetime import timedelta -from libsemigroups_pybind11 import ( # pylint: disable=no-name-in-module - Reporter, - delta, -) +from libsemigroups_pybind11 import Reporter, delta def test_reporter_000(): From 04d8ca9841db21e3785451c164367bc673d99e00 Mon Sep 17 00:00:00 2001 From: James Mitchell Date: Tue, 17 Jun 2025 15:44:00 +0100 Subject: [PATCH 4/4] Update docs/source/main-algorithms/core-classes/delta.rst Co-authored-by: Joe Edwards <80713360+Joseph-Edwards@users.noreply.github.com> --- docs/source/main-algorithms/core-classes/delta.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/main-algorithms/core-classes/delta.rst b/docs/source/main-algorithms/core-classes/delta.rst index e0fc7dc98..1986cd2f0 100644 --- a/docs/source/main-algorithms/core-classes/delta.rst +++ b/docs/source/main-algorithms/core-classes/delta.rst @@ -10,6 +10,6 @@ The delta function ================== -This page contains the documentation for the :any:`delta` function. +This page contains the documentation for the :py:func:`delta` function. .. autofunction:: delta