Development Setup & Code Style#
Setup#
Clone the repository and install in development mode:
# Clone the repository
git clone https://github.com/kganitis/bam-engine.git
cd bam-engine
# Create and activate a virtual environment (recommended)
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
# Install in editable mode with development dependencies
pip install -e ".[dev]"
The development environment includes the optional [fast] extra (the Numba
goods-market kernel), which currently requires numpy<2.5 (numba’s ceiling),
so the dev environment resolves to numpy 2.4.x. The core install is unconstrained
(numpy>=1.26); a plain install on numpy 2.5 works and falls back to the
pure-Python goods loop. The pin can be removed once numba supports numpy 2.5.
Code Style#
BAM Engine uses the following tools for code quality:
Run all code quality checks:
# Format code (auto-fixes)
ruff format .
# Lint code (auto-fixes when possible)
ruff check --fix .
# Type checking
mypy
# All checks in one command
ruff format . && ruff check --fix . && mypy
The configuration in pyproject.toml automatically includes all Python packages
(src/ covers bamengine, validation, extensions, calibration;
plus tests/, diagnostics/, benchmarks/, examples/, and docs/conf.py)
while excluding generated files.
Building Documentation#
Build the documentation locally:
cd docs
sphinx-build -b html . _build/html
# View in browser
open _build/html/index.html # macOS
# Or: xdg-open _build/html/index.html # Linux