README

Documentation maintenance

The site is a single-language (English) Sphinx build: MyST Markdown pages in guide/, reference/ and the flat files, plus API reference pages that AutoAPI generates by parsing src/evomo/ statically. The documentation toolchain is deliberately separate from the runtime dependencies — building the site needs no evomo, evox, evoxc, GPU, Brax or JAX install, because nothing in the source tree is imported. Read this file before changing conf.py, adding a page, regenerating a table or editing a docstring that AutoAPI renders.

Documentation environment

The toolchain lives in its own venv, created with uv (not on PATH on this host — it is /root/.local/bin/uv):

/root/.local/bin/uv venv --clear --python 3.12 /tmp/evomo_docs
/root/.local/bin/uv pip install --python /tmp/evomo_docs/bin/python -r docs/requirements.txt

docs/requirements.txt pins the whole toolchain (sphinx, myst-parser, shibuya, sphinx-autoapi) and nothing else; do not install the library into this venv.

Strict build

Run from the repository root:

/tmp/evomo_docs/bin/python -m sphinx -b html -W --keep-going docs docs/_build/html

-W --keep-going turns every warning into a failure: a broken relative link, a missing {literalinclude} target, an unknown document id, a malformed directive or a stale AutoAPI id all fail the build. Three warning types are suppressed in conf.py, each with a comment naming its cause: toc.not_included (AutoAPI's package-root page has no toctree), autoapi.python_import_resolution (the build imports nothing) and docutils (a handful of module docstrings under src/evomo/ are not reST-clean). Everything else is fatal, so a broken link or a missing include still fails; the suppressed categories are the ones to re-check by hand. Open docs/_build/html/index.html, or serve it with /tmp/evomo_docs/bin/python -m http.server 8000 --directory docs/_build/html. A green build proves only that sources, links and includes resolve; it never executes an example or a backend.

Page layout

Path Contents
index.md Home page: what evomo 1.0 is, the install line, one canonical example, and the three visible toctrees
guide/ The user guide, one chapter per concern: installation, quickstart, components, algorithms, problems, constraints, workflows, backends, metrics, benchmarks, faq
reference/ Generated catalogue tables, the API overview that owns the AutoAPI toctree, exceptions and citation
examples/ The runnable scripts the guides include with {literalinclude}
development.md Repository layout, check commands, and how to extend the library
conf.py, requirements.txt Sphinx/MyST/AutoAPI configuration and the toolchain pins
_static/, _templates/, images/ CSS, the sidebar-brand partial, the shared .bib, SVG branding
README.md, CONTEXT.md, papers/ Excluded from the build (exclude_patterns)

Every page must be listed in a toctree — index.md for guides and the flat pages, reference/index.md for reference pages; a page nobody lists is unreachable, and because the orphan warning is suppressed in conf.py it disappears silently, so add the entry in the same change. Write one sentence per line in the Markdown sources, so diffs stay granular. Keep runnable code in examples/ and include it by reference: ../examples/<name>.py from guide/, ../_static/evomo.bib from reference/.

Writing API docstrings

Per-symbol documentation is not written in this directory: per-constructor documentation lives in src/evomo/algorithms/ (and the matching modules for problems, operators, workflows and utils) and renders through AutoAPI, so the generated page, help() and the IDE all show the same text. Document every constructor field, and use :param name: and :type name: where a default, a valid range or the meaning of None needs explaining. Never infer behaviour from an algorithm's name — read the module and describe what the code does. Keep the class docstring and the constructor docstring complementary: autoapi_python_class_content = "both" puts the class docstring and the __init__ docstring on the same page. Undocumented evomo.algorithms.* instance attributes and the evomo.metrics.gd/hv/igd functions are hidden by the autoapi-skip-member hook in conf.py; document an attribute in source if it is part of the contract.

Generated reference tables

reference/_generate_tables.py is the single source of the four catalogue pages: reference/algorithms.md, reference/problems.md, reference/operators.md and reference/utils.md. It parses src/evomo/ with ast (no import), writes each table between generated-region markers, and therefore keeps the docs build independent of the runtime stack. Run it after touching src/evomo/; a stale row count is a documentation bug, fixed by regenerating, never by hand-editing the table. Its --verify mode re-derives the same facts from a live import and fails on any mismatch, so it needs env A: source scripts/env.sh first. The generator and those four pages are owned by the reference/ node — this file describes the contract, it does not implement or edit them.

Running the examples

Every script in examples/ must run from the repository root before its output is quoted in a guide:

source scripts/env.sh && $PYTHON_A docs/examples/<name>.py

$PYTHON_A is env A (scripts/env.sh), the only environment with evox 2.0 and evoxc installed. Compiled-backend halves of a script need EVOXC_PJRT_PLUGIN (which scripts/env.sh exports) and a GPU; when XLA ran, the script must end with os._exit(0) and the guide must say why, because the pinned jax-rocm7-pjrt plugin aborts during interpreter teardown. Never claim GPU or compiled-backend behaviour that benchmarks/evoxc_vs_torch/REPORT.md does not measure, and quote a number only together with its case id.

What not to commit

docs/_build/ and docs/autoapi/ are build output and both are gitignored; never commit them and never hand-write anything under docs/autoapi/. Also keep out of the tree: venvs, scratch benchmark runs, *.egg-info/, and any generated HTML. .readthedocs.yaml supplies the hosting configuration (Ubuntu 24.04, Python 3.12, fail_on_warning: true); publishing still requires connecting the repository in Read the Docs.