pyrobust-predicates
Python port of mourner/robust-predicates (v3.0.x): adaptive-precision geometric predicates with the same y-down 2D convention as the JavaScript library.
Upstream pin: tests and fixtures target mourner/robust-predicates@v3.0.3. See docs/UPSTREAM_TESTS.md for how test/test.js maps to pytest.
This package backs dylaunator (mapbox/delaunator in Python) so Delaunay code can run without Node.
Requirements
- Python 3.10+
- Runtime dependency:
mpmath(extended-precision fallback forincircle/inspherewhen the float filter is inconclusive;orient2d/orient3dfollow the upstream expansion style inesm/)
Install
uv add pyrobust-predicates
API (matches upstream index.js)
Named exports are the same eight functions as npm:
| Symbol | Arguments | Role |
|---|---|---|
orient2d, orient2dfast |
6 scalars (ax, ay, bx, by, cx, cy) |
2D orientation |
orient3d, orient3dfast |
12 scalars | 3D orientation |
incircle, incirclefast |
8 scalars | In-circle |
insphere, inspherefast |
15 scalars | In-sphere |
Returns are numeric (typically float; fast paths may yield int). Compare to zero for the geometric sign; orient2d / orient2dfast are not identical on ill-conditioned input (upstream treats robust vs fast as different entry points).
Testing and coverage
uv run pytest packages/pyrobust-predicates -q
uv run pytest packages/pyrobust-predicates --cov=pyrobust_predicates --cov-report=term-missing
Includes a pytest port of upstream test/test.js (fixtures under tests/fixtures/*.txt), export parity checks, and small _util tests. Package source is kept at 100% line coverage under that configuration.
Upstream test fixtures
.txt files under tests/fixtures/ match upstream test/fixtures/*.txt at v3.0.3. Details: docs/UPSTREAM_TESTS.md.
Releasing (PyPI)
From this directory:
uv build
uv publish # or upload dist/* with twine
Artifacts are written to the workspace dist/. Bump version in pyproject.toml and record changes in docs/CHANGELOG.md before each release. Publish this package before dylaunator, which depends on it.
License
Unlicense (public domain), matching upstream robust-predicates.
Metadata
Release files for pyrobust-predicates 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pyrobust_predicates-0.1.0.tar.gz | 9.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pyrobust_predicates-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 20.5 kB
Release files / pyrobust_predicates-0.1.0.tar.gz
| Download URL | pyrobust_predicates-0.1.0.tar.gz |
|---|---|
| Size | 9.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9e821ab6bc2307e24fd0d455a059fdda528db78b349af45fc728838dae804b80
|
|
BLAKE2b-256 checksum How to use checksums |
bf4fe9580a0481ad0c91e1faac1dcc6f1b59e7def33b4a514ba8f6f6e4fa90e5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.11.14
|
Release files / pyrobust_predicates-0.1.0-py3-none-any.whl
| Download URL | pyrobust_predicates-0.1.0-py3-none-any.whl |
|---|---|
| Size | 11.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
80216aa9c98d8a9a22d5b110fd7227cf569f5b3716f0fa08b3347aad37362a38
|
|
BLAKE2b-256 checksum How to use checksums |
cc0dbae0f0c125216d0c9c50f60bd66f0167935b630f3e87672d67854d8d6cd2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.11.14
|