Environment & Setup¶
This page describes how to set up a working pytanga development environment.
Prerequisites¶
| Tool | Version | Purpose |
|---|---|---|
| uv | ≥ 0.5 | Package manager and virtual environment |
| Python | ≥ 3.10 | Runtime (managed by uv) |
| C++ compiler | GCC ≥ 9, Clang ≥ 14, or MSVC ≥ 2019 | Compilation of generated pybind11 bindings |
| CMake | ≥ 3.18 | Build system for binding modules |
Quick Setup¶
# Clone the repository
git clone https://github.com/dodeka12/tanga.git
cd tanga
# Install all dependencies (including dev tools)
uv sync --all-extras
How Compilation Works¶
pytanga uses on‑demand JIT compilation:
- You import an
Algebrawith specific(dim, sig, dtype)parameters. - pytanga generates a C++ pybind11 binding file from a template.
- CMake compiles it into a shared library (
.so/.dylib/.pyd). - The result is cached in
~/.cache/pytanga/— subsequent imports are instant.
The three non‑template source files compiled into every binding are:
| File | Purpose |
|---|---|
Tan.Math/ValuePrecision.cpp |
template<> default precision specialisations |
Tan.Core/ValueFormatString.cpp |
Format string specialisations |
Tan.Math/Matrix.Enum.cpp |
Non‑template ToString(EMatrixResult) |
No pre‑built shared library is required.
Running Tests¶
Running Examples¶
Building Documentation¶
See MkDocs Publishing for instructions on building and deploying this documentation site.