Documentation guide#
For developers: How to keep documentation in sync with code
Overview#
All inference documentation is maintained by hand. When you add or change configuration fields, likelihoods, EOS models, TOV solvers, or samplers, update the relevant documentation files directly. The key file is docs/inference/yaml_reference.md, which is the authoritative user-facing reference for all YAML configuration options.
Keeping Documentation in Sync#
What to Update for Common Changes#
When adding a new likelihood type:
Add to
likelihoods/my_likelihood.pyUpdate
likelihoods/factory.pyAdd config class to
config/schemas/likelihoods.pyAdd an entry to
docs/inference/yaml_reference.mdunder the appropriate Likelihoods categoryAdd a usage example to
inference/quickstart.mdif appropriate
When adding a new EOS type:
Add config class to
config/schemas/eos.pyRegister in
transforms/transform.pyAdd a new subsection to
docs/inference/yaml_reference.mdunder EOS ConfigurationAdd a working example configuration
When adding a new TOV solver:
Add config class to
config/schemas/tov.pyRegister in
transforms/transform.pyUpdate the TOV Configuration section in
docs/inference/yaml_reference.mdAdd a working example configuration
When modifying configuration fields:
Modify the relevant file under
config/schemas/Update the corresponding entry in
docs/inference/yaml_reference.mdUpdate
quickstart.mdif the change affects the quick start workflow
When adding a new sampler:
Implement the sampler and add it to
SAMPLER_REGISTRYAdd config class to
config/schemas/samplers.pyAdd a new subsection to
docs/inference/yaml_reference.mdunder SamplersDocument when to use it and any important caveats
YAML Reference Structure#
The docs/inference/yaml_reference.md file is organised into sections that mirror the top-level keys of a JESTER config file:
Run Options —
seed,dry_run,validate_only,debug_nansEOS Configuration — one subsection per EOS type
TOV Configuration — one subsection per TOV solver
Prior Configuration —
specification_fileLikelihoods — grouped by category (GW, X-ray, Radio, Nuclear, Generic, Prior-Only)
Samplers — one subsection per sampler
Data Paths — optional path overrides
Postprocessing — plot generation options
Complete Examples — full working configs
Validation Rules — Pydantic constraints summary
Each subsection uses a collapsible ::::{dropdown} block containing a YAML snippet with inline comments, followed by a Field Details bullet list.
Documentation Structure#
docs/
├── index.rst # Main entry point
├── conf.py # Sphinx configuration
│
├── User Guide
│ ├── inference/quickstart.md # Quick start guide
│ └── inference.md # Complete reference
│
├── Reference
│ └── inference/yaml_reference.md # Hand-maintained YAML config reference
│
├── API Reference
│ └── api/*.rst # AUTO-GENERATED by sphinx-autodoc
│
├── Developer Guide
│ ├── inference/workflow.md # Development workflow
│ ├── inference_architecture.md # System architecture
│ └── developer_guide/documentation_guide.md # This file
│
└── _static/ # CSS, logos, assets
Testing Documentation#
Manual Testing Checklist#
Before committing documentation changes:
Build passes in strict mode:
uv run sphinx-build -W --keep-going docs docs/_build/htmlLinks work: click through in built HTML
Code examples are valid and current
YAML snippets match what Pydantic actually accepts
No new Sphinx warnings
Validating YAML Examples#
# Validate a config snippet (requires a prior file)
uv run run_jester_inference config.yaml --validate-only
Version Control#
Follow these commit message conventions:
# Updating configuration documentation
git commit -m "docs: add XYZ likelihood to yaml_reference"
# Schema change + docs update together
git commit -m "feat: add XYZ likelihood (+ yaml_reference update)"
# Fixing docs issues
git commit -m "docs: fix broken link in inference quickstart"
When a PR changes inference code, the PR checklist should include:
Updated
docs/inference/yaml_reference.mdif any config fields changedUpdated other manual docs if user-facing features changed
Added or updated working examples if the workflow changed
Verified the docs build passes in strict mode
Documentation Review#
When reviewing documentation PRs:
Accuracy: Does the doc match what the Pydantic models actually validate?
Completeness: Are all new fields and options documented?
Clarity: Can a new user understand it without reading source code?
Examples: Are working examples provided?
Links: Do all cross-references resolve?