wasp is a Rust re-implementation of the Wasserstein representation for Persistence diagrams paper. The original C++ implementation is available in this repository.
- Rust: Install the Rust toolchain from rustup.rs.
- Python: Python 3.8+ is recommended.
- uv (Recommended): A fast Python package manager. Install with
brew install uvor see uv documentation.
-
Clone the repository:
git clone https://github.com/Gklajer/wasserstein-for-persistence-tda.git cd wasserstein-for-persistence-tda -
Sync the environment (creates venv and installs all dependencies):
uv sync
After building the extension, you can run the provided Python scripts from the examples/ directory:
-
Barycenter Test: Visualizes the Wasserstein barycenter of two diagrams.
uv run examples/barycenter_test.py
-
Matching Test: Visualizes the optimal matching between two diagrams.
uv run examples/test_maching.py
-
Benchmark: Runs performance benchmarks.
uv run examples/benchmark.py
To convert persistence diagrams from VTU format (e.g., from ParaView/TTK) to the CSV format used by this project, you can use the provided conversion script. It handles Birth, Death (including infinite values), and PairType extraction.
uv run scripts/vtu_to_csv.py --input data/VTU --output data/CSVThe following additional papers were used in the implementation: