Skip to content

Commit 1606406

Browse files
Nathaniel-githubAndrew Ramirezaarmey
authored
Initial sphinx docs (#500)
* Initial sphinx docs * Update rye * Rye fmt * Update uv lock * Add Github action * Update documentation.yml --------- Co-authored-by: Andrew Ramirez <[email protected]> Co-authored-by: Aaron Meyer <[email protected]>
1 parent e120c92 commit 1606406

File tree

8 files changed

+388
-38
lines changed

8 files changed

+388
-38
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: documentation
2+
3+
on: [push, pull_request, workflow_dispatch]
4+
5+
permissions:
6+
contents: write
7+
8+
jobs:
9+
docs:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v6
13+
- uses: actions/setup-python@v5
14+
- name: Install uv
15+
uses: astral-sh/setup-uv@v6
16+
- name: Sphinx build
17+
run: |
18+
uv run sphinx-build docs docs/_build
19+
- name: Deploy to GitHub Pages
20+
uses: peaceiris/actions-gh-pages@v4
21+
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
22+
with:
23+
publish_branch: gh-pages
24+
github_token: ${{ secrets.GITHUB_TOKEN }}
25+
publish_dir: docs/_build
26+
force_orphan: true

.gitignore

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -6,27 +6,6 @@ __pycache__/
66
# C extensions
77
*.so
88

9-
# Distribution / packaging
10-
.Python
11-
build/
12-
develop-eggs/
13-
dist/
14-
downloads/
15-
eggs/
16-
.eggs/
17-
lib/
18-
lib64/
19-
parts/
20-
sdist/
21-
var/
22-
wheels/
23-
pip-wheel-metadata/
24-
share/python-wheels/
25-
*.egg-info/
26-
.installed.cfg
27-
*.egg
28-
MANIFEST
29-
309
# PyInstaller
3110
# Usually these files are written by a python script from a template
3211
# before PyInstaller builds the exe, so as to inject date/other infos into it.
@@ -51,23 +30,6 @@ coverage.xml
5130
.hypothesis/
5231
.pytest_cache/
5332

54-
# Translations
55-
*.mo
56-
*.pot
57-
58-
# Django stuff:
59-
*.log
60-
local_settings.py
61-
db.sqlite3
62-
db.sqlite3-journal
63-
64-
# Flask stuff:
65-
instance/
66-
.webassets-cache
67-
68-
# Scrapy stuff:
69-
.scrapy
70-
7133
# Sphinx documentation
7234
docs/_build/
7335

RISE/figures/figure2b_e.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,5 @@ def makeFigure():
3333

3434
plot_labels_pacmap(X, "Cell Type", ax[3])
3535

36+
3637
return f

docs/api.rst

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
API Reference
2+
=============
3+
4+
.. automodule:: RISE
5+
:members:
6+
:undoc-members:
7+
:show-inheritance:
8+
9+
.. automodule:: RISE.factorization
10+
:members:
11+
:undoc-members:
12+
:show-inheritance:
13+
14+
.. automodule:: RISE.imports
15+
:members:
16+
:undoc-members:
17+
:show-inheritance:
18+
19+
.. automodule:: RISE.logisticReg
20+
:members:
21+
:undoc-members:
22+
:show-inheritance:
23+
24+
.. automodule:: RISE.gating
25+
:members:
26+
:undoc-members:
27+
:show-inheritance:
28+

docs/conf.py

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
"""Configuration file for the Sphinx documentation builder."""
2+
3+
import sys
4+
from pathlib import Path
5+
6+
# Add the parent directory to the path so we can import RISE
7+
# This allows Sphinx to find the RISE package
8+
project_root = Path(__file__).parent.parent.resolve()
9+
sys.path.insert(0, str(project_root))
10+
11+
# Project information
12+
project = "RISE"
13+
copyright = "2024, Andrew Ramirez, Aaron Meyer"
14+
author = "Andrew Ramirez, Aaron Meyer"
15+
16+
# General configuration
17+
extensions = [
18+
"sphinx.ext.autodoc",
19+
"sphinx.ext.viewcode",
20+
"sphinx.ext.napoleon",
21+
"sphinx.ext.intersphinx",
22+
]
23+
24+
templates_path = ["_templates"]
25+
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
26+
27+
# Napoleon settings for NumPy-style docstrings
28+
napoleon_google_docstring = False
29+
napoleon_numpy_docstring = True
30+
napoleon_include_init_with_doc = True
31+
napoleon_include_private_with_doc = False
32+
napoleon_include_special_with_doc = True
33+
napoleon_use_admonition_for_examples = True
34+
napoleon_use_admonition_for_notes = True
35+
napoleon_use_admonition_for_references = True
36+
napoleon_use_ivar = False
37+
napoleon_use_param = True
38+
napoleon_use_rtype = True
39+
napoleon_preprocess_types = False
40+
napoleon_attr_annotations = True
41+
42+
# Autodoc configuration
43+
autodoc_default_options = {
44+
"members": True,
45+
"member-order": "bysource",
46+
"undoc-members": True,
47+
"show-inheritance": True,
48+
"inherited-members": False,
49+
}
50+
51+
# Intersphinx mapping for external documentation
52+
intersphinx_mapping = {
53+
"python": ("https://docs.python.org/3", None),
54+
"numpy": ("https://numpy.org/doc/stable/", None),
55+
"scipy": ("https://docs.scipy.org/doc/scipy/", None),
56+
"pandas": ("https://pandas.pydata.org/docs/", None),
57+
"anndata": ("https://anndata.readthedocs.io/en/stable/", None),
58+
"sklearn": ("https://scikit-learn.org/stable/", None),
59+
"tensorly": ("http://tensorly.org/stable/", None),
60+
"scanpy": ("https://scanpy.readthedocs.io/en/stable/", None),
61+
}
62+
63+
# Options for HTML output
64+
html_theme = "sphinx_rtd_theme"
65+
html_static_path = ["_static"]
66+
html_theme_options = {
67+
"navigation_depth": 4,
68+
"collapse_navigation": False,
69+
"sticky_navigation": True,
70+
"includehidden": True,
71+
"titles_only": False,
72+
}

docs/index.rst

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
.. RISE documentation master file
2+
3+
Welcome to RISE's documentation!
4+
=================================
5+
6+
.. toctree::
7+
:maxdepth: 2
8+
:caption: Contents:
9+
10+
api
11+
12+
Indices and tables
13+
==================
14+
15+
* :ref:`genindex`
16+
* :ref:`modindex`
17+
* :ref:`search`
18+

pyproject.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ dev = [
4646
"scanorama>=1.7.4",
4747
"harmonypy>=0.0.10",
4848
"scib>=1.1.5",
49+
"sphinx>=7.0,<9.0",
50+
"sphinx-rtd-theme>=3.0.0",
4951
"ruff>=0.14.7",
5052
]
5153

0 commit comments

Comments
 (0)