Build and maintain the documentation

From a checkout, install the development and documentation dependencies:

python -m pip install -e '.[dev,docs]'
OPENBLAS_NUM_THREADS=1 OMP_NUM_THREADS=1 python -m unittest discover -s tests -t . -v

Build the same HTML that GitHub Actions deploys:

python -m sphinx -b html -W --keep-going -n website/source website/build/html
python -m http.server 8080 --directory website/build/html

Open http://localhost:8080/. Sphinx supplies navigation, search, highlighted code, and downloads. The site uses the Read the Docs theme and MyST for the Markdown representation guide. Equations load MathJax from Sphinx’s default CDN when viewed.

Edit one source for each example

The source pages live in website/source/. The representation guide includes docs/field-guide.md so there is one version to maintain. Downloadable scripts live in website/source/examples/ and are included directly with literalinclude. No synchronization step is needed.

The examples use Gaussian fields and finite-ball modes. Numerical plots and schematic component diagrams are committed under website/source/figures/. Build jobs use those assets without rerunning calculations. With Matplotlib installed, regenerate them using:

MPLBACKEND=Agg OPENBLAS_NUM_THREADS=1 OMP_NUM_THREADS=1 python website/scripts/render_figures.py

The reference examples save plots in figures/ under their current working directory. The regeneration script selects the documentation source directory for you.

Keep examples independent of assessed work

Introduce a library operation with an independently checkable problem. Document inputs, outputs, shapes, measures, and boundary conventions, and explain what a diagnostic establishes. Keep complete exercise solvers, assigned-system results, interpretation of study outcomes, and instructor notes out of the published source tree and downloads. API documentation should describe contracts without assembling a complete investigation.

When removing a page or download, preview from a clean output directory. Sphinx’s incremental build can leave old files behind. Check the generated HTML, source downloads, and search index as well as the visible navigation.

GitHub Pages

The Documentation workflow builds on pull requests and pushes to main, treating warnings as errors. Only a successful build on main deploys to GitHub Pages. A manual workflow run on main can also deploy it. In the repository’s Pages settings, select GitHub Actions as the build and deployment source.

The public documentation URL is https://ifilot.github.io/flodi/. Documentation deployment is separate from tag-triggered PyPI publication.