Skip to content

Commit

Permalink
..
Browse files Browse the repository at this point in the history
  • Loading branch information
dweindl committed Apr 16, 2024
1 parent 12fa3a7 commit 0ab2a2d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion documentation/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,7 @@ def fix_typehints(sig: str) -> str:
sig = re.sub(r" &(,|\))", r"\1", sig)
sig = re.sub(r" &$", r"", sig)

# turn gsl_spans and pointers int Iterables
# turn gsl_spans and pointers into Iterables
sig = re.sub(r"([\w.]+) \*", r"Iterable[\1]", sig)
sig = re.sub(r"gsl::span< ([\w.]+) >", r"Iterable[\1]", sig)

Expand Down
4 changes: 2 additions & 2 deletions python/sdist/amici/swig.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,15 +133,15 @@ def _annotation_from_docstring(self, node: ast.FunctionDef):
for line_no, line in enumerate(docstring):
if (
match := re.match(
r"\s*:rtype:\s*(?::py:class:`)?(\w+)`?\s+$", line
r"\s*:rtype:\s*(?::py:class:`)?(\w+)`?\s*$", line
)
) and not match.group(1).startswith(":"):
node.returns = ast.Constant(match.group(1))
lines_to_remove.add(line_no)

if (
match := re.match(
r"\s*:type\s*(\w+):\W*(?::py:class:`)?(\w+)`?\s+$", line
r"\s*:type\s*(\w+):\W*(?::py:class:`)?(\w+)`?\s*$", line
)
) and not match.group(1).startswith(":"):
for arg in node.args.args:
Expand Down

0 comments on commit 0ab2a2d

Please sign in to comment.