Skip to main content

constraint-snap

Geometric constraint snapping. Define ranges, snap values to satisfy all constraints, detect conflicts. Like snapping to a grid, but for behavior spaces.

Usage

from constraint_snap import ConstraintSnap, Constraint

cs = ConstraintSnap()
cs.add(Constraint("max_speed", 0, 100))
cs.add(Constraint("safe_speed", 0, 60))

result = cs.snap(75)
# snapped=60, violations=["safe_speed"], feasible=False (was clamped)

lo, hi = cs.feasible_range()  # (0, 60) — intersection
conflicts = cs.conflicts()    # [] — no impossible pairs

Zero deps. pip install constraint-snap

Metadata

Release files for constraint-snap 0.1.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 constraint-snap 0.1.0
File Size Uploaded Provenance Actions
constraint_snap-0.1.0.tar.gz 3.2 kB Without provenance Details for constraint_snap-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for constraint-snap 0.1.0
File Interpreter ABI Platform Actions
constraint_snap-0.1.0-py3-none-any.whl Python 3 none any Details for constraint_snap-0.1.0-py3-none-any.whl

Total release size: 6.6 kB

Release files / constraint_snap-0.1.0.tar.gz

Download URL constraint_snap-0.1.0.tar.gz
Size 3.2 kB
Tags Source
SHA-256 checksum
How to use checksums
a708a433f9461574a4b95c5875539411ade586e2a44dc83c552dcebf4f70da6c
BLAKE2b-256 checksum
How to use checksums
206590d6a0cc6db9ae24dec90b4945f8de1f724c01ee069bc623ae4ed4abf060
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.12

Release files / constraint_snap-0.1.0-py3-none-any.whl

Download URL constraint_snap-0.1.0-py3-none-any.whl
Size 3.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
497c8ee69734f27ddcb02cca54b539d270375d8897f8309460f4ef29873ee90b
BLAKE2b-256 checksum
How to use checksums
89850c087b34b2abf51fe4c304e2f70fcd23f10e5c59b2aaf9f5f0ff4d11463a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.12

Security for constraint-snap 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

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