Skip to content
 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

wasper-bary

wasp is a Rust re-implementation of the Wasserstein representation for Persistence diagrams paper. The original C++ implementation is available in this repository.

Getting Started

Prerequisites

  1. Rust: Install the Rust toolchain from rustup.rs.
  2. Python: Python 3.8+ is recommended.
  3. uv (Recommended): A fast Python package manager. Install with brew install uv or see uv documentation.

Installation & Build

  1. Clone the repository:

    git clone https://github.com/Gklajer/wasserstein-for-persistence-tda.git
    cd wasserstein-for-persistence-tda
  2. Sync the environment (creates venv and installs all dependencies):

    uv sync

Running the Code

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

Data Preparation

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/CSV

References

The following additional papers were used in the implementation:

About

'Wasserstein Dictionaries for Persistence Diagrams' - TDA MVA'25

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages