Skip to content

Commit 76b8a37

Browse files
committed
WIP api index
1 parent cb4d754 commit 76b8a37

11 files changed

+158
-12
lines changed

docs/make_api_index.py

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
"""
2+
Generate the API index page for all modules.
3+
Inspired by `movement` package.
4+
"""
5+
6+
import os
7+
from pathlib import Path
8+
9+
# Modules to exclude from the API index
10+
exclude_modules = [
11+
"cli_entrypoint",
12+
"loader_widgets",
13+
"meta_widget",
14+
]
15+
16+
# Set the current working directory to the directory of this script
17+
script_dir = Path(__file__).resolve().parent
18+
os.chdir(script_dir)
19+
20+
21+
def make_api_index():
22+
"""Create a doctree of all ``movement`` modules."""
23+
doctree = "\n"
24+
api_path = Path("../derotation")
25+
for path in sorted(api_path.rglob("*.py")):
26+
# Convert file path to module name
27+
rel_path = path.relative_to(api_path.parent)
28+
module_name = str(rel_path.with_suffix("")).replace(os.sep, ".")
29+
if rel_path.stem not in exclude_modules:
30+
doctree += f" {module_name}\n"
31+
# # Get the header
32+
api_head_path = Path("source") / "_templates" / "api_index_head.rst"
33+
api_head = api_head_path.read_text()
34+
# Write api_index.rst with header + doctree
35+
output_path = Path("source") / "api_index.rst"
36+
with output_path.open("w") as f:
37+
f.write(api_head)
38+
f.write(doctree)
39+
40+
41+
if __name__ == "__main__":
42+
make_api_index()

docs/requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@ sphinx
88
sphinx-argparse
99
sphinx-autodoc-typehints
1010
sphinx_design
11+
-e .
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
..
2+
This file is auto-generated.
3+
4+
.. _target-api:
5+
6+
API reference
7+
=============
8+
9+
Information on specific functions, classes, and methods.
10+
11+
.. rubric:: Modules
12+
13+
.. autosummary::
14+
:toctree: api
15+
:recursive:
16+
:nosignatures:
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
derotation.analysis.blob\_detection
2+
===================================
3+
4+
.. automodule:: derotation.analysis.blob_detection
5+
6+
7+
.. rubric:: Classes
8+
9+
.. autosummary::
10+
11+
BlobDetection
12+
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
derotation.analysis.fit\_ellipse
2+
================================
3+
4+
.. automodule:: derotation.analysis.fit_ellipse
5+
6+
7+
.. rubric:: Functions
8+
9+
.. autosummary::
10+
11+
derive_angles_from_ellipse_fits
12+
fit_ellipse_to_points
13+
plot_ellipse_fit_and_centers
14+
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
derotation.derotate\_by\_line
2+
=============================
3+
4+
.. automodule:: derotation.derotate_by_line
5+
6+
7+
.. rubric:: Functions
8+
9+
.. autosummary::
10+
11+
apply_homography
12+
derotate_an_image_array_line_by_line
13+
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
derotation.load\_data.custom\_data\_loaders
2+
===========================================
3+
4+
.. automodule:: derotation.load_data.custom_data_loaders
5+
6+
7+
.. rubric:: Functions
8+
9+
.. autosummary::
10+
11+
convert_to_volts
12+
get_analog_signals
13+
read_randomized_stim_table
14+
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
derotation.plotting\_hooks.for\_derotation
2+
==========================================
3+
4+
.. automodule:: derotation.plotting_hooks.for_derotation
5+
6+
7+
.. rubric:: Functions
8+
9+
.. autosummary::
10+
11+
image_completed
12+
line_addition
13+
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
derotation.simulate.line\_scanning\_microscope
2+
==============================================
3+
4+
.. automodule:: derotation.simulate.line_scanning_microscope
5+
6+
7+
.. rubric:: Classes
8+
9+
.. autosummary::
10+
11+
Rotator
12+

docs/source/api_index.rst

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,25 @@
1-
API
2-
====
1+
..
2+
This file is auto-generated.
33
4-
Full derotation
5-
---------------
4+
.. _target-api:
65

7-
.. currentmodule:: derotation.analysis.full_rotation_pipeline
6+
API reference
7+
=============
88

9-
.. autoclass:: FullPipeline
9+
Information on specific functions, classes, and methods.
1010

11-
Incremental derotation
12-
----------------------
11+
.. rubric:: Modules
1312

14-
.. currentmodule:: derotation.analysis.incremental_rotation_pipeline
15-
16-
.. autoclass:: IncrementalPipeline
13+
.. autosummary::
14+
:toctree: api
15+
:recursive:
16+
:nosignatures:
17+
derotation.analysis.blob_detection
18+
derotation.analysis.fit_ellipse
19+
derotation.analysis.full_derotation_pipeline
20+
derotation.analysis.incremental_derotation_pipeline
21+
derotation.derotate_by_line
22+
derotation.load_data.custom_data_loaders
23+
derotation.plotting_hooks.for_derotation
24+
derotation.simulate.line_scanning_microscope
25+
derotation.simulate.synthetic_data

0 commit comments

Comments
 (0)