This project contains a collection of Python implementations for approximating
- Multiple Pi approximation algorithms in separate Python files
- A central launcher to choose and run methods interactively
- Optimized implementations that preserve the original mathematical logic
- Simple test coverage for selected algorithms
- Open the project folder.
- Run the launcher:
python -m pi_approximation_algorithms- Choose a method from the menu.
src/pi_approximation_algorithms/cli.py– interactive menu to run algorithmssrc/pi_approximation_algorithms/algorithms/– individual Pi approximation implementationstests/– basic regression tests for optimized methods
- Python 3.x
Install the project in editable mode before using the module command:
python -m pip install -e .
python -m pi_approximation_algorithmsBuild and start the interactive launcher with:
docker compose run --rm pi-approximationThe container expects an interactive terminal because the launcher prompts for an algorithm selection. To run it directly instead:
docker build -t pi-approximation .
docker run --rm -it pi-approximationCompile-check all Python files locally with:
python -m compileall -q srcGitHub Actions runs this check on pushes and pull requests across supported Python versions.
This project is provided for educational purposes.