From 21c3bc408767ac2b2966295099d297f454c8c908 Mon Sep 17 00:00:00 2001 From: James Mitchell Date: Thu, 12 Jun 2025 14:41:49 +0100 Subject: [PATCH 1/3] doc: readd MatrixKind doc --- .../elements/matrix/matrix.rst | 1 + docs/source/install.rst | 2 +- src/libsemigroups_pybind11/matrix.py | 47 ++++++++++++++++++- 3 files changed, 47 insertions(+), 3 deletions(-) diff --git a/docs/source/data-structures/elements/matrix/matrix.rst b/docs/source/data-structures/elements/matrix/matrix.rst index 90f07303e..bca115d03 100644 --- a/docs/source/data-structures/elements/matrix/matrix.rst +++ b/docs/source/data-structures/elements/matrix/matrix.rst @@ -150,6 +150,7 @@ MatrixKind ---------- .. autoclass:: MatrixKind + :show-inheritance: .. TODO later summary diff --git a/docs/source/install.rst b/docs/source/install.rst index 542e8f1fd..40114f6bd 100644 --- a/docs/source/install.rst +++ b/docs/source/install.rst @@ -5,7 +5,7 @@ The full license is in the file LICENSE, distributed with this software. -.. |libsemigroups-pybind11-version| replace:: 1.0.0 +|libsemigroups-pybind11-version| replace:: 1.0.0 Installation ============ diff --git a/src/libsemigroups_pybind11/matrix.py b/src/libsemigroups_pybind11/matrix.py index 70d16d696..5d64f6fe2 100644 --- a/src/libsemigroups_pybind11/matrix.py +++ b/src/libsemigroups_pybind11/matrix.py @@ -36,9 +36,52 @@ # the underscore prefix stops this from appearing in the doc of the # "matrix" submodule class _MatrixKind(_Enum): - """""" + """ + + This enum contains values that can be used to describe the type of semiring + over which a :any:`Matrix` is defined. + + .. py:attribute:: MatrixKind.Boolean + :value: + + For matrices over the Boolean semiring. + + .. py:attribute:: MatrixKind.Integer + :value: + + For matrices over the usual ring of integers. + + .. py:attribute:: MatrixKind.MaxPlus + :value: + + For matrices over the max-plus semiring. + + .. py:attribute:: MatrixKind.MinPlus + :value: - # pylint: disable=invalid-name + For matrices over the min-plus semiring. + + .. py:attribute:: MatrixKind.ProjMaxPlus + :value: + + For projective matrices over the max-plus semiring. + + .. py:attribute:: MatrixKind.MaxPlusTrunc + :value: + + For matrices over the truncated max-plus semiring. + + .. py:attribute:: MatrixKind.MinPlusTrunc + :value: + + For matrices over the truncated min-plus semiring. + + .. py:attribute:: MatrixKind.NTP + :value: + + For matrices over the semiring of natural numbers quotiented by `t + = t + p`. + """ Boolean = 0 Integer = 1 From fcd865abc53d63535cb96fcb3b198ca95555dea0 Mon Sep 17 00:00:00 2001 From: James Mitchell Date: Fri, 13 Jun 2025 16:43:44 +0100 Subject: [PATCH 2/3] Fix linting --- src/libsemigroups_pybind11/matrix.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/libsemigroups_pybind11/matrix.py b/src/libsemigroups_pybind11/matrix.py index 5d64f6fe2..c9019eedf 100644 --- a/src/libsemigroups_pybind11/matrix.py +++ b/src/libsemigroups_pybind11/matrix.py @@ -36,6 +36,7 @@ # the underscore prefix stops this from appearing in the doc of the # "matrix" submodule class _MatrixKind(_Enum): + # pylint: disable=invalid-name """ This enum contains values that can be used to describe the type of semiring From 060ca00c5776f52f1da1200200564c967726ca2e Mon Sep 17 00:00:00 2001 From: James Mitchell Date: Fri, 13 Jun 2025 21:05:35 +0100 Subject: [PATCH 3/3] Update docs/source/install.rst Co-authored-by: Joe Edwards <80713360+Joseph-Edwards@users.noreply.github.com> --- docs/source/install.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/install.rst b/docs/source/install.rst index 40114f6bd..542e8f1fd 100644 --- a/docs/source/install.rst +++ b/docs/source/install.rst @@ -5,7 +5,7 @@ The full license is in the file LICENSE, distributed with this software. -|libsemigroups-pybind11-version| replace:: 1.0.0 +.. |libsemigroups-pybind11-version| replace:: 1.0.0 Installation ============