This directory contains the source files for generating the Temoa documentation in ReStructuredText format.
The documentation build requires Sphinx and related packages. These are included in the docs extra dependency group.
Install the documentation dependencies using uv (recommended):
cd /path/to/temoa
uv sync --extra docsOr using pip:
pip install -e ".[docs]"From the docs directory, execute:
uv run sphinx-build source _build/htmlOr from the repository root:
uv run sphinx-build docs/source docs/_build/htmlThe generated HTML files will be in docs/_build/html/. Open index.html in your browser to view the documentation.
To generate PDF documentation, you'll need LaTeX installed. latexmk is recommended for automatic PDF generation:
Then run:
uv run make latexpdfThe PDF will be generated in docs/_build/latex/.
If automatic PDF generation fails, navigate to the build directory and manually generate the PDF:
cd docs/_build/latex
pdflatex toolsforenergymodeloptimizationandanalysistemoa.texThe Temoa documentation draws from two main sources:
-
Static descriptions - Model elements and concepts described in
.rstfiles insource/(e.g.,mathematical_formulation.rst,database.rst) -
Code docstrings - Objective function and constraint documentation from module docstrings in:
temoa/components/costs.py- Objective functiontemoa/components/*.py- Constraint implementations
Sphinx retrieves these docstrings and generates LaTeX-formatted equations in the "Equations" section of the documentation.
To check for broken links in the documentation:
uv run sphinx-build -b linkcheck source _build/linkcheckReview the output in docs/_build/linkcheck/output.txt.
To treat warnings as errors (useful for CI):
uv run sphinx-build -W -b html source _build/htmlWhen contributing to the documentation:
- Follow ReStructuredText formatting guidelines
- Ensure all code examples are tested and working
- Build the documentation locally to check for warnings
- Run the link checker to verify external links
- Update docstrings in code when changing model equations
See CONTRIBUTING.md for general contribution guidelines.