Skip to main content

A Lean Persistent Homology Library for Python

Project description

DOI PyPI version Downloads Conda Version Conda Downloads

Build Status Build status codecov License: MIT

Ripser.py

Ripser.py is a lean persistent homology package for Python. Building on the blazing fast C++ Ripser package as the core computational engine, Ripser.py provides an intuitive interface for

  • computing persistence cohomology of sparse and dense data sets,
  • visualizing persistence diagrams,
  • computing lowerstar filtrations on images, and
  • computing representative cochains.

Additionally, through extensive testing and continuous integration, Ripser.py is easy to install on Mac, Linux, and Windows platforms.

To aid your use of the package, we've put together a large set of notebooks that demonstrate many of the features available. Complete documentation about the package can be found at ripser.scikit-tda.org.

Related Projects

If you're looking for the original C++ library, you can find it at Ripser/ripser.

If you're looking for a GPU-accelerated version of Ripser, you can find it at Ripser++

Setup

Ripser.py is available on all major platforms. All that is required is that you install the standard Python numerical computing libraries and Cython.

Dependencies:

  • Cython
  • numpy
  • scipy
  • scikit-learn
  • persim

Windows users: If you are using a Windows machine, you will also need to install MinGW on your system.

Mac users: Updating your Xcode and Xcode command line tools will probably fix any issues you have with installation.

Cython should be the only library required before installation. To install, type the following commands into your environment:

pip install cython
pip install ripser

If you are having trouble installing, please let us know!

Optional dependency

Ripser.py when compiled from source can have a steroid1 shot by replacing the standard unordered_map from the STL by one of the fastest implementation available: robin_hood. Benchmarking of Ripser.py using the robin_hood implementation showed speed-ups up to 30%.

To be able to use robin_hood instead of STL, you only need to clone the repository containing the implementation:

# Run this command at the root of the project
git clone https://github.com/martinus/robin-hood-hashing ripser/robinhood

1 The Python package is already compiled with robin_hood by default.

Usage

The interface is as simple as can be:

import numpy as np
from ripser import ripser
from persim import plot_diagrams

data = np.random.random((100,2))
diagrams = ripser(data)['dgms']
plot_diagrams(diagrams, show=True)

We also supply a Scikit-learn transformer style object if you would prefer to use that:

import numpy as np
from ripser import Rips

rips = Rips()
data = np.random.random((100,2))
diagrams = rips.fit_transform(data)
rips.plot(diagrams)
Ripser.py output persistence diagram

Contributions

We welcome all kinds of contributions! Please get in touch if you would like to help out. Everything from code to notebooks to examples and documentation are all equally valuable so please don't feel you can't contribute. To contribute please fork the project make your changes and submit a pull request. We will do our best to work through any issues with you and get your code merged into the main branch.

If you found a bug, have questions, or are just having trouble with the library, please open an issue in our issue tracker and we'll try to help resolve the concern.

License

Ripser.py is available under an MIT license! The core C++ code is derived from Ripser, which is also available under an MIT license and copyright to Ulrich Bauer. The modifications, Python code, and documentation is copyright to Christopher Tralie and Nathaniel Saul.

Citing

If you use this package, please site the JoSS paper found here DOI and the JACT paper about Ripser found here DOI:10.1007/s41468-021-00071-5.

You can use the following bibtex entries:

@article{ctralie2018ripser,
  doi = {10.21105/joss.00925},
  url = {https://doi.org/10.21105/joss.00925},
  year  = {2018},
  month = {Sep},
  publisher = {The Open Journal},
  volume = {3},
  number = {29},
  pages = {925},
  author = {Christopher Tralie and Nathaniel Saul and Rann Bar-On},
  title = {{Ripser.py}: A Lean Persistent Homology Library for Python},
  journal = {The Journal of Open Source Software}
}

@article{Bauer2021Ripser,
    AUTHOR = {Bauer, Ulrich},
     TITLE = {Ripser: efficient computation of {V}ietoris-{R}ips persistence
              barcodes},
   JOURNAL = {J. Appl. Comput. Topol.},
  FJOURNAL = {Journal of Applied and Computational Topology},
    VOLUME = {5},
      YEAR = {2021},
    NUMBER = {3},
     PAGES = {391--423},
      ISSN = {2367-1726},
   MRCLASS = {55N31 (55-04)},
  MRNUMBER = {4298669},
       DOI = {10.1007/s41468-021-00071-5},
       URL = {https://doi.org/10.1007/s41468-021-00071-5},
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ripser-0.6.4.tar.gz (74.6 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

ripser-0.6.4-py3.9-win-amd64.egg (79.9 kB view details)

Uploaded Egg

ripser-0.6.4-py3.9-win32.egg (73.1 kB view details)

Uploaded Egg

ripser-0.6.4-py3.9-linux-x86_64.egg (682.6 kB view details)

Uploaded Egg

ripser-0.6.4-py3.8-win-amd64.egg (79.3 kB view details)

Uploaded Egg

ripser-0.6.4-py3.8-win32.egg (73.3 kB view details)

Uploaded Egg

ripser-0.6.4-py3.8-linux-x86_64.egg (684.3 kB view details)

Uploaded Egg

ripser-0.6.4-cp39-cp39-win_amd64.whl (71.1 kB view details)

Uploaded CPython 3.9Windows x86-64

ripser-0.6.4-cp39-cp39-win32.whl (64.4 kB view details)

Uploaded CPython 3.9Windows x86

ripser-0.6.4-cp38-cp38-win_amd64.whl (70.5 kB view details)

Uploaded CPython 3.8Windows x86-64

ripser-0.6.4-cp38-cp38-win32.whl (64.5 kB view details)

Uploaded CPython 3.8Windows x86

File details

Details for the file ripser-0.6.4.tar.gz.

File metadata

  • Download URL: ripser-0.6.4.tar.gz
  • Upload date:
  • Size: 74.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for ripser-0.6.4.tar.gz
Algorithm Hash digest
SHA256 7a9b3e9420869c50df85e9a446c912b8af81621e62ca1af8f9492c6335b7e594
MD5 fc8b76457cb5de09d2f8ffed3b3300a2
BLAKE2b-256 345f383da05a8956a9f5128d1f4eaf9306a239881a22f767dabd0a6a7cc27973

See more details on using hashes here.

File details

Details for the file ripser-0.6.4-py3.9-win-amd64.egg.

File metadata

  • Download URL: ripser-0.6.4-py3.9-win-amd64.egg
  • Upload date:
  • Size: 79.9 kB
  • Tags: Egg
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for ripser-0.6.4-py3.9-win-amd64.egg
Algorithm Hash digest
SHA256 02cfc52732ae78330266c44ed7ef54fa27073a512c6d2ac4fc3ebf7472a383bb
MD5 81317a6b4ea5f62d44c323aa96671e64
BLAKE2b-256 2e9b1c307cc0acd9688b1aae0847b6ebdc0471aeb8df0e8b7d2a7863ec8e1666

See more details on using hashes here.

File details

Details for the file ripser-0.6.4-py3.9-win32.egg.

File metadata

  • Download URL: ripser-0.6.4-py3.9-win32.egg
  • Upload date:
  • Size: 73.1 kB
  • Tags: Egg
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for ripser-0.6.4-py3.9-win32.egg
Algorithm Hash digest
SHA256 01ad2203bea58108315e98d1f55108083070b457e40abff4601e50368e055a72
MD5 e62caddd78cc473074f81a325c35dd9f
BLAKE2b-256 32e8170d7baea40697e4e2c79cc3973d5036e767fef92cd97f0516e4da54c9a2

See more details on using hashes here.

File details

Details for the file ripser-0.6.4-py3.9-linux-x86_64.egg.

File metadata

  • Download URL: ripser-0.6.4-py3.9-linux-x86_64.egg
  • Upload date:
  • Size: 682.6 kB
  • Tags: Egg
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for ripser-0.6.4-py3.9-linux-x86_64.egg
Algorithm Hash digest
SHA256 23214291b5e9993a6a9813fc7ce9980e9ef7fe1528b255da1e50f88271439ba4
MD5 34a48a2ccf9cbdd6c7dc6326b485fdd0
BLAKE2b-256 9378b7f480c69f4f28447adb56494de1af6a3b9bd5766dec493054a3401e1818

See more details on using hashes here.

File details

Details for the file ripser-0.6.4-py3.8-win-amd64.egg.

File metadata

  • Download URL: ripser-0.6.4-py3.8-win-amd64.egg
  • Upload date:
  • Size: 79.3 kB
  • Tags: Egg
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.10

File hashes

Hashes for ripser-0.6.4-py3.8-win-amd64.egg
Algorithm Hash digest
SHA256 eadee863aedd70a451810e417f213e09bfb9d0adbe3506cda2773975947e4a67
MD5 ce645ca04392e6ba4e15b5fde61298c8
BLAKE2b-256 41bbe8c0aef0413c119e90e4f17c479ff7abd2ead1a1d5302db8bfb228409ee3

See more details on using hashes here.

File details

Details for the file ripser-0.6.4-py3.8-win32.egg.

File metadata

  • Download URL: ripser-0.6.4-py3.8-win32.egg
  • Upload date:
  • Size: 73.3 kB
  • Tags: Egg
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.10

File hashes

Hashes for ripser-0.6.4-py3.8-win32.egg
Algorithm Hash digest
SHA256 87f70f8b5f507e813063c60eeab78153f567b635d3dadac13697c277e9d86d37
MD5 e44682a33993cb000c62a6b3a36076e9
BLAKE2b-256 f723ddc2690688a8af0dbcc34464c48c93d75fa09620b9cce18b7b80348c0ece

See more details on using hashes here.

File details

Details for the file ripser-0.6.4-py3.8-linux-x86_64.egg.

File metadata

  • Download URL: ripser-0.6.4-py3.8-linux-x86_64.egg
  • Upload date:
  • Size: 684.3 kB
  • Tags: Egg
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.13

File hashes

Hashes for ripser-0.6.4-py3.8-linux-x86_64.egg
Algorithm Hash digest
SHA256 b45d12a554eb6c198255d71bcf9fc936ff5925d0230ee61cb2e4bbd98568fbc6
MD5 09d81ce3b1ec12a7c9b93e3eb091f810
BLAKE2b-256 503d624271183088a40b085e56596ad780a64776c34adc1c4db5cf927aa46382

See more details on using hashes here.

File details

Details for the file ripser-0.6.4-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: ripser-0.6.4-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 71.1 kB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for ripser-0.6.4-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 82aeed78a4647fe6d7a3975b9805a0d127b85a48ba640d8e7ec55f80e8f75ca0
MD5 7c7bb44fac2b83caf59ab9142909e499
BLAKE2b-256 e09cbaf0073dc03072683a422b88705ddbc620fda4bd52ed50f55d7cc3fa73c2

See more details on using hashes here.

File details

Details for the file ripser-0.6.4-cp39-cp39-win32.whl.

File metadata

  • Download URL: ripser-0.6.4-cp39-cp39-win32.whl
  • Upload date:
  • Size: 64.4 kB
  • Tags: CPython 3.9, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for ripser-0.6.4-cp39-cp39-win32.whl
Algorithm Hash digest
SHA256 eec9f1edffb7ec468e9f5cc1ec48205c99fd841bfbde013bbb50410f3323b4fa
MD5 0d470c2b6aaf76e28321b619e68161fe
BLAKE2b-256 b23f25413238cf23337c6d6eb55d06b8d44f7fd66fb6be2ec687a6821dc07c36

See more details on using hashes here.

File details

Details for the file ripser-0.6.4-cp38-cp38-win_amd64.whl.

File metadata

  • Download URL: ripser-0.6.4-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 70.5 kB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.10

File hashes

Hashes for ripser-0.6.4-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 a07039057600485ccea2a78ed89996259db1232023c399cf6ce26ef8294b0153
MD5 0338cc5a66953fef19686487d2f80c99
BLAKE2b-256 6d5ae06cf93e56b0cca10013493b94d8de03a09820dce2fc37dafdd5e1f71848

See more details on using hashes here.

File details

Details for the file ripser-0.6.4-cp38-cp38-win32.whl.

File metadata

  • Download URL: ripser-0.6.4-cp38-cp38-win32.whl
  • Upload date:
  • Size: 64.5 kB
  • Tags: CPython 3.8, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.10

File hashes

Hashes for ripser-0.6.4-cp38-cp38-win32.whl
Algorithm Hash digest
SHA256 1094e882439444b9712d35f9c2d4cc4240446189144906b10c98109fb1708753
MD5 8e151be4593fa39ece87938799390812
BLAKE2b-256 e3dfa6062cbf101a8b12eb001ffccebcc5d3587b1eb528c40d8450b2ab8571dc

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page