Skip to main content

A Lean Persistent Homology Library for Python

Project description

DOI PyPI version Downloads Conda Version Conda Downloads

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 pypi with wheels for all major platforms. To install, type the following command into your environment:

pip install python

Local build

If the above command fails, you can build ripser.py locally. 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

Following this, clone the repository, cd into the clone, and execute pip install -v .

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 robinhood

After cloning robinhood with the above command, install ripser.py with

pip install -v .

This will install a local version of ripser.py with verbose output. In the verbose output, you will see confirmation that robinhood was found or not.

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

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

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.10.tar.gz (98.5 kB view details)

Uploaded Source

Built Distributions

ripser-0.6.10-cp312-cp312-win_amd64.whl (150.3 kB view details)

Uploaded CPython 3.12 Windows x86-64

ripser-0.6.10-cp312-cp312-win32.whl (144.6 kB view details)

Uploaded CPython 3.12 Windows x86

ripser-0.6.10-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (827.4 kB view details)

Uploaded CPython 3.12 manylinux: glibc 2.17+ x86-64

ripser-0.6.10-cp312-cp312-macosx_11_0_arm64.whl (157.6 kB view details)

Uploaded CPython 3.12 macOS 11.0+ ARM64

ripser-0.6.10-cp311-cp311-win_amd64.whl (149.9 kB view details)

Uploaded CPython 3.11 Windows x86-64

ripser-0.6.10-cp311-cp311-win32.whl (144.5 kB view details)

Uploaded CPython 3.11 Windows x86

ripser-0.6.10-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (841.3 kB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

ripser-0.6.10-cp311-cp311-macosx_11_0_arm64.whl (157.4 kB view details)

Uploaded CPython 3.11 macOS 11.0+ ARM64

ripser-0.6.10-cp310-cp310-win_amd64.whl (149.7 kB view details)

Uploaded CPython 3.10 Windows x86-64

ripser-0.6.10-cp310-cp310-win32.whl (144.6 kB view details)

Uploaded CPython 3.10 Windows x86

ripser-0.6.10-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (834.5 kB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

ripser-0.6.10-cp310-cp310-macosx_11_0_arm64.whl (157.6 kB view details)

Uploaded CPython 3.10 macOS 11.0+ ARM64

ripser-0.6.10-cp39-cp39-win_amd64.whl (149.7 kB view details)

Uploaded CPython 3.9 Windows x86-64

ripser-0.6.10-cp39-cp39-win32.whl (144.6 kB view details)

Uploaded CPython 3.9 Windows x86

ripser-0.6.10-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (834.3 kB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

ripser-0.6.10-cp39-cp39-macosx_11_0_arm64.whl (157.6 kB view details)

Uploaded CPython 3.9 macOS 11.0+ ARM64

ripser-0.6.10-cp38-cp38-win_amd64.whl (147.9 kB view details)

Uploaded CPython 3.8 Windows x86-64

ripser-0.6.10-cp38-cp38-win32.whl (142.8 kB view details)

Uploaded CPython 3.8 Windows x86

ripser-0.6.10-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (833.8 kB view details)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

ripser-0.6.10-cp38-cp38-macosx_11_0_arm64.whl (155.8 kB view details)

Uploaded CPython 3.8 macOS 11.0+ ARM64

File details

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

File metadata

  • Download URL: ripser-0.6.10.tar.gz
  • Upload date:
  • Size: 98.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.0 CPython/3.12.4

File hashes

Hashes for ripser-0.6.10.tar.gz
Algorithm Hash digest
SHA256 dccafaf97ad2395bc66cb376e5fbe0f6f264372b298fd093e4107132c1f79484
MD5 c137c2850175096c9ffd995e31ef0291
BLAKE2b-256 c82731ea7effa8a1cabd0f36962bb242eaa529577bec19157dfaaa983647caff

See more details on using hashes here.

File details

Details for the file ripser-0.6.10-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: ripser-0.6.10-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 150.3 kB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.0 CPython/3.12.4

File hashes

Hashes for ripser-0.6.10-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 5ee6c7433b95a84299ea00527e71f476312fac595166811d8a831c767c19a9da
MD5 3ea8498429efa0d0a4cd5498ce95b04a
BLAKE2b-256 e0ef9b5bcd7fa2fa77ea7db81f9bdd942f6d4fddb4d68c7cf609871674dfb003

See more details on using hashes here.

File details

Details for the file ripser-0.6.10-cp312-cp312-win32.whl.

File metadata

  • Download URL: ripser-0.6.10-cp312-cp312-win32.whl
  • Upload date:
  • Size: 144.6 kB
  • Tags: CPython 3.12, Windows x86
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.0 CPython/3.12.4

File hashes

Hashes for ripser-0.6.10-cp312-cp312-win32.whl
Algorithm Hash digest
SHA256 2cd0c0c3ef2fa085300dd76bc8f07b4c12c49a72f52cb8e0bd7fc6ca70390f7b
MD5 145828478f30c9ab48a6e30a3a76fd67
BLAKE2b-256 643945e318ae65401b2cd958192f76460c10fd46b4ab100c831666589c6f6097

See more details on using hashes here.

File details

Details for the file ripser-0.6.10-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for ripser-0.6.10-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 5ce75f555b0a9ed3da13d56772f9ec612758445e73db4f55be8a75c431bcb19e
MD5 34084d17da1aadc86feb8f2290d3c413
BLAKE2b-256 9199067bdf19dca7c1bca5607c3e945da479dfbcdca39fd4084c0fa6ca2332d3

See more details on using hashes here.

File details

Details for the file ripser-0.6.10-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for ripser-0.6.10-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 beb12c2803a98b00ea1eb4df9add94ad7e87d551eb1e7da5e631699d947750d0
MD5 79d18c8b8f4be188a46c0f7e0d757fb4
BLAKE2b-256 476a75ab5c2df0c542f2309696aad60bb7c68346a4db3ccb855424782e71b992

See more details on using hashes here.

File details

Details for the file ripser-0.6.10-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: ripser-0.6.10-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 149.9 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.0 CPython/3.12.4

File hashes

Hashes for ripser-0.6.10-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 b819c1bfca6a912c327bf9a4140f0efe27aa90e333cabdfa7933c8fa30c1623a
MD5 9bef37854e2fb8c1192b40f6cbbe2a3a
BLAKE2b-256 78ffd08a755dc72c763057bbb549c0642c4c76f8044e5230054fcfcda4bba337

See more details on using hashes here.

File details

Details for the file ripser-0.6.10-cp311-cp311-win32.whl.

File metadata

  • Download URL: ripser-0.6.10-cp311-cp311-win32.whl
  • Upload date:
  • Size: 144.5 kB
  • Tags: CPython 3.11, Windows x86
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.0 CPython/3.12.4

File hashes

Hashes for ripser-0.6.10-cp311-cp311-win32.whl
Algorithm Hash digest
SHA256 533e5ad05cea47161c4a58e2791cf6c303496af3caf560d5c0ba8cd14af1aa08
MD5 c946c20101bb019426f85df8a3ad9f99
BLAKE2b-256 666582581541b1892efb3c468805aa9f88ed69a60613a398fba64d273593fdae

See more details on using hashes here.

File details

Details for the file ripser-0.6.10-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for ripser-0.6.10-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 968827252e9b1f7f785320989918c54ace23955cd0cbff17e638d05874fcefce
MD5 dc42f321d927d5953cdb5966afccd883
BLAKE2b-256 0e273288a81a9254ce779bbc56c229686fe217888b05be4ea9ec2fbdfa8157d4

See more details on using hashes here.

File details

Details for the file ripser-0.6.10-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for ripser-0.6.10-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 dd078f851b216fea7f6b89e6b2ca5eac9decda5772af7cb0d9f9d39f61e25831
MD5 ec8d3389f517d18aaf4fda7b8ed52776
BLAKE2b-256 08677262a47e6e4567856a8a031e0c0dcb12a814ba3bada4bad13fd2b10c543f

See more details on using hashes here.

File details

Details for the file ripser-0.6.10-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: ripser-0.6.10-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 149.7 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.0 CPython/3.12.4

File hashes

Hashes for ripser-0.6.10-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 3658a5a8207f9587d736122273ff51cca3e2cbcbe67557a96aba8b5779d1a22b
MD5 856151ee2e63ca4882b85f9bca9cac17
BLAKE2b-256 6bac5356a56c19870932842e03a99a635c7c58488d73b3c58ace8684d72e6955

See more details on using hashes here.

File details

Details for the file ripser-0.6.10-cp310-cp310-win32.whl.

File metadata

  • Download URL: ripser-0.6.10-cp310-cp310-win32.whl
  • Upload date:
  • Size: 144.6 kB
  • Tags: CPython 3.10, Windows x86
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.0 CPython/3.12.4

File hashes

Hashes for ripser-0.6.10-cp310-cp310-win32.whl
Algorithm Hash digest
SHA256 fa4dc1b7cc3f2488c39991f0b6e8148e3e206858abf506ea685855e8f6db1665
MD5 faae24ac2b907958277396934156d962
BLAKE2b-256 3e2f3e7df3ce072413fb67cf043a54bd7a28073062f7de548b8d152a3f079f01

See more details on using hashes here.

File details

Details for the file ripser-0.6.10-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for ripser-0.6.10-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 0e72641e526e56c6f082c6960bf2cc38676210b013b145da67456eb6f47801ff
MD5 09f8aa74386e3844ca2660a3edd6e418
BLAKE2b-256 90c2dadf04102194294e5ffba49f6cc283dc4bb9b2a376b637624ea8f7a455c8

See more details on using hashes here.

File details

Details for the file ripser-0.6.10-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for ripser-0.6.10-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 aa74c75b08d385ba49c51c25308b72e57e09341080b728f7c755cdebbb7689a3
MD5 21e38f0fa4f31171871960a007cb4edf
BLAKE2b-256 8c530f80cdd04fb3cdaa2c46313b82b7eeb3336f88fb6d0591a8523deb0c6c1e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ripser-0.6.10-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 149.7 kB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.0 CPython/3.12.4

File hashes

Hashes for ripser-0.6.10-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 acf0e5367bcfe18655ac9f776006c20790574abd5f14674a4d35062c537c67b7
MD5 65125d39f7569b8a8ffa25035050dddd
BLAKE2b-256 4b04e0641e6ef24f8c05ffe12b233b6a7ca677a29f4323a642fb83e17353a7e2

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ripser-0.6.10-cp39-cp39-win32.whl
  • Upload date:
  • Size: 144.6 kB
  • Tags: CPython 3.9, Windows x86
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.0 CPython/3.12.4

File hashes

Hashes for ripser-0.6.10-cp39-cp39-win32.whl
Algorithm Hash digest
SHA256 d38a6d55319770639fce1c836d1e32eca1601e7037fd1f3c1ac3d6633db15e22
MD5 b3b19617e4815e75ea5211b3947ea7b0
BLAKE2b-256 6d4f7c0e1e7657a614294071b8b08a44f314644b375a069d70de2be34c28729a

See more details on using hashes here.

File details

Details for the file ripser-0.6.10-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for ripser-0.6.10-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 9ff9d8ee951d797fb11510c67b56c1a194c2fe8e228d585b26e2684ca979e59c
MD5 25e15ef67208e97dd593f7e55ae295d9
BLAKE2b-256 af1c5b21cca8d70ba4e3f2f70f44b65d1e91f85097f74744ac565e68f8578595

See more details on using hashes here.

File details

Details for the file ripser-0.6.10-cp39-cp39-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for ripser-0.6.10-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 557566db156e71f660a438b4571f1bac73658f4ea270d10924eff17582f04c1e
MD5 498a9e9004ff88a7ae14836aa32f7bb8
BLAKE2b-256 88464952c69191058a2ac1fd2d75d32d082aec63da65669e18a4c74f6da0f096

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ripser-0.6.10-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 147.9 kB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.0 CPython/3.12.4

File hashes

Hashes for ripser-0.6.10-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 677f8f08d72260b210d2f4da7c8e53ee1d6b1b9c8d9d1f1ab3b583cc74073994
MD5 00e7936dbb772a48398caadb2129a375
BLAKE2b-256 e583e2aa65600883987796d6f29702f5d9332aeedeb6833ede503fc019d68cd2

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ripser-0.6.10-cp38-cp38-win32.whl
  • Upload date:
  • Size: 142.8 kB
  • Tags: CPython 3.8, Windows x86
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.0 CPython/3.12.4

File hashes

Hashes for ripser-0.6.10-cp38-cp38-win32.whl
Algorithm Hash digest
SHA256 fa2d96266b2d54c705678f611f9a6fb1bceaf247022b42809aa1dda1cc92e35b
MD5 006cfef1820488fe45a14dfde54adfee
BLAKE2b-256 6bf92291153adc5cb2bd2127577a2669b816966a514f452beb9bcc9f7352a957

See more details on using hashes here.

File details

Details for the file ripser-0.6.10-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for ripser-0.6.10-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 00c60b8c01d0339105c9a1661ab15543f85f65f797db37161efb6dbc33421cc0
MD5 734b34898d6057f5ff8319f6b0d37a44
BLAKE2b-256 597277a4896be5fe24ddac09550e6da032bf259d082f229259b3871958702f20

See more details on using hashes here.

File details

Details for the file ripser-0.6.10-cp38-cp38-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for ripser-0.6.10-cp38-cp38-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 89f012e70189e989560081dcafff89053ba4085fdcfc0e1fe67b544a243304e9
MD5 cc5b5ad8ed0902ead9b863842f981b6e
BLAKE2b-256 7c426e8f15ed7593b6e1f6e51a97e887f149823e0f00469cb82e90e9f86775a9

See more details on using hashes here.

Supported by

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