Skip to content

Commit 4e594a4

Browse files
authored
Restructure API docs for integrations (#103)
1 parent f0fe607 commit 4e594a4

File tree

11 files changed

+64
-20
lines changed

11 files changed

+64
-20
lines changed

.github/workflows/docs.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,13 @@ jobs:
5959
- name: Install package
6060
run: |
6161
python -m pip install --upgrade pip setuptools wheel
62-
sudo apt-get install -y pandoc
62+
# NOTE(stes) Pandoc version must be at least (2.14.2) but less than (4.0.0).
63+
# as of 29/10/23. Ubuntu 22.04 which is used for ubuntu-latest only has an
64+
# old pandoc version (2.9.). We will hence install the latest version manually.
65+
# previou: sudo apt-get install -y pandoc
66+
wget https://github.com/jgm/pandoc/releases/download/3.1.9/pandoc-3.1.9-1-amd64.deb
67+
sudo dpkg -i pandoc-3.1.9-1-amd64.deb
68+
rm pandoc-3.1.9-1-amd64.deb
6369
pip install torch --extra-index-url https://download.pytorch.org/whl/cpu
6470
pip install '.[docs]'
6571

cebra/data/load.py

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,22 @@
99
# Please see LICENSE.md for the full license document:
1010
# https://github.com/AdaptiveMotorControlLab/CEBRA/LICENSE.md
1111
#
12-
"""A simple API for loading various data formats used with CEBRA."""
12+
"""A simple API for loading various data formats used with CEBRA.
13+
14+
Availability of different data formats depends on the installed
15+
dependencies. If a dependency is not installed, an attempt to load
16+
a file of that format will throw an error with further installation
17+
instructions.
18+
19+
Currently available formats:
20+
21+
- HDF5 via ``h5py``
22+
- Pickle files via ``pickle``
23+
- Joblib files via ``joblib``
24+
- Various dataframe formats via ``pandas``.
25+
- Matlab files via ``scipy.io.loadmat``
26+
- DeepLabCut (single animal) files via ``deeplabcut``
27+
"""
1328

1429
import abc
1530
import pathlib

cebra/integrations/plotly.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ def plot_embedding_interactive(
135135
This is supposing that the dimensions provided to ``idx_order`` are in the range of the number of
136136
dimensions of the embedding (i.e., between 0 and :py:attr:`cebra.CEBRA.output_dimension` -1).
137137
138-
The function makes use of :py:func:`plotly.graph_objs._scatter.Scatter` and parameters from that function can be provided
138+
The function makes use of :py:class:`plotly.graph_objects.Scatter` and parameters from that function can be provided
139139
as part of ``kwargs``.
140140
141141
@@ -156,7 +156,7 @@ def plot_embedding_interactive(
156156
title: The title on top of the embedding.
157157
figsize: Figure width and height in inches.
158158
dpi: Figure resolution.
159-
kwargs: Optional arguments to customize the plots. See :py:func:`plotly.graph_objs._scatter.Scatter` documentation for more
159+
kwargs: Optional arguments to customize the plots. See :py:class:`plotly.graph_objects.Scatter` documentation for more
160160
details on which arguments to use.
161161
162162
Returns:

docs/source/api.rst

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,16 @@ these components in other contexts and research code bases.
3737
api/pytorch/datasets
3838
api/pytorch/distributions
3939
api/pytorch/models
40-
api/pytorch/integrations
4140
api/pytorch/helpers
4241

42+
.. toctree::
43+
:hidden:
44+
:caption: Integrations
45+
46+
api/integrations/data
47+
api/integrations/matplotlib
48+
api/integrations/plotly
49+
api/integrations/deeplabcut
50+
4351

4452
.. _Scikit-learn estimators: https://scikit-learn.org/stable/developers/develop.html
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Data Loading
2+
------------
3+
4+
.. automodule:: cebra.data.load
5+
:show-inheritance:
6+
:members:
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
DeepLabCut
2+
----------
3+
4+
.. automodule:: cebra.integrations.deeplabcut
5+
:show-inheritance:
6+
:members:
7+
8+
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Plotting with ``matplotlib``
2+
----------------------------
3+
4+
.. automodule:: cebra.integrations.matplotlib
5+
:show-inheritance:
6+
:members:
7+
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Plotting with ``plotly``
2+
----------------------------
3+
4+
.. automodule:: cebra.integrations.plotly
5+
:show-inheritance:
6+
:members:
7+

docs/source/api/pytorch/helpers.rst

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,6 @@ Registry
2121
:show-inheritance:
2222

2323

24-
Plots
25-
-----
26-
27-
.. automodule:: cebra.integrations.matplotlib
28-
:show-inheritance:
29-
:members:
30-
31-
3224
Grid-Search
3325
-----------
3426

docs/source/api/pytorch/integrations.rst

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)