Skip to main content

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

Metadata

Release files for ect 1.3.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 ect 1.3.0
File Size Uploaded
ect-1.3.0.tar.gz 52.7 kB Details

Built distribution (wheel)

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

Total release size: 99.7 kB

Release files / ect-1.3.0.tar.gz

Download URL ect-1.3.0.tar.gz
Size 52.7 kB
Tags Source
SHA-256 checksum
How to use checksums
26576f1f69dc91209c0f5550c86a7f2e15d5f21d341ef48866391be0fdd73f1e
BLAKE2b-256 checksum
How to use checksums
3bcf2409d9b2186d48a3efbe142e62db9f78aa5ef73ffe23aae38b76e5a485ba
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.25

Release files / ect-1.3.0-py3-none-any.whl

Download URL ect-1.3.0-py3-none-any.whl
Size 47.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b83bb50c69c0a2361022885044f2d51d769cb0976380a1a96e7cf2a5070dba7c
BLAKE2b-256 checksum
How to use checksums
cbe61c382ef465a5f94eee6c820929869eeba3803b7f83097ff13707c27b6f7c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.25

Release history Release notifications | RSS feed

This release

1.3.0 This release

2 release files

1.2.4

2 release files

1.2.3

2 release files

1.2.2

2 release files

1.2.1

2 release files

1.2.0

2 release files

1.1.2

2 release files

1.1.1

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.1.11

2 release files

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

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