Zilinghan/readthedoc - #118
Merged
Merged
Conversation
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Turns
docs/into a proper Sphinx site written in MyST-Markdown and adds the.readthedocs.yamlneeded to publish it on Read the Docs.The five existing reference docs (
configurations,model_harness,drift_detectors,continuous_learning,tracking) are unchanged in substance — they become pages in the site. Around them this adds the pages we did not have: an installation guide, a quickstart, an architecture overview, a detector decision guide, a FLOPS-profiler page, a deployment page, an agent-skills page, and an autodoc API reference generated from the docstrings insrc/apeiron/.Nothing about how the framework runs changes. The only non-docs edit is two docstring fixes in
configuration.py(details below).What's here
docs/conf.py,docs/requirements.txt,docs/_static/custom.css.readthedocs.yamldocs/{index,installation,quickstart,architecture,choosing_a_detector,profiler,deployment,agent_skills}.mddocs/api/*.md(9 files, autodoc oversrc/apeiron/)Theme is Furo, with
sphinx-design(grids, tabs),sphinx-copybutton, andsphinxcontrib-mermaidfor the flow diagrams inarchitecture.mdandagent_skills.md.Build it locally
Docs dependencies are deliberately separate from the project's.
docs/conf.pymocks torch, river, evidently, wandb, and mlflow viaautodoc_mock_imports, so a docs build does not need the poetry environment or a GPU-specific torch wheel — it's ~40 MB of Sphinx and nothing else.Important
Invoke it as
.venv-docs/bin/python -m sphinx, not as baresphinx-build. If you have conda on your PATH, its shell hook re-prepends itself ahead of an activated venv, sosphinx-buildcan resolve to a different interpreter that has nomyst_parserinstalled — you getCould not import extension myst_parsereven though your venv is fine. Calling the venv's interpreter by absolute path avoids PATH entirely.-Wturns warnings into errors and--keep-goingreports all of them rather than stopping at the first. Keep both: Read the Docs is configured withfail_on_warning: true, so a build that is clean locally is a build that will succeed there. The site currently builds clean under-W.Iterating on a page:
.venv-docs/bin/python -m pip install sphinx-autobuild .venv-docs/bin/python -m sphinx_autobuild docs docs/_build/html # live reload on :8000If you edit
conf.py, force a full rebuild — Sphinx caches aggressively:rm -rf docs/_build && .venv-docs/bin/python -m sphinx -b html -W docs docs/_build/htmlMermaid diagrams render client-side, so the local page needs network access to fetch mermaid.js.
Publishing to Read the Docs (after merge)
This PR only lands the config — someone with repo admin rights has to do the one-time import.
.readthedocs.yamlmust be onmainfirst, since RTD builds itslatestversion from the default branch, so merge this before importing.1. Pick the right site. Community cannot build a private repo:
Check with
gh repo view AI-ModCon/BaseSIM_APEIRON --json visibility.2. Import the project.
AI-ModCon/BaseSIM_APEIRON.apeiron. The name becomes the slug becomes the URL:https://apeiron.readthedocs.io. Worth getting right on the first try, since changing it later breaks every published link..readthedocs.yamland starts the first build.3. Watch the first build under the Builds tab. It runs the same Sphinx command as above on Ubuntu 24.04 / Python 3.13, installing only
docs/requirements.txt. Becausefail_on_warning: trueis set, a single warning fails it. The site is warning-clean today, but RTD's Python 3.13 could surface something a local 3.11 venv does not — if so, fix the warning or temporarily flip that key in.readthedocs.yaml.4. Afterwards. The import installs a GitHub webhook, so every push to
mainrebuilds and redeploys with no further action. Worth enabling once:fail_on_warning./en/v0.1.0/next to/en/latest/).README.md:Notes for reviewers
Two docstring fixes in
src/apeiron/config/configuration.py— the only change outsidedocs/. Both were breaking the docs build, neither changes behavior:get_available_device— the nested bullet list had no blank lines, so docutils parsed it as a malformed definition list.env_overrides—Defaults to "APP_"was parsed as an RST link target because of the trailing underscore, producingERROR: Unknown target name: "app". NowAPP_.Docs updated for the
EnsembleDetectorwork in #114.choosing_a_detector.mdgained a "Combine detectors with an ensemble" section covering the voting rules, the one-instance-per-detector-type constraint, and the fact that warm-up is governed by the slowest sub-detector. Also added the ensemble to the pick-a-detector table and a paste-ready TOML tab.Path consistency.
continuous_learning.md(8 spots) andmodel_harness.md(1) still had pre-restructuresrc/training/...paths; nowsrc/apeiron/training/..., matching the fix already applied to the other pages in #113..gitignore. Two negations were needed: the repo-wide*.txtwas swallowingdocs/requirements.txt, which would have broken the RTD build. Also added.venv-docs/.Where to look first.
docs/index.mddefines the whole navigation via its toctrees — any new page must be listed there or Sphinx warns that it is orphaned.docs/README.mdhas the page map and the local conventions.Known gap.
deployment.mdandprofiler.mduse MyST{include}to pull in READMEs that live next to the code (src/apeiron/deployment/*/README.md,src/apeiron/profilers/README.md) so those pages track the scripts they document. If you move or rename those READMEs, the docs build fails.