libsemigroups / libsemigroups_pybind11

Python bindings for the libsemigroups C++ library for semigroups and monoids
https://libsemigroups.github.io/libsemigroups_pybind11
GNU General Public License v3.0
6 stars 7 forks source link

Fix function names #190

Closed Joseph-Edwards closed 2 months ago

Joseph-Edwards commented 2 months ago

This PR fixes some issues relating to function names.

Fix 1

Firstly, this PR ensures that all overloads of a function have the same name in the doc. If one were to do

from _libsemigroups import pbr_one as one

the doc would look something like:

one() pbr_one(*args, **kwargs) Overloaded function.

pbr_one(n: int) [...] pbr_one(x: PBR) [...]

which is not good. After this PR, they would all appear as one

Fix 2

Secondly, as illustrated in the example above, signatures sometimes get inserted into the doc-string. Previously, we were fixing this by removing them from the html post-build. Unfortunately, if that signature contains (*agrs, **kwargs), bad things happen during the build process since sphinx interprets the *s as special charters. This PR fixes that by providing a means of removing them before Sphinx works its magic.