Skip to content

Commit

Permalink
Resolve some sphinx build warnings (#550)
Browse files Browse the repository at this point in the history
* Resolve some sphinx build warnings

* More robust rm
  • Loading branch information
bwohlberg authored Sep 10, 2024
1 parent 220802c commit f46ff25
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ help:
@echo " doctest to run all doctests embedded in the documentation (if enabled)"

clean:
rm $(AUTOSUMMARYDIR)/*
rm -f $(AUTOSUMMARYDIR)/*
rm -rf $(BUILDDIR)/*

html:
Expand Down
8 changes: 4 additions & 4 deletions docs/source/conf/80-scico_numpy.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
# Improve formatting of jax.numpy warning
f.__doc__ = re.sub(
r"^\*\*\* This function is not yet implemented by jax.numpy, and will "
"raise NotImplementedError \*\*\*",
r"raise NotImplementedError \*\*\*",
"**WARNING**: This function is not yet implemented by jax.numpy, "
" and will raise :exc:`NotImplementedError`.",
f.__doc__,
Expand All @@ -52,14 +52,14 @@
flags=re.M,
)
scico.numpy.testing.break_cycles.__doc__ = re.sub(
" __del__\) inside", "__del__\) inside", scico.numpy.testing.break_cycles.__doc__, flags=re.M
r" __del__\) inside", r"__del__\) inside", scico.numpy.testing.break_cycles.__doc__, flags=re.M
)
scico.numpy.testing.assert_raises_regex.__doc__ = re.sub(
"\*args,\n.*\*\*kwargs",
r"\*args,\n.*\*\*kwargs",
"*args, **kwargs",
scico.numpy.testing.assert_raises_regex.__doc__,
flags=re.M,
)
scico.numpy.BlockArray.global_shards.__doc__ = re.sub(
"`Shard`s", "`Shard`\ s", scico.numpy.BlockArray.global_shards.__doc__, flags=re.M
r"`Shard`s", r"`Shard`\ s", scico.numpy.BlockArray.global_shards.__doc__, flags=re.M
)
4 changes: 2 additions & 2 deletions docs/source/conf/81-scico_scipy.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
# Remove entire numpydoc references section
f.__doc__ = re.sub(r"References\n----------\n.*\n", "", f.__doc__, flags=re.DOTALL)
# Remove problematic citation
f.__doc__ = re.sub("See \[dlmf\]_ for details.", "", f.__doc__, re.M)
f.__doc__ = re.sub("\[dlmf\]_", "NIST DLMF", f.__doc__, re.M)
f.__doc__ = re.sub(r"See \[dlmf\]_ for details.", "", f.__doc__, re.M)
f.__doc__ = re.sub(r"\[dlmf\]_", "NIST DLMF", f.__doc__, re.M)

# Fix indentation problems
scico.scipy.special.sph_harm.__doc__ = re.sub(
Expand Down
6 changes: 3 additions & 3 deletions docs/source/conf/85-dtype_typehints.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ def typehints_formatter_function(annotation, config):
DType: ":obj:`~scico.typing.DType`",
# Compound types involving DType must be added here to avoid their DType
# component being expanded in the docs.
Optional[DType]: ":obj:`~typing.Optional`\ [\ :obj:`~scico.typing.DType`\ ]",
Optional[DType]: r":obj:`~typing.Optional`\ [\ :obj:`~scico.typing.DType`\ ]",
Union[DType, Sequence[DType]]: (
":obj:`~typing.Union`\ [\ :obj:`~scico.typing.DType`\ , "
":obj:`~typing.Sequence`\ [\ :obj:`~scico.typing.DType`\ ]]"
r":obj:`~typing.Union`\ [\ :obj:`~scico.typing.DType`\ , "
r":obj:`~typing.Sequence`\ [\ :obj:`~scico.typing.DType`\ ]]"
),
AxisIndex: ":obj:`~scico.typing.AxisIndex`",
ArrayIndex: ":obj:`~scico.typing.ArrayIndex`",
Expand Down

0 comments on commit f46ff25

Please sign in to comment.