Skip to main content

High-performance polytope backends via Rust FFI bindings to howzat

Project description

howzat

User-friendly Python bindings for the Rust crate howzat via PyO3.

Usage

import numpy as np
import howzat

verts = np.asarray([[0.0, 0.0], [1.0, 0.0], [0.0, 1.0]], dtype=np.float64)

res = howzat.solve(verts)  # cached default backend: "snap@howzat-dd:f64"
# res = howzat.Backend().solve(verts)  # same as above
# res = howzat.Backend("howzat-lrs:rug").solve(verts)  # explicit backend

print(res.facets, res.ridges)
print(res.facet_adjacency)

Input vertices must be a contiguous (C-order) numpy.ndarray of float64 with shape (n, d).

Backends

The class howzat.Backend(spec) accepts backend spec strings, which specify the algorithm and parameters of the computation pipeline.

At a high level, the syntax is: [PURIFIER@]KIND[:SPEC]. Some examples:

  • snap@howzat-dd:f64 (default)
  • howzat-dd:f64
  • howzat-dd:f64[eps[1e-12],max]-resolve[rugrat]
  • cddlib:gmprational
  • cddlib+hlbl:f64
  • lrslib+hlbl (defaults to lrslib+hlbl:gmpint)

FIXME: give a complete enumeration of the options and modes.

API

  • howzat.solve(vertices) -> SolveResult Convenience function which uses the default backend (snap@howzat-dd:f64).
  • howzat.Backend(spec: str | None = None) Loads the specified backend; None selects the default.
  • Backend.solve(vertices) -> SolveResult Runs the backend synchronously, single-threaded on the provided vertex set, returning a SolveResult.

SolveResult

A SolveResult has the fields:

  • spec: str backend spec actually used
  • dimension: int ambient dimension d
  • vertices: int number of vertices n
  • facets: int number of facets
  • ridges: int number of ridges (edges in the facet adjacency / FR graph)
  • total_seconds: float time spent inside the backend (seconds)
  • vertex_positions: list[list[float]] | None vertex coordinates if the backend returned baseline geometry
  • vertex_adjacency: list[list[int]] vertex adjacency lists (length vertices)
  • facets_to_vertices: list[list[int]] for each facet, the incident vertex indices
  • facet_adjacency: list[list[int]] facet adjacency lists (FR graph)
  • fails: int backend-specific failure count (pipeline dependent)
  • fallbacks: int backend-specific fallback count (pipeline dependent)

Install

From PyPI:

python -m pip install howzat

Force a local source build, and enabling CPU-native codegen:

RUSTFLAGS="-C target-cpu=native" python -m pip install --no-binary howzat howzat

Prebuilt wheels are compiled for a portable baseline CPU (not target-cpu=native).

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

howzat-0.2.0.post1.tar.gz (13.6 MB view details)

Uploaded Source

Built Distributions

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

howzat-0.2.0.post1-cp313-cp313-manylinux_2_34_x86_64.whl (4.3 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.34+ x86-64

howzat-0.2.0.post1-cp313-cp313-macosx_11_0_arm64.whl (3.0 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

howzat-0.2.0.post1-cp313-cp313-macosx_10_12_x86_64.whl (4.0 MB view details)

Uploaded CPython 3.13macOS 10.12+ x86-64

howzat-0.2.0.post1-cp312-cp312-manylinux_2_34_x86_64.whl (4.3 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.34+ x86-64

howzat-0.2.0.post1-cp312-cp312-macosx_11_0_arm64.whl (3.0 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

howzat-0.2.0.post1-cp312-cp312-macosx_10_12_x86_64.whl (4.0 MB view details)

Uploaded CPython 3.12macOS 10.12+ x86-64

howzat-0.2.0.post1-cp311-cp311-manylinux_2_34_x86_64.whl (4.3 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.34+ x86-64

howzat-0.2.0.post1-cp311-cp311-macosx_11_0_arm64.whl (3.0 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

howzat-0.2.0.post1-cp311-cp311-macosx_10_12_x86_64.whl (4.0 MB view details)

Uploaded CPython 3.11macOS 10.12+ x86-64

howzat-0.2.0.post1-cp310-cp310-manylinux_2_34_x86_64.whl (4.3 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.34+ x86-64

howzat-0.2.0.post1-cp310-cp310-macosx_11_0_arm64.whl (3.0 MB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

howzat-0.2.0.post1-cp310-cp310-macosx_10_12_x86_64.whl (4.0 MB view details)

Uploaded CPython 3.10macOS 10.12+ x86-64

File details

Details for the file howzat-0.2.0.post1.tar.gz.

File metadata

  • Download URL: howzat-0.2.0.post1.tar.gz
  • Upload date:
  • Size: 13.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for howzat-0.2.0.post1.tar.gz
Algorithm Hash digest
SHA256 218fd79b4a4d6bb36cd74281abc197aaea0d642ad08334c25577964f614981c7
MD5 ec233405cb5f466335ebbeaee0ba4b74
BLAKE2b-256 219e7158def919365f8c0925492d41e9b60bd85a92e8487443783c1f8bf1e28b

See more details on using hashes here.

File details

Details for the file howzat-0.2.0.post1-cp313-cp313-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for howzat-0.2.0.post1-cp313-cp313-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 c28cc30d5a921cd4a81754340d2cdee710b940abe98608237e2b768274bf8fcc
MD5 903c728fa3c4c6b9d7b14ec56922e05b
BLAKE2b-256 1c6b4ff54f6002516628ed6ff76dc117eaa9464e992f5c7b9953db2df458ea8e

See more details on using hashes here.

File details

Details for the file howzat-0.2.0.post1-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for howzat-0.2.0.post1-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 1aceb76b64e212bb79a7bd8cb21eeb3f21bb687a336b37fd5676bd2203225fa1
MD5 013ff1102d7fd685f01622d39534cafe
BLAKE2b-256 ef2f9b30c8c26735214b7f3bdcbca074e73266c68b234820ffc5250744282b8f

See more details on using hashes here.

File details

Details for the file howzat-0.2.0.post1-cp313-cp313-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for howzat-0.2.0.post1-cp313-cp313-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 b7cabe49f90cdccefc6b9a22f2bec5aecc2a47659ba4dc44916bd89a1f28526a
MD5 f10859f5796b7041f45f3f73fde38532
BLAKE2b-256 dd1df9fbfe1c5079a4d787286d8bef3782360f6bf4d53e44f487f2e35bc1d29c

See more details on using hashes here.

File details

Details for the file howzat-0.2.0.post1-cp312-cp312-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for howzat-0.2.0.post1-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 d7a95b5cbc566eee86bacf1e0b1485acd273f4a49938182fb543754056bf3c17
MD5 e89417a8efcb6ad3fa4635529e6da155
BLAKE2b-256 2fd47ffa3a7f3cafaef895ebd6f860377bfa8f66affe7dbf803f051aab44b0bc

See more details on using hashes here.

File details

Details for the file howzat-0.2.0.post1-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for howzat-0.2.0.post1-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 96a6ec1d3cfbc57221050db1b6bf120e819e5dfc2e02372d44ec39d937c212dc
MD5 ef05f02e01b015624b5f3e9f5f1e7e43
BLAKE2b-256 47250570faf2b5696ce76e5e69864b4c55231b06eccec690b594f87fb04d3f60

See more details on using hashes here.

File details

Details for the file howzat-0.2.0.post1-cp312-cp312-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for howzat-0.2.0.post1-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 aee8386fd64dbdf9a6f7cdf7ce5410d13c7329642b83faf064c88ad952539c6d
MD5 ee86bd5de12fff2d6562d4b8813e92c9
BLAKE2b-256 58d5e018fd7136e7f707efd297a1950768c8de70f7e2085991c8bf317966f78a

See more details on using hashes here.

File details

Details for the file howzat-0.2.0.post1-cp311-cp311-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for howzat-0.2.0.post1-cp311-cp311-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 24aef53fe0329bedb2eaedde63cd2814fff21deb6ef755c4090a2bda294bd1e7
MD5 763fc658f0728ac7dda76b1728d61095
BLAKE2b-256 1e0e9afbd30123cbdd68f159b23bb06fc6e7400a3acbd97a065473691fc857f3

See more details on using hashes here.

File details

Details for the file howzat-0.2.0.post1-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for howzat-0.2.0.post1-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e093985c9d14e5789dbf50d6dd0a7aea8d318bedb1e8b04e19d0d55f695b0d8f
MD5 ed901ee7b22b41ffaaac28860c162c54
BLAKE2b-256 43ede1a209dbfe68bcb85ce4bb01e3f75e8623533ee68631fd5aff64823dcc93

See more details on using hashes here.

File details

Details for the file howzat-0.2.0.post1-cp311-cp311-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for howzat-0.2.0.post1-cp311-cp311-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 9be3b66eb4a38f6496ae757b6b47f918f85838190ba7b7f84ddc808b93de5dba
MD5 abc9189f3ee6045ba5c74cff55394d84
BLAKE2b-256 f9522905a9e46b0325cfde64433aa33886dd4eea09f53a4f80cb911fab38c27a

See more details on using hashes here.

File details

Details for the file howzat-0.2.0.post1-cp310-cp310-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for howzat-0.2.0.post1-cp310-cp310-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 213ed4851cc8c88156a15a9e4290479fdaa4ce24312586c0d1a3b656b4b5a5b1
MD5 b5574797f6ab2090eb007311c51383e8
BLAKE2b-256 21002efc3378dff48bfabe1ee7873dfe333d1660b7a32c7e8b949c18c3bfde87

See more details on using hashes here.

File details

Details for the file howzat-0.2.0.post1-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for howzat-0.2.0.post1-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 800645093f5f2033aec488b02d9fb80a7a1e2b0a7a2cc298b1793b296c036f05
MD5 3fef79a6d8e778f1f79db764199e4efb
BLAKE2b-256 1c7d2b5d3b8fd887f7fdf80bdd2a6f8218fb0303b3a928d5e97842565411e036

See more details on using hashes here.

File details

Details for the file howzat-0.2.0.post1-cp310-cp310-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for howzat-0.2.0.post1-cp310-cp310-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 26b869243a1dadbc653d48b4ea4565014f69524c252de22bd7921d0496737e13
MD5 a533e9b8fe36358468f16477ffb91af5
BLAKE2b-256 bd643a5a0a530de69dcbe3ce16de11558503e24ffa4d0e03b1bb6a82bdcbd1d1

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