Skip to content

Commit 7881d85

Browse files
committed
docs: add sphinx documentation and add missing documentation
1 parent c7a7f1e commit 7881d85

22 files changed

+767
-41
lines changed

.github/workflows/docs.yaml

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Docs
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-20.04
12+
steps:
13+
- name: Setup Python
14+
uses: actions/setup-python@v3
15+
with:
16+
python-version: "3.10"
17+
architecture: x64
18+
- name: Checkout
19+
uses: actions/checkout@v3
20+
- name: Install Dependencies
21+
run: |
22+
set -eux
23+
24+
sudo apt-get install -y protobuf-compiler
25+
26+
pip install .[dev] -v
27+
28+
pip install -r docs/requirements.txt
29+
- name: Build Sphinx Docs
30+
run: |
31+
set -eux
32+
33+
cd docs
34+
make html
35+
- name: Upload static files as artifact
36+
id: deployment
37+
uses: actions/upload-pages-artifact@v3
38+
with:
39+
path: docs/build/html/
40+
41+
deploy:
42+
environment:
43+
name: github-pages
44+
url: ${{ steps.deployment.outputs.page_url }}
45+
runs-on: ubuntu-latest
46+
needs: build
47+
steps:
48+
- name: Deploy to GitHub Pages
49+
id: deployment
50+
uses: actions/deploy-pages@v4

docs/.gitignore

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
src/pytorch-sphinx-theme
2+
source/examples_*/
3+
jupyter_execute/
4+
build/
5+
6+
Dockerfile
7+
my_component.py
8+
my_app.py

docs/Makefile

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
2+
# Minimal makefile for Sphinx documentation
3+
# Usage:
4+
# make html
5+
#
6+
7+
# You can set these variables from the command line.
8+
SPHINXOPTS = -W
9+
SPHINXBUILD = sphinx-build
10+
SPHINXPROJ = torchft
11+
SOURCEDIR = source
12+
BUILDDIR = build
13+
VERSION := $(shell python -c "from importlib.metadata import version; print(version('torchft'))")
14+
15+
# Put it first so that "make" without argument is like "make help".
16+
help:
17+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
18+
19+
clean:
20+
@echo "Deleting build directory"
21+
rm -rf "$(BUILDDIR)"
22+
rm -rf "$(SOURCEDIR)/examples_apps" "$(SOURCEDIR)/examples_pipelines"
23+
24+
.PHONY: help Makefile clean livehtml papermill
25+
26+
# Catch-all target: route all unknown targets to Sphinx using the new
27+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
28+
%: Makefile
29+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
30+
31+
# optional live version
32+
livehtml:
33+
sphinx-autobuild --watch ../torchft --re-ignore ".*(examples_.*|.new|source/.*(Dockerfile|.py))" "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
34+
35+
papermill: html
36+
./papermill.sh

docs/requirements.txt

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
sphinx==5.0.1
2+
-e git+http://github.com/pytorch/pytorch_sphinx_theme.git#egg=pytorch_sphinx_theme
3+
sphinxcontrib.katex
4+
matplotlib
5+
papermill
6+
ipykernel
7+
ipython_genutils
8+
jinja2<=3.0.3
Loading
1010 Bytes
Loading

docs/source/checkpointing.rst

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.. automodule:: torchft.checkpointing
2+
:members:
3+
:undoc-members:
4+
:show-inheritance:

0 commit comments

Comments
 (0)