Python tools for constructing, comparing, and experimenting with proximity graphs on planar point sets.
Project description
ProximityGraphs
ProximityGraphs is a Python-based computational geometry package for constructing and analyzing proximity and biological graphs, facilitating computational experimentation. It provides tools to generate and transform random and structured point sets and to build graphs from them. Its current scope comprises 13 geometric graphs, most of them proximity graphs—such as the Delaunay triangulation, the Gabriel graph, the Relative Neighborhood graph, and the Sphere-of-Influence graph—as well as the complete graph, the Erdős-Rényi random graph and two bio-inspired graphs.
Installation
We are on pipi! https://pypi.org/project/proximitygraphs/
pip install proximitygraphs
Or the editable on github
python -m pip install -e ".[dev, docs, gis]"
and to update the page
python -m sphinx -b html docs/source docs/build/html
Before pushing
python -m pytest
python -m ruff check .
Quickstart
import proximitygraphs as pg
points = pg.SetPoints.grid(shape=(3, 3))
mst = pg.MST(points)
unit_disk = pg.Unit_Disk(points, dist_max=1.01)
print(points.n) # 9 vertices
print(mst.m) # 8 edges
print(unit_disk.graph.get_edgelist())
A runnable example script is available at examples/quickstart.py.
API Overview
The main entry points are:
pg.SetPointsfor generating or loading planar point sets.pg.GeometricGraphfor graph operations, analysis helpers, and visualization.pg.DelaunayG,pg.GG,pg.RNG,pg.MST,pg.Unit_Disk,pg.Alpha_Shape, and related classes for proximity graph construction.pg.Experimentfor repeated simulations and metric aggregation.pg.PhysarumGraphfor the package's current bio-inspired graph model.
GIS helpers such as SetPoints.from_geopandas() and GeometricGraph.to_gpd_lines() require the optional gis extra.
Reproducibility / Installation
This repository is configured and tested for:
- Windows local development
- GitHub Actions on Ubuntu
- Python 3.10, 3.11, 3.12, 3.13 and 3.14
The project uses a src layout: source code lives in src/proximitygraphs/,
while the public import remains import proximitygraphs as pg.
The recommended validation sequence is:
python -m pip install -e ".[dev]"
python -m pytest -q
python -m ruff check .
python -m ruff format --check .
Citation
Software citation metadata is provided in CITATION.cff. A JOSS-ready manuscript draft is provided in paper.md.
The Zenodo DOI is still pending. Until archival metadata is finalized, use the versioned software citation in CITATION.cff and update it after a DOI is minted.
License
ProximityGraphs is distributed under the MIT License. See LICENSE.
Reporting Issues
Bug reports and feature requests should be filed through GitHub Issues. Security-sensitive issues should follow SECURITY.md.
Contributing
Development setup and contribution expectations are documented in CONTRIBUTING.md.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file proximitygraphs-0.1.0a2.tar.gz.
File metadata
- Download URL: proximitygraphs-0.1.0a2.tar.gz
- Upload date:
- Size: 13.4 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
28f60192165173421f5f4c68bd80ed29c48d7fe4f594107bae0fe335a8242b96
|
|
| MD5 |
cca16bc58f64dbf73ba49bd3cf45aca1
|
|
| BLAKE2b-256 |
e5bb9a101f483d2ad11f9a899c5df60cdb902f9d0673a6b5b8459665c9ed7f0f
|
Provenance
The following attestation bundles were made for proximitygraphs-0.1.0a2.tar.gz:
Publisher:
publish.yml on HectorMaravillo/ProximityGraphs
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
proximitygraphs-0.1.0a2.tar.gz -
Subject digest:
28f60192165173421f5f4c68bd80ed29c48d7fe4f594107bae0fe335a8242b96 - Sigstore transparency entry: 1654877575
- Sigstore integration time:
-
Permalink:
HectorMaravillo/ProximityGraphs@d2f45f8b3f1a1d04692d472097510eb985a0392a -
Branch / Tag:
refs/tags/v0.1.0a2 - Owner: https://github.com/HectorMaravillo
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@d2f45f8b3f1a1d04692d472097510eb985a0392a -
Trigger Event:
push
-
Statement type:
File details
Details for the file proximitygraphs-0.1.0a2-py3-none-any.whl.
File metadata
- Download URL: proximitygraphs-0.1.0a2-py3-none-any.whl
- Upload date:
- Size: 98.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bc2dd332afe5b2336221e00e754c6020717a8e20792e56a6a26b99c748415e3d
|
|
| MD5 |
23351e2cf35a0f1aeb4be668525e8a32
|
|
| BLAKE2b-256 |
3129ba896e016d55511951e1f615c30f1c5adb576c91a146b60c1992efc3b882
|
Provenance
The following attestation bundles were made for proximitygraphs-0.1.0a2-py3-none-any.whl:
Publisher:
publish.yml on HectorMaravillo/ProximityGraphs
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
proximitygraphs-0.1.0a2-py3-none-any.whl -
Subject digest:
bc2dd332afe5b2336221e00e754c6020717a8e20792e56a6a26b99c748415e3d - Sigstore transparency entry: 1654877696
- Sigstore integration time:
-
Permalink:
HectorMaravillo/ProximityGraphs@d2f45f8b3f1a1d04692d472097510eb985a0392a -
Branch / Tag:
refs/tags/v0.1.0a2 - Owner: https://github.com/HectorMaravillo
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@d2f45f8b3f1a1d04692d472097510eb985a0392a -
Trigger Event:
push
-
Statement type: