diff --git a/.github/workflows/doc.yml b/.github/workflows/doc.yml new file mode 100644 index 000000000..8b160ffe0 --- /dev/null +++ b/.github/workflows/doc.yml @@ -0,0 +1,35 @@ +name: Docs +on: + push: + branches: [main, compile] + pull_request: + branches: [main] + workflow_dispatch: + +permissions: + contents: write +jobs: + docs: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v3 + with: + python-version: '3.9' + - name: Install dependencies + run: | + pip install -r docs/requirements.txt + pip install torch==2.0.0 --index-url https://download.pytorch.org/whl/cpu + BUILD_NO_CUDA=1 pip install . + - name: Sphinx build + # fail on warnings: "-W --keep-going" + run: | + sphinx-build docs/source _build + - name: Deploy + uses: peaceiris/actions-gh-pages@v3 + with: + publish_branch: gh-pages + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: _build/ + force_orphan: true + # cname: ... diff --git a/docs/Makefile b/docs/Makefile new file mode 100644 index 000000000..41c270bb3 --- /dev/null +++ b/docs/Makefile @@ -0,0 +1,20 @@ +# Minimal makefile for Sphinx documentation +# + +# You can set these variables from the command line, and also +# from the environment for the first two. +SPHINXOPTS ?= +SPHINXBUILD ?= sphinx-build +SOURCEDIR = . +BUILDDIR = _build + +# Put it first so that "make" without argument is like "make help". +help: + @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) + +.PHONY: help Makefile + +# Catch-all target: route all unknown targets to Sphinx using the new +# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). +%: Makefile + @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) \ No newline at end of file diff --git a/docs/source/apis/proj.rst b/docs/source/apis/proj.rst new file mode 100644 index 000000000..98f112661 --- /dev/null +++ b/docs/source/apis/proj.rst @@ -0,0 +1,7 @@ +Projection +=================================== + +.. currentmodule:: diff_rast + +.. autoclass:: ProjectGaussians + :members: diff --git a/docs/source/apis/rasterize.rst b/docs/source/apis/rasterize.rst new file mode 100644 index 000000000..ea6b9487b --- /dev/null +++ b/docs/source/apis/rasterize.rst @@ -0,0 +1,7 @@ +Rasterization +=================================== + +.. currentmodule:: diff_rast + +.. autoclass:: RasterizeGaussians + :members: diff --git a/docs/source/conf.py b/docs/source/conf.py new file mode 100644 index 000000000..7b682372c --- /dev/null +++ b/docs/source/conf.py @@ -0,0 +1,42 @@ +__version__ = None +exec(open("../../diff_rast/version.py", "r").read()) + +# -- Project information + +project = "diff_rast" +copyright = "2023, Vickie" +author = "Vickie" + +release = __version__ + +# -- General configuration + +extensions = [ + "sphinx.ext.napoleon", + "sphinx.ext.duration", + "sphinx.ext.doctest", + "sphinx.ext.autodoc", + "sphinx.ext.autosummary", + "sphinx.ext.intersphinx", +] + +intersphinx_mapping = { + "python": ("https://docs.python.org/3/", None), + "sphinx": ("https://www.sphinx-doc.org/en/master/", None), +} +intersphinx_disabled_domains = ["std"] + +templates_path = ["_templates"] + +# -- Options for HTML output +html_theme = "furo" + +# Ignore >>> when copying code +copybutton_prompt_text = r">>> |\.\.\. " +copybutton_prompt_is_regexp = True + +# -- Options for EPUB output +epub_show_urls = "footnote" + +# typehints +autodoc_typehints = "description" diff --git a/docs/source/index.rst b/docs/source/index.rst new file mode 100644 index 000000000..04800eab8 --- /dev/null +++ b/docs/source/index.rst @@ -0,0 +1,13 @@ +DiffRast Documentation +=================================== + + +Links: +------------- + +.. toctree:: + :glob: + :maxdepth: 1 + :caption: Python API + + apis/* diff --git a/setup.py b/setup.py index df4ef6a9c..3a856cb59 100644 --- a/setup.py +++ b/setup.py @@ -106,6 +106,7 @@ def get_extensions(): download_url=f"{URL}/archive/{__version__}.tar.gz", python_requires=">=3.7", install_requires=[ + "jaxtyping", "rich>=12", "torch", "typing_extensions; python_version<'3.8'",