Skip to content

Commit

Permalink
autodoc inheritance
Browse files Browse the repository at this point in the history
  • Loading branch information
colganwi committed Feb 15, 2024
1 parent b2e3cbd commit d9daa75
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 10 deletions.
8 changes: 7 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,12 @@
*[p.stem for p in (HERE / "extensions").glob("*.py")],
]

autosummary_generate = True
# Inherit docs from anndata
autodoc_default_options = {
"inherited-members": True,
}

autosummary_generate = True # Can disabled to avoid inheritance conflicts
autodoc_member_order = "groupwise"
default_role = "literal"
napoleon_google_docstring = False
Expand Down Expand Up @@ -98,6 +103,7 @@
"networkx": ("https://networkx.org/documentation/stable/", None),
"scipy": ("https://docs.scipy.org/doc/scipy/reference/", None),
"h5py": ("https://docs.h5py.org/en/stable/", None),
"hdf5plugin": ("https://hdf5plugin.readthedocs.io/en/latest/", None),
}

# List of patterns, relative to source directory, that match files and
Expand Down
22 changes: 13 additions & 9 deletions src/treedata/_core/treedata.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@
class TreeData(ad.AnnData):
"""AnnData with trees.
`TreeData` is a light-weight wrapper around :class:`~anndata.AnnData`
which adds two additional attributes, `obst` and `vart`, to
store trees for observations and variables A `TreeData`
:class:`~treedata.TreeData` is a light-weight wrapper around :class:`~anndata.AnnData`
which adds two additional attributes, :attr:`obst` and :attr:`vart`, to
store trees for observations and variables A :class:`~treedata.TreeData`
object can be used just like an :class:`~anndata.AnnData` object and stores a
data matrix `X` together with annotations
of observations `obs` (`obsm`, `obsp`, `obst`),
variables `var` (`varm`, `varp`, `vart`),
and unstructured annotations `uns`.
data matrix :attr:`X` together with annotations
of observations :attr:`obs` (:attr:`obsm`, :attr:`obsp`, :attr:`obst`),
variables :attr:`var` (:attr:`varm`, :attr:`varp`, :attr:`vart`),
and unstructured annotations :attr:`uns`.
Parameters
----------
Expand Down Expand Up @@ -133,7 +133,7 @@ def obst(self) -> AxisTrees:
"""Tree annotation of observations
Stores for each key a :class:`~networkx.DiGraph` with leaf nodes in
`obs_names`. Is subset and pruned with `data` but behaves
:attr:`obs_names`. Is subset and pruned with `data` but behaves
otherwise like a :term:`mapping`.
"""
return self._obst
Expand All @@ -143,7 +143,7 @@ def vart(self):
"""Tree annotation of variables
Stores for each key a :class:`~networkx.DiGraph` with leaf nodes in
`var_names`. Is subset and pruned with `data` but behaves
:attr:`var_names`. Is subset and pruned with `data` but behaves
otherwise like a :term:`mapping`.
"""
return self._vart
Expand Down Expand Up @@ -179,3 +179,7 @@ def __repr__(self) -> str:
def __getitem__(self, index: Index) -> TreeData:
"""Returns a sliced view of the object."""
raise NotImplementedError("Slicing not yet implemented")

def concatenate(self) -> None:
"""Concatenate deprecated, use `treedata.concat` instead."""
raise NotImplementedError("Concatenation deprecated, use `treedata.concat` instead")

0 comments on commit d9daa75

Please sign in to comment.