gwcosmo Documentation
This directory contains the Sphinx documentation for gwcosmo.
Building the Documentation
Prerequisites
Install the documentation dependencies:
pip install -r requirements.txt
Build HTML Documentation
# From the docs directory
make html
# Or using sphinx-build directly
sphinx-build -b html . _build/html
The built documentation will be in _build/html/. Open _build/html/index.html in a browser to view it.
Clean Build Files
make clean
Documentation Structure
index.rst- Main documentation indexinstallation.md- Installation guidedata.md- Data requirementscosmological-inference.md- Main usage guidebright-siren-example.md- Bright siren tutorialdark-siren-example.md- Dark siren tutoriallos-prior.md- LOS redshift prior guideinjections.md- Injection generation guideapi/- Auto-generated API documentation from docstringsapi.rst- API reference index
Configuration
The Sphinx configuration is in conf.py. Key settings:
Extensions: autodoc, autosummary, napoleon, viewcode, intersphinx, myst_parser
Theme: sphinx_rtd_theme (ReadTheDocs theme)
Autodoc: Configured to automatically document all members with type hints
Napoleon: Supports both Google and NumPy style docstrings
Intersphinx: Links to Python, NumPy, SciPy, Astropy, and Bilby documentation
API Documentation
The API documentation is automatically generated from docstrings in the source code using Sphinx autodoc. The structure is:
api.rst- Main API reference pageapi/likelihood.rst- Likelihood module documentationapi/prior.rst- Prior module documentationapi/utilities.rst- Utilities module documentationapi/injections.rst- Injections module documentationapi/maps.rst- Maps module documentationapi/plotting.rst- Plotting module documentation
To update the API documentation, simply update the docstrings in the source code and rebuild the documentation.