Skip to content

Commit

Permalink
Ensure shortened numpy and galois references
Browse files Browse the repository at this point in the history
  • Loading branch information
mhostetter committed Nov 20, 2023
1 parent 48fca42 commit 298c1d6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

import inspect
import os
import re
import sys

sys.path.insert(0, os.path.abspath("."))
Expand Down Expand Up @@ -440,7 +441,8 @@ def modify_type_hints(signature):
See https://github.com/jbms/sphinx-immaterial/issues/161
"""
if signature:
signature = signature.replace("np", "~numpy")
signature = re.sub(r"(?<!~)np\.", "~numpy.", signature)
signature = re.sub(r"(?<!~)galois\.", "~galois.", signature)
return signature


Expand Down

0 comments on commit 298c1d6

Please sign in to comment.