Skip to content

A library for computing topological data structures stemming from Morse Theory. Given a set of arbitrarily arranged points in any dimension, this library is able to construct approximate topological structures using a neighborhood graph to simulate manifold structures.

License

Notifications You must be signed in to change notification settings

maljovec/topopy

Repository files navigation

topopy

Latest Version on PyPI PyPI downloads Code Quality Test Results Test Suite Results CodeFactor Coveralls ReadTheDocs Pyup This code is formatted in black This code has its imports sorted with isort BSD 3-Clause License

topopy

A library for computing topological data structures stemming from Morse Theory. Given a set of arbitrarily arranged points in any dimension, this library is able to construct approximate topological structures using a neighborhood graph to simulate manifold structures.

Installation

Currently, you can use pip to install this package and all of its prerequisite libraries:

pip install topopy

Or to install from source, install all of the prerequiste libraries:

And then clone and build the source repository:

git clone https://github.com/maljovec/topopy.git
cd topopy
make
python setup.py [develop|install]

Example Usage

import nglpy as ngl
import numpy as np
import topopy

def hill(_x):
    _x = np.atleast_2d(_x)
    x = _x[:, 0]
    y = _x[:, 1]
    return np.exp(- ((x - .55)**2 + (y-.75)**2)/.125) + 0.01*(x+y)

X = np.random.rand(100,2)
Y = hill(X)
graph = ngl.EmptyRegionGraph(beta=1.0, relaxed=False, p=2.0)

msc = topopy.MorseSmaleComplex(graph=graph,
                               gradient='steepest',
                               normalization='feature')
msc.build(X, Y)
msc.get_partitions()

About

A library for computing topological data structures stemming from Morse Theory. Given a set of arbitrarily arranged points in any dimension, this library is able to construct approximate topological structures using a neighborhood graph to simulate manifold structures.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages