Skip to content

Commit 07faea3

Browse files
docs: fix broken intersphinx links (#442)
* docs: fix broken intersphinx links for pandas and numpy Add napoleon_type_aliases to map short-form type names (ndarray, pd.DataFrame, pd.Series, etc.) used in docstrings to their fully qualified intersphinx targets. Remove the now-unnecessary pandas/numpy entries from nitpick_ignore since intersphinx can resolve them properly. Add anndata._core.anndata.AnnData to nitpick_ignore as autodoc resolves the runtime module path for base-class references which intersphinx cannot remap. Closes #437 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * docs: suppress pandas.core.frame.DataFrame nitpick warning autodoc resolves pd.DataFrame type annotations to the internal module path pandas.core.frame.DataFrame, which is not in the pandas intersphinx inventory (only pandas.DataFrame is). Add to nitpick_ignore. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 4426e4d commit 07faea3

1 file changed

Lines changed: 13 additions & 3 deletions

File tree

docs/source/conf.py

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,13 @@
113113
"Inference": ":class:`Inference <pydeseq2.inference.Inference>`",
114114
"DefaultInference": ":class:`DefaultInference "
115115
"<pydeseq2.default_inference.DefaultInference>`",
116+
# numpy short forms
117+
"ndarray": ":class:`numpy.ndarray`",
118+
"np.ndarray": ":class:`numpy.ndarray`",
119+
# pandas short forms
120+
"pd.DataFrame": ":class:`pandas.DataFrame`",
121+
"pd.Series": ":class:`pandas.Series`",
122+
"pandas.Index": ":class:`pandas.Index`",
116123
}
117124

118125
# Add any paths that contain templates here, relative to this directory.
@@ -228,10 +235,13 @@
228235
# documentation for each type specified
229236
# The following elements are the link that auto doc were not able to do
230237
nitpick_ignore = [
231-
("py:class", "pd.Series"),
232-
("py:class", "pd.DataFrame"),
238+
# anndata re-exports AnnData from a private submodule; autodoc resolves the
239+
# runtime path for base-class references which intersphinx cannot remap.
240+
("py:class", "anndata._core.anndata.AnnData"),
241+
# pandas re-exports DataFrame from pandas.core.frame, but intersphinx only
242+
# knows the public path (pandas.DataFrame). autodoc resolves type annotations
243+
# like `pd.DataFrame` to the internal module path at runtime.
233244
("py:class", "pandas.core.frame.DataFrame"),
234-
("py:class", "ndarray"),
235245
("py:class", "numpy._typing._generic_alias.ScalarType"),
236246
("py:class", "pydantic.main.BaseModel"),
237247
("py:class", "torch.nn.modules.module.Module"),

0 commit comments

Comments
 (0)