Skip to main content

alphashapy

PyPI Docs Tests Changelog License

A Python package for constructing 2D alpha hulls for negative alphas. The algorithm is from the paper:

H. Edelsbrunner, D. Kirkpatrick and R. Seidel, "On the shape of a set of points in the plane," in IEEE Transactions on Information Theory, vol. 29, no. 4, pp. 551-559, July 1983, doi: 10.1109/TIT.1983.1056714.

And the implementation relies on Qhull's implementation of Voronoi diagrams, wrapped nicely for Python by Scipy here.

In the future I will try to add alpha shapes for negative alphas as well, today there is no python package that does that.

For alpha shapes with positive alphas, please use alphashape (which also supports higher dimensions) or alpha_shapes, both are great but do not currently (August 2024) support alpha hulls nor negative alphas.

Installation

Install this library using pip:

pip install alphashapy

Usage

import numpy as np
from alphashapy import alphahull_negative_alpha
points = np.random.rand(100,2)
alpha = -1
alphahull_negative_alpha(points, alpha)

Development

To contribute to this library, first checkout the code. Then create a new virtual environment:

cd alphashapy
python -m venv venv
source venv/bin/activate

Now install the dependencies and test dependencies:

python -m pip install -e '.[test]'

To run the tests:

python -m pytest

Metadata

Release files for alphashapy 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for alphashapy 0.2.0
File Size Uploaded
alphashapy-0.2.0.tar.gz 8.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for alphashapy 0.2.0
File Interpreter ABI Platform
alphashapy-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 15.9 kB

Release files / alphashapy-0.2.0.tar.gz

Download URL alphashapy-0.2.0.tar.gz
Size 8.0 kB
Tags Source
SHA-256 checksum
How to use checksums
158cac456aa26e752840edd4eb290d37e4e4bfea8d8ac6d9a514244a28717b97
BLAKE2b-256 checksum
How to use checksums
983cdaffa5a71d2fa7450ef5f6265a11ba5a417ec56dd5d852b116ef8a3395f8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.0 CPython/3.12.5

Release files / alphashapy-0.2.0-py3-none-any.whl

Download URL alphashapy-0.2.0-py3-none-any.whl
Size 7.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3ea55198d8c23ad65ac7c1337e387537192ae50d2715c58447a58c71c5834f33
BLAKE2b-256 checksum
How to use checksums
99a70202e090493b1c3de74e49b28026001f291a3fe257de2c641c4e3e2682c7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.0 CPython/3.12.5

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page