Skip to content
Projects

Installation

tree-d-3d needs Python 3.10 or newer, cunumpy, simgeometry for electrode and wall shapes, and Pyccel (with a C compiler) for the compiled CPU kernels. Without a working Pyccel the NumPy versions of the kernels run instead, which is much slower for the tree kernels.

Terminal window
pip install "tree-d-3d @ git+https://github.com/max-models/tree-d-3d"

The kernels are compiled on first use and cached in ~/.cache/tree-d-3d/kernels (TREE_D_3D_KERNEL_CACHE moves it). They are built with OpenMP; TREE_D_3D_OPENMP=0 builds them serial, OMP_NUM_THREADS limits the threads.

ExtraInstalls
gpuCuPy, for the CUDA kernels
metalMLX, for the Metal kernels on Apple-silicon Macs
testpytest and coverage
docsthe notebook runner and griffe for the API reference
devformatters and linters, plus the test and docs extras

For development, clone the repository and run make install (uv), or

Terminal window
pip install -e ".[dev]"