Skip to content

Commit

Permalink
fixed docs
Browse files Browse the repository at this point in the history
  • Loading branch information
colganwi committed May 15, 2024
1 parent eb265fb commit 8ca03c3
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 74 deletions.
21 changes: 1 addition & 20 deletions docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,8 @@

## Preprocessing

```{eval-rst}
.. module:: pycea.pp
.. currentmodule:: pycea
.. autosummary::
:toctree: generated
pp.basic_preproc
```

## Tools

```{eval-rst}
.. module:: pycea.tl
.. currentmodule:: pycea
.. autosummary::
:toctree: generated
tl.basic_tool
```

## Plotting

```{eval-rst}
Expand All @@ -34,4 +14,5 @@
:toctree: generated
pl.branches
pl.annotation
```
8 changes: 7 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,16 @@
}

intersphinx_mapping = {
"python": ("https://docs.python.org/3", None),
"anndata": ("https://anndata.readthedocs.io/en/stable/", None),
"cycler": ("https://matplotlib.org/cycler/", None),
"matplotlib": ("https://matplotlib.org/stable/", None),
"numpy": ("https://numpy.org/doc/stable/", None),
"networkx": ("https://networkx.org/documentation/stable/", None),
"pandas": ("https://pandas.pydata.org/pandas-docs/stable/", None),
"python": ("https://docs.python.org/3", None),
"scanpy": ("https://scanpy.readthedocs.io/en/stable/", None),
"scipy": ("https://docs.scipy.org/doc/scipy/reference/", None),
"squidpy": ("https://squidpy.readthedocs.io/en/stable/", None),
"treedata": ("https://treedata.readthedocs.io/en/stable/", None),
}

Expand Down
15 changes: 10 additions & 5 deletions src/pycea/pl/tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,21 @@
import treedata as td
from matplotlib.axes import Axes
from matplotlib.collections import LineCollection
from scanpy._utils import _doc_params

from pycea.utils import get_keyed_edge_data, get_keyed_obs_data

from ._docs import doc_common_plot_args
from ._utils import (
_get_categorical_colors,
_series_to_rgb_array,
layout_tree,
)


@_doc_params(
common_plot_args=doc_common_plot_args,
)
def branches(
tdata: td.TreeData,
key: str = None,
Expand Down Expand Up @@ -57,7 +62,7 @@ def branches(
Either an numeric width, or a key for an attribute of the edges to set the linewidth.
na_linewidth
The linewidth to use for edges with missing data.
{doc_common_plot_args}
{common_plot_args}
kwargs
Additional keyword arguments passed to `matplotlib.collections.LineCollection`.
Expand Down Expand Up @@ -158,7 +163,7 @@ def annotation(
The minimum value for the colormap.
na_color
The color to use for annotations with missing data.
{doc_common_plot_args}
{common_plot_args}
kwargs
Additional keyword arguments passed to `matplotlib.pyplot.pcolormesh`.
Expand Down Expand Up @@ -209,14 +214,14 @@ def annotation(
end_lat = start_lat + attrs["depth"] + 2 * np.pi
lats = np.linspace(start_lat, end_lat, data.shape[1] + 1)
for col in data.columns:
rgb_array.append(_series_to_rgb_array(data[col], cmap, vmin=vmin, vmax=vmax, na_color = na_color))
rgb_array.append(_series_to_rgb_array(data[col], cmap, vmin=vmin, vmax=vmax, na_color=na_color))
else:
for key in keys:
if data[key].dtype == "category":
colors = _get_categorical_colors(tdata, key, data[key], palette)
rgb_array.append(_series_to_rgb_array(data[key], colors, na_color = na_color))
rgb_array.append(_series_to_rgb_array(data[key], colors, na_color=na_color))
else:
rgb_array.append(_series_to_rgb_array(data[key], cmap, vmin=vmin, vmax=vmax, na_color = na_color))
rgb_array.append(_series_to_rgb_array(data[key], cmap, vmin=vmin, vmax=vmax, na_color=na_color))
rgb_array = np.stack(rgb_array, axis=1)
# Plot
if attrs["polar"]:
Expand Down
1 change: 0 additions & 1 deletion src/pycea/pp/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
from .basic import basic_preproc
17 changes: 0 additions & 17 deletions src/pycea/pp/basic.py

This file was deleted.

1 change: 0 additions & 1 deletion src/pycea/tl/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
from .basic import basic_tool
17 changes: 0 additions & 17 deletions src/pycea/tl/basic.py

This file was deleted.

12 changes: 0 additions & 12 deletions tests/test_basic.py

This file was deleted.

0 comments on commit 8ca03c3

Please sign in to comment.