Skip to main content

A Lean Persistent Homology Library for Python

Project description

DOI PyPI version 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.

If you're looking for the original C++ library, you can find it at Ripser/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!

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

You can use the following bibtex entry

@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}
}

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

Uploaded Source

Built Distribution

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

ripser-0.4.1-cp37-cp37m-macosx_10_9_x86_64.whl (67.4 kB view details)

Uploaded CPython 3.7mmacOS 10.9+ x86-64

File details

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

File metadata

  • Download URL: ripser-0.4.1.tar.gz
  • Upload date:
  • Size: 79.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.1

File hashes

Hashes for ripser-0.4.1.tar.gz
Algorithm Hash digest
SHA256 a4015b413c24e3074f82f31771b1eb805e054b8cf444db51ce8ca5afa42cf130
MD5 fec1c5b498f0145bfa496b1dbeaaa4ec
BLAKE2b-256 4c17d5e898161eb8e3b1084419bfc04adbe87d15075daa8e236df72dbe75167e

See more details on using hashes here.

File details

Details for the file ripser-0.4.1-cp37-cp37m-macosx_10_9_x86_64.whl.

File metadata

  • Download URL: ripser-0.4.1-cp37-cp37m-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 67.4 kB
  • Tags: CPython 3.7m, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.1

File hashes

Hashes for ripser-0.4.1-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 2a587c2f0e172fb6565fb31a371baec6a4a77c2fe5e03cfe923cda041587df6f
MD5 8449751f430a8eb2179b795334604a64
BLAKE2b-256 33cfb334ef1b8a68fd88989b8748c6485a6cf63f4b1aeb6c9033a9737cf999b0

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