Companion Code
The repository contains the tested implementations used to check the manuscript's numerical claims and generate its figures. The package supports Python 3.10 through 3.13 and pins Optiland 0.6.0.
Set up the environment
Install uv, clone the repository, and run:
uv sync --locked
uv run pytest -q
The tests cover pure optical calculations, the pinned Optiland adapter, Python blocks in the manuscript, generated figures, and the complete Cooke Triplet example.
Regenerate validation figures
uv run python scripts/generate_chapter_validation.py
This command intentionally rewrites the shared figures/ directory and writes validation reports under validation/. It is for maintainers; readers do not need to run it to build the book.
Browse the implementation in src/optics_examples.