pytorch3d/docs
Thomas Polasek 055ab3a2e3 Convert directory fbcode/vision to use the Ruff Formatter
Summary:
Converts the directory specified to use the Ruff formatter in pyfmt

ruff_dog

If this diff causes merge conflicts when rebasing, please run
`hg status -n -0 --change . -I '**/*.{py,pyi}' | xargs -0 arc pyfmt`
on your diff, and amend any changes before rebasing onto latest.
That should help reduce or eliminate any merge conflicts.

allow-large-files

Reviewed By: bottler

Differential Revision: D66472063

fbshipit-source-id: 35841cb397e4f8e066e2159550d2f56b403b1bef
2024-11-26 02:38:20 -08:00
..
examples Convert directory fbcode/vision to use the Ruff Formatter 2024-11-26 02:38:20 -08:00
modules renderer and vis readthedocs #1363 2022-11-15 14:10:22 -08:00
notes fix: correct typo in cameras.md (#1501) 2023-05-05 08:13:39 -07:00
tutorials remove fvcore dependency 2024-07-11 04:35:38 -07:00
.gitignore Initial commit 2020-01-23 11:53:46 -08:00
.readthedocs.yaml switch to readthedocs.yaml 2023-07-13 06:56:19 -07:00
Makefile More company name & License 2022-01-04 11:43:38 -08:00
README.md docs build remove mock after D45600232 2023-06-16 04:50:30 -07:00
conf.py Replace third-party mock with unittest.mock] vision/fair 2023-05-05 09:36:30 -07:00
generate_stubs.py renderer and vis readthedocs #1363 2022-11-15 14:10:22 -08:00
index.rst Initial commit 2020-01-23 11:53:46 -08:00
requirements.txt remove fvcore dependency 2024-07-11 04:35:38 -07:00

README.md

Setup

Install dependencies

pip install -U recommonmark sphinx sphinx_rtd_theme sphinx_markdown_tables

We want to include the root readme as an overview. Before generating the docs create a symlink to the root readme.

cd docs
ln -s ../README.md  overview.md

In conf.py for deployment this is done using subprocess.call.

Add a new file

Add a new .md or .rst file and add the name to the doc tree in index.rst e.g

.. toctree::
   :maxdepth: 1
   :caption: Intro Documentation

   overview

To autogenerate docs from docstrings in the source code, add the import path for the function e.g.

Chamfer Loss
--------------------

.. autoclass:: loss.chamfer.chamfer_distance
    :members:
    :undoc-members:

    .. automethod:: __init__

Build

From pytorch3d/docs run:

> make html

The website is generated in _build/html.

Common Issues

Sphinx can be fussy, and sometimes about things you werent expecting. For example, you might encounter something like:

WARNING: toctree contains reference to nonexisting document u'overview' ... checking consistency... /docs/overview.rst:: WARNING: document isn't included in any toctree

You might have indented overview in the .. toctree:: in index.rst with four spaces, when Sphinx is expecting three.

View

Start a python simple server:

> python -m http.server

Navigate to: http://0.0.0.0:8000/