Implementation of Minibox and Delauany edges algorithms.
Project description
persty
- Minibox and Delaunay Edges Algorithms
This package provides an implementation of algorithms for finding the Minibox and Delaunay edges on a finite set of points in d-dimensional space with Chebyshev distance.
Installation
Install it with
>>> pip install persty
For the installation to complete succesfully you need
setuptools
andnumpy
installed in the current Python environment;- a
C
compiler for the module to be built. On Windows download and install Visual Studio community.
To use the functionality of the persty.util
submodule it is also necessary to
install the gudhi
Python package.
If you installed conda
this can be obtained by running the following command in a terminal window.
>>> conda install -c conda-forge gudhi
Basic usage
import numpy as np
import persty.minibox
import persty.delaunay
np.random.seed(0)
points = np.random.rand(20, 2).tolist()
minibox_edges = persty.minibox.edges(points)
delaunay_edges = persty.delaunay.edges(points)
Computing Persistent Homology
Minibox and Delaunay edges can be used to compute persistent homology in homological dimensions zero and one.
The pesty
package provides a wrapper function to generate a gudhi.SimplexTree()
object that can be used to compute persistence diagrams of Minibox and Alpha Clique
filtrations.
The following code computes the zero and one dimensional persistence diagrams of 100 three-dimensional randomly sampled points in the unit cube.
import numpy as np
import persty.minibox
import persty.util
from scipy.spatial.distance import chebyshev
np.random.seed(0)
points = np.random.rand(100, 3).tolist()
minibox_edges = persty.minibox.edges(points)
simplex_tree = persty.util.make_gudhi_simplex_tree(points,
minibox_edges,
max_simplex_dim=2,
metric=chebyshev)
persistence_diagrams = simplex_tree.persistence(homology_coeff_field=2,
persistence_dim_max=False)
Tests
To check that this package was installed correctly you can run the tests in
the test/
directory of this repository.
- Download this repository on you computer by running the following command in a terminal window.
>>> git clone https://github.com/gbeltramo/persty.git
Note
On Windows you can obtain git
by installing the
chocolatey
package manager, and running
>>> choco install git
-
In a terminal window move to the
persty
directory you just downloaded. -
If you do not have the
pytest
package installed run
>>> pip install pytest
- Finally run
>>> pytest
or
>>> pytest -q
The second option decreases the verbosity of the output of this command.
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
Built Distributions
File details
Details for the file persty-1.0.0.tar.gz
.
File metadata
- Download URL: persty-1.0.0.tar.gz
- Upload date:
- Size: 10.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3.post20200330 requests-toolbelt/0.9.1 tqdm/4.44.1 CPython/3.7.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ec74a40914d44cdebedc762bbb01434d3ea4ae7e24a160564ea9c611ae5be1af |
|
MD5 | bb66b0a7141e29742d0936b3912184a9 |
|
BLAKE2b-256 | 01d63551d24ba7b32603c10a9e9fe969259e7dcff189bdd0ec19e8ad1507ebe2 |
File details
Details for the file persty-1.0.0-py3.7-win-amd64.egg
.
File metadata
- Download URL: persty-1.0.0-py3.7-win-amd64.egg
- Upload date:
- Size: 21.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3.post20200330 requests-toolbelt/0.9.1 tqdm/4.44.1 CPython/3.7.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7de586ff8b6146f9292b84c4ac883dd3699be33cdd380f9716cd2b9c6f9ec3bb |
|
MD5 | 2d4f84d40a9f128e9535e4ad9a7fdcf2 |
|
BLAKE2b-256 | fd2d7a44d87ca0c63f06f35416c6b506da5b262d021242dd83c6136f1c1ea6bf |
File details
Details for the file persty-1.0.0-cp37-cp37m-win_amd64.whl
.
File metadata
- Download URL: persty-1.0.0-cp37-cp37m-win_amd64.whl
- Upload date:
- Size: 29.8 kB
- Tags: CPython 3.7m, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3.post20200330 requests-toolbelt/0.9.1 tqdm/4.44.1 CPython/3.7.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a9be9a7ba924dd7856a81b0b40d1b8730534a24ffc9d8fd643b34da961934699 |
|
MD5 | e01e5f84300e369647d79b116ae85da2 |
|
BLAKE2b-256 | 9ed0596b29a27f2934c586d6f17a0c788ca13a5a46c7660cce38b5c5b524bab3 |