Skip to main content

A python package for computing the Euler Characteristic Transform

Project description

ect: A python package for computing the Euler Characteristic Transform

Python computation tools for computing the Euler Characteristic Transform of embedded complexes.

Description

The package provides fast tools for computing the Euler Characteristic Transform (ECT) on embedded cell complexes in any ambient dimension. You build a complex (vertices, edges, and optional higher‑dimensional cells), choose a set of directions and thresholds, and compute either the exact ECT or its smoothed/differentiable variants. Results come back as NumPy arrays with metadata, plotting helpers, and distance utilities, making it straightforward to visualize transforms and compare shapes. The core is implemented with NumPy and Numba, with optional validation of geometric and structural constraints when constructing complexes.

  • EmbeddedComplex: convert point clouds into complexes with vertices, edges, and higher‑dimensional cells with embedded coordinates.
  • ECT, SECT, DECT : ECT calculations along with the smooth and differentiable variants over sampled directions and transforms.
  • Directions: uniform, random, or custom directions (angles in 2D; vectors in any dimension)
  • Results as ECTResult: behaves like a NumPy array, with plotting and distance helpers
  • Optional geometric/structural validation when building complexes

For more information on the ECT, see:

Munch, Elizabeth. An Invitation to the Euler Characteristic Transform. The American Mathematical Monthly, 132(1), 15-25. doi:10.1080/00029890.2024.2409616. 2024.

Getting Started

Documentation and tutorials

Installing

Requires Python 3.10+.

Install from PyPI:

pip install ect

Alternatively, you can clone the repo and install directly

git clone git@github.com:MunchLab/ect.git
cd ect
pip install .

Quickstart

Compute an ECT for a simple embedded triangle and plot it.

from ect import ECT, EmbeddedComplex

G = EmbeddedComplex()
G.add_node("a", [0.0, 0.0])
G.add_node("b", [1.0, 0.0])
G.add_node("c", [0.5, 0.8])
G.add_edge("a", "b")
G.add_edge("b", "c")
G.add_edge("c", "a")

ect = ECT(num_dirs=32, num_thresh=128)
result = ect.calculate(G)
result.plot()

Authors

This code was written by Liz Munch along with her research group and collaborators. People who have contributed to ect include:

License

This project is licensed under the GPLv3 License - see the License file for details

Contact Information

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

ect-1.3.0.tar.gz (52.7 kB view details)

Uploaded Source

Built Distribution

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

ect-1.3.0-py3-none-any.whl (47.0 kB view details)

Uploaded Python 3

File details

Details for the file ect-1.3.0.tar.gz.

File metadata

  • Download URL: ect-1.3.0.tar.gz
  • Upload date:
  • Size: 52.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.25

File hashes

Hashes for ect-1.3.0.tar.gz
Algorithm Hash digest
SHA256 26576f1f69dc91209c0f5550c86a7f2e15d5f21d341ef48866391be0fdd73f1e
MD5 35ba5740d7382aba981428a5d5be6737
BLAKE2b-256 3bcf2409d9b2186d48a3efbe142e62db9f78aa5ef73ffe23aae38b76e5a485ba

See more details on using hashes here.

File details

Details for the file ect-1.3.0-py3-none-any.whl.

File metadata

  • Download URL: ect-1.3.0-py3-none-any.whl
  • Upload date:
  • Size: 47.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.25

File hashes

Hashes for ect-1.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b83bb50c69c0a2361022885044f2d51d769cb0976380a1a96e7cf2a5070dba7c
MD5 a76c2be0247e5c20e960818e6bb08d7a
BLAKE2b-256 cbe61c382ef465a5f94eee6c820929869eeba3803b7f83097ff13707c27b6f7c

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