simplextree
simplextree
is an Python package that simplifies computation for general simplicial complexes of any dimension by providing pybind11 bindings to a Simplex Tree data structure implemented in modern C++17.
A Simplex Tree is an ordered, trie-like structure whose nodes are in bijection with the faces of the complex. Here’s a picture of a simplicial 3-complex (left) and its corresponding Simplex Tree (right):
The Simplex Tree was originally introduced in the following paper:
Boissonnat, Jean-Daniel, and Clément Maria. “The simplex tree: An efficient data structure for general simplicial complexes.” Algorithmica 70.3 (2014): 406-427.
The SimplexTree
class exported by the package includes support for many tree operations, e.g. insertions, removals, expansions, collapses, star/link enumerations, and other traversals.
Install
The easiest way to install the package is via the platform-specific wheels on pypi.
python -m pip install simplextree
You can also pip install
the package manually by downloading the appropriate wheel (or sdist) from the releases.
For installation instructions for developers looking to extend the package, see Building & Developing.
Building & Developing
If you would like to build the package yourself for development reasons, a typical workflow is to install the build-time dependencies first:
python -m pip install meson-python ninja pybind11 numpy
Then, build and install the package in editable mode (see also meson-python notes), optionally without build isolation for speed:
python -m pip install --no-build-isolation --editable .
Unit testing is handled with pytest. See the gh-workflows for platform-specific configuration.
Native Extensions
The underlying C++ library is header-only and may be included as a dependency by extension modules in other Python packages.
Thus, to modify or extending the complex in C++, it is sufficient to add the package as a build-time dependency and append the include directory to the compilation target.