Skip to main content

Area-proportional Euler and Venn diagrams

Project description

eunoia

Python bindings for the eunoia Rust library — area-proportional Euler and Venn diagrams. Sister package to the R package eulerr.

Status: v0.1.0 — initial release. The user-facing surface may evolve.

Install

pip install eunoia

Quickstart

import eunoia as eu
import matplotlib.pyplot as plt

# Disjoint (per-region) input is the default.
fit = eu.euler({"A": 10, "B": 5, "A&B": 3})
print(fit)
# EulerFit (2 circles, diag_error=2.776e-17, stress=5.887e-33, loss=5.887e-33)
#                  original      fitted    residual regionError
#   A                    10          10           0           0
#   B                     5           5           0           0
#   A&B                   3           3   8.882e-16   2.776e-17

fit.plot()
plt.show()

Inclusive input

If your numbers are set sizes that already include their overlaps, pass input="inclusive" and the eunoia core handles the inclusion-exclusion conversion:

fit = eu.euler({"A": 13, "B": 8, "A&B": 3}, input="inclusive")

Ellipses

Ellipses are more flexible than circles and fit many three-set arrangements exactly:

fit = eu.euler(
    {"A": 2, "B": 2, "C": 2, "A&B": 1, "A&C": 1, "B&C": 1},
    shape="ellipse",
)
print(fit.diag_error)  # ~1e-14
fit.plot(quantities=True)

Plot styling

fit.plot(
    colors=["#e41a1c", "#377eb8", "#4daf4a"],   # per-set
    quantities="fitted",                          # show fitted areas at region anchors
    labels=True,                                  # set names at set anchors
    edges={"linewidth": 1.5},
)

Public API

Function / class Purpose
eunoia.euler(values, …) Fit a diagram from a {combination: area} dict
eunoia.EulerFit Result class with shapes, fitted values, metrics
eunoia.Circle / Ellipse Per-set fitted shape
eunoia.Point 2D point
eunoia.EunoiaError Base error type (subclass of ValueError)

Status & roadmap (v0.1.0 → v0.2)

In v0.1.0:

  • dict input only, with input="exclusive" / "inclusive"
  • circle and ellipse shapes
  • matplotlib-based plotting

Deferred to v0.2+:

  • venn() (non-proportional, 1–5 sets)
  • error_plot() diagnostic
  • list-of-sets / DataFrame input
  • complement (universe area outside all sets)
  • square and rectangle shapes
  • exposed optimizer / tolerance knobs

License

MIT

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

eunoia-0.1.0.tar.gz (171.3 kB view details)

Uploaded Source

Built Distributions

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

eunoia-0.1.0-cp311-abi3-win_amd64.whl (816.6 kB view details)

Uploaded CPython 3.11+Windows x86-64

eunoia-0.1.0-cp311-abi3-musllinux_1_2_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.11+musllinux: musl 1.2+ x86-64

eunoia-0.1.0-cp311-abi3-musllinux_1_2_aarch64.whl (948.2 kB view details)

Uploaded CPython 3.11+musllinux: musl 1.2+ ARM64

eunoia-0.1.0-cp311-abi3-manylinux_2_28_x86_64.whl (865.9 kB view details)

Uploaded CPython 3.11+manylinux: glibc 2.28+ x86-64

eunoia-0.1.0-cp311-abi3-manylinux_2_28_aarch64.whl (772.0 kB view details)

Uploaded CPython 3.11+manylinux: glibc 2.28+ ARM64

eunoia-0.1.0-cp311-abi3-macosx_11_0_arm64.whl (740.8 kB view details)

Uploaded CPython 3.11+macOS 11.0+ ARM64

eunoia-0.1.0-cp311-abi3-macosx_10_12_x86_64.whl (821.5 kB view details)

Uploaded CPython 3.11+macOS 10.12+ x86-64

File details

Details for the file eunoia-0.1.0.tar.gz.

File metadata

  • Download URL: eunoia-0.1.0.tar.gz
  • Upload date:
  • Size: 171.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for eunoia-0.1.0.tar.gz
Algorithm Hash digest
SHA256 d7c7aeded772826ce22f05df5c4a1e4b6cf294e5f883f1dc990efa018898d13d
MD5 42775169475a9698e3a01b479e48b072
BLAKE2b-256 dc20490bd823cd13c4463cc1fa6bde94652a8565a670f249b7bcc9216ed35079

See more details on using hashes here.

Provenance

The following attestation bundles were made for eunoia-0.1.0.tar.gz:

Publisher: publish.yml on jolars/eunoia-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file eunoia-0.1.0-cp311-abi3-win_amd64.whl.

File metadata

  • Download URL: eunoia-0.1.0-cp311-abi3-win_amd64.whl
  • Upload date:
  • Size: 816.6 kB
  • Tags: CPython 3.11+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for eunoia-0.1.0-cp311-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 8373786d5d376bfd694faab3ef7e7ba90be92f965c538b7f2ee900507ccf65bf
MD5 acaac5a893da2be3db0509566a2bd3dc
BLAKE2b-256 4db66abbeead5c28de4e3fb7b74476db1e03b5c9089b8f39c5357ae051ababb8

See more details on using hashes here.

Provenance

The following attestation bundles were made for eunoia-0.1.0-cp311-abi3-win_amd64.whl:

Publisher: publish.yml on jolars/eunoia-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file eunoia-0.1.0-cp311-abi3-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for eunoia-0.1.0-cp311-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 3ae128c20cd76826d9454902946e9196d3c0d282299dd04594f77cbf184b1d2a
MD5 da1f9db4f9284150474ad76b5504dbf1
BLAKE2b-256 6fa04271d2a03b6eec0d474a3684a33d7098f8cf1b13fd5569425262e8521feb

See more details on using hashes here.

Provenance

The following attestation bundles were made for eunoia-0.1.0-cp311-abi3-musllinux_1_2_x86_64.whl:

Publisher: publish.yml on jolars/eunoia-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file eunoia-0.1.0-cp311-abi3-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for eunoia-0.1.0-cp311-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 cfd06bcc851338d28824e240de319d3667cca5012ecffb5c8cd0a8505a5796af
MD5 d807efb18d4ea22ef2184e6b5ab5c536
BLAKE2b-256 ab9ff83eae0ee254321aea1735986db67b01a542c1df3e609f8de405e56c65e6

See more details on using hashes here.

Provenance

The following attestation bundles were made for eunoia-0.1.0-cp311-abi3-musllinux_1_2_aarch64.whl:

Publisher: publish.yml on jolars/eunoia-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file eunoia-0.1.0-cp311-abi3-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for eunoia-0.1.0-cp311-abi3-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 f39ffd1421c70fda038f6c7ae226c315da935345177374f0e983b13c08a34dd2
MD5 bb78fcb96e69946b2edd83cce41e3fd5
BLAKE2b-256 8269c118bc0d33153e0d140a09f02da5c30c5d44e8687113d3467a37827f1e7b

See more details on using hashes here.

Provenance

The following attestation bundles were made for eunoia-0.1.0-cp311-abi3-manylinux_2_28_x86_64.whl:

Publisher: publish.yml on jolars/eunoia-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file eunoia-0.1.0-cp311-abi3-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for eunoia-0.1.0-cp311-abi3-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 76d5bb8c866c0d2693bca0de620435cc110400532a9ad8e5d65524e30b7fefde
MD5 f54326f202a7b48e85581209729012ba
BLAKE2b-256 9071e06d3838ee9c276d03421057da8027372235313b2a5c11342974af34838b

See more details on using hashes here.

Provenance

The following attestation bundles were made for eunoia-0.1.0-cp311-abi3-manylinux_2_28_aarch64.whl:

Publisher: publish.yml on jolars/eunoia-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file eunoia-0.1.0-cp311-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for eunoia-0.1.0-cp311-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f379e326035591647487dfa22df59f02838cba67ce44f1105b827cf60570b2c3
MD5 823cede36c7bb9fdde5c931772b3856e
BLAKE2b-256 daf4c9f3344c38225a83f5c43fb358996feb601b572fcccdff0e8daa16ac4968

See more details on using hashes here.

Provenance

The following attestation bundles were made for eunoia-0.1.0-cp311-abi3-macosx_11_0_arm64.whl:

Publisher: publish.yml on jolars/eunoia-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file eunoia-0.1.0-cp311-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for eunoia-0.1.0-cp311-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 f7115d8ffeabedf9baa44db5d96aa318c8931d62496b49e4968b534387a2a494
MD5 2962f9bdd0e466a77a3a5d51d57991c6
BLAKE2b-256 aef910d625e0561b13923d177d8ffb05cfe8cf3781bc13d1518fe011638f0770

See more details on using hashes here.

Provenance

The following attestation bundles were made for eunoia-0.1.0-cp311-abi3-macosx_10_12_x86_64.whl:

Publisher: publish.yml on jolars/eunoia-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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