Skip to main content

High-performance polytope backends via Rust FFI bindings to howzat

Project description

howzat (Python)

Python bindings for howzat-cli via PyO3.

Install

From PyPI (once published):

python -m pip install howzat

Build from source (requires a Rust toolchain):

python -m pip install .

Force a local source build (even if wheels exist), and optionally enable 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).

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).

Backend Specs

howzat.Backend(spec) accepts the same backend spec strings as hirsch sandbox bench --backend, except the Python API does not accept the ^ / % prefix markers.

Syntax (high level): [PURIFIER@]KIND[:SPEC]

Common examples:

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

API

  • howzat.solve(vertices) -> SolveResult
    Uses a cached default backend (snap@howzat-dd:f64).
  • howzat.Backend(spec: str | None = None)
    Parses and stores a backend; None selects the cached default backend.
  • Backend.solve(vertices) -> SolveResult
    Runs the backend synchronously, single-threaded on the provided vertex set.

SolveResult

SolveResult contains:

  • 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)

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.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-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-cp313-cp313-macosx_11_0_arm64.whl (3.0 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

howzat-0.2.0-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-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-cp312-cp312-macosx_11_0_arm64.whl (3.0 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

howzat-0.2.0-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-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-cp311-cp311-macosx_11_0_arm64.whl (3.0 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

howzat-0.2.0-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-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-cp310-cp310-macosx_11_0_arm64.whl (3.0 MB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

howzat-0.2.0-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.tar.gz.

File metadata

  • Download URL: howzat-0.2.0.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.tar.gz
Algorithm Hash digest
SHA256 2145581739c5ddd28742bcbd9ef238d5106c75cc4d5fc6928245b7ccf980ae26
MD5 eb47de29bf5c9d78ae19d191639a3130
BLAKE2b-256 5ec834cd209a395a10cee4e2b08938522da2b3fd355ff68ffd2b42397b2cfe3e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for howzat-0.2.0-cp313-cp313-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 c4dc384dd51da62bd60194fd28450c1ccf62b93e15b13a8b0d860b83f7909f50
MD5 4acd880bc1808b5751cbac8a9b672d53
BLAKE2b-256 8f00033ba68d3899633ad22b9db88b935a6d7ac500e15cbed913c50ccc1215c2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for howzat-0.2.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 65ac9f150f2bf3a89ef0dedfea02c0a8f5dcb632cfb2ccf6c760768a9a95838c
MD5 64458df98cc520a7a5ce4267e9c5ffae
BLAKE2b-256 d55dac4e5270672274872cdac18b0fc7583e161c79016a7ac3a1c925d7201ee3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for howzat-0.2.0-cp313-cp313-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 0d0b65172df61089ff62d1914338c982a7b732b3912bf152b64f6caad7dd8f5b
MD5 52341287f741f1e0c88e0f7c465da7f9
BLAKE2b-256 d958555216714f0072eec11bd1880dc3bffb8220f2aa0c8a270607a35462eb20

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for howzat-0.2.0-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 bf5f4192dfb2fbd2278ecdeaa5263cfca99ddfcc660963ae816927fd39f1a0f4
MD5 ffba540ba82f1eeb7e760e51782e40a3
BLAKE2b-256 b6619814f263cde1fbcf300fefd414ac037d7e69115462c0b5a583469d42df4d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for howzat-0.2.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 8ebeb64a0ae0afd7d8bac66299e628cc9fe6748c3dc5a456fa4cd9dd3445a6a8
MD5 dc83fb36b3fcdf69ad09e47ead8c7397
BLAKE2b-256 5c6f7eb6633a2c6703b53c21009a4d29338f78460aa82853b88317e8a4c892e8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for howzat-0.2.0-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 9290fcf0dad38da8e65a830870cf417a0a3dab4e554096a5083e9e713ecefbdb
MD5 1c56e5442337aa008b3402a772b1864a
BLAKE2b-256 d479366c54a61c8d287a25880c0c1d51656f10b44ff01f65d5f6056e0d61cc79

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for howzat-0.2.0-cp311-cp311-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 5f7d8520a8f30526fecd6fdc95fe9721d093e2884e7b3b7901257822a88e39b7
MD5 4543c13fccdbc0019ba8e0ecc46ab244
BLAKE2b-256 08858b5061e6f0c24814f522caaaad8e0b6f4b6b12cec06cef7b97bb5b71a1d4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for howzat-0.2.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 eec213fb3161420ba7cb1e650e7799c17853e1ac82d9fee95eb4bfd083c2b379
MD5 edf82ee2b3971fe38d791727efecc950
BLAKE2b-256 5842fd602c7f7a5daed6532f0345d98586e11b5d27ca8c9f4132e9ac36d56d0c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for howzat-0.2.0-cp311-cp311-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 ff66f844fea5f10461bda412380b774d9f5a0bbd8d627845e9cd1a81b5264872
MD5 0d3307f137b90d1a27fbadfabc68d357
BLAKE2b-256 99fae03221a76b9ce3048663182b7965538d99aa26c2e5bd3476ec445a11bb71

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for howzat-0.2.0-cp310-cp310-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 f53f18ed178bf2fffde90dbaa1b2825e50754cc826a13edcc8f65540ab85f9bc
MD5 29e5d2bfdffde44ab08e973faf620e73
BLAKE2b-256 410255cf4a600d77db4190a98c3d218540eac6bf5ae45a41d0f16c854c971a77

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for howzat-0.2.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 0669bf1b2e7d63b138e7aee529973957278791ef247256c747fddb3ac09802ed
MD5 b23544fa4c06a02af145df6605ef69fc
BLAKE2b-256 c0190e5b2bb084999adc38843b1214cf826724447ed9f63b281005b39d4e56c9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for howzat-0.2.0-cp310-cp310-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 40ce742d6524bc64ff357d9443020986074489930658d64f7e2754052ac17b11
MD5 da318ef930304774c32282a4aa3e1a46
BLAKE2b-256 b37cdbae4aaca1be9d20e6649131380e53d4a418963831a73882245e4e55a77d

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