This repository holds the code associated with each chapter of the SPIE book Optics Using Python.
Clone the repository with GitHub Desktop or download the zip file.
The recommended Python environment is Anaconda, so as to remove the necessity of installing NumPy, SciPy, and other libraries manually.
On a fresh Anaconda installation, you should be able open the folder in VS code or
another editor and run pytest
from the root directory with passing results.
To follow along with the book, open the code folder corresponding to the book chapter.
The majority of the examples in the text of the book come from the Python files named
after the chapter (e.g. ch1.py
for chapter 1).
It is recommeneded to open the entire folder Optics-Using-Python
in your preferred editor
and to run the relevant chapter files manually. When imports are introduced, this ensures
everything plays nicely.
If you find bugs, please file an issue! I am eager to ensure the codebase stays healthy and useful to many.
The code in this repository is licensed under BSD 3-Clause.