Skip to main content

Fast HEALPix center-in-polygon coverage for convex spherical polygons.

Project description

Polypix

Fast HEALPix center-in-polygon coverage for convex spherical polygons.

Polypix takes one polygon or a batch of polygons on the unit sphere and returns the HEALPix cells whose centers fall inside each polygon. It is meant for throughput-oriented workloads where the input is already a valid convex spherical polygon.

import numpy as np
import polypix as px

polygon = np.array(
    [
        [-5.0, -5.0],
        [12.0, -4.0],
        [10.0, 9.0],
        [-6.0, 7.0],
    ],
    dtype=np.float64,
)

cell_ids = px.cover(px.Polygon.from_lonlat(polygon), resolution=8)
centers = px.center(cell_ids)

The returned cell IDs are packed uint64 tokens that include both the HEALPix resolution and the NESTED pixel index. Treat them as opaque IDs; use center() or boundary() when you need longitude/latitude geometry.

Scope

Polypix supports:

  • convex spherical polygons with great-circle edges,
  • longitude/latitude vertices in degrees,
  • unit-vector vertices as (x, y, z),
  • dense and ragged polygon batches.

Polypix does not support holes, non-convex polygons, planar geometry semantics, or conservative overlap coverage. A cell is included only when its center is inside the polygon.

Install

Polypix supports Python 3.12 and newer on Linux x86_64 and macOS 11 or newer on Intel and Apple Silicon:

python -m pip install polypix

Windows wheels are not enabled yet because healpix_cxx is not currently available as a conda-forge win-64 package.

Development

Polypix uses Pixi for the supported development environments:

  • Linux x86_64
  • macOS 11 or newer on Intel
  • macOS 11 or newer on Apple Silicon

Install Pixi, then run:

pixi run test

That command creates a conda-forge based environment with Python, NumPy, CMake, nanobind, and healpix_cxx, installs Polypix in editable mode without build isolation, and runs the test suite.

To build a local wheel:

pixi run wheel

The local wheel bundles runtime libraries from the active build environment for smoke testing. Publishable wheels are built by the release workflow with cibuildwheel and repaired with the platform wheel repair tools.

Build the documentation site with Zensical:

pixi run docs-build

Preview the documentation while editing:

pixi run docs-serve

License

Polypix is distributed under GPL-3.0-or-later. This reflects the binary distribution relationship with HEALPix C++, which is GPL-2.0-or-later. See THIRD_PARTY_NOTICES.md for native dependency notices.

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

polypix-0.1.0.tar.gz (111.7 kB view details)

Uploaded Source

Built Distributions

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

polypix-0.1.0-cp314-cp314-manylinux_2_34_x86_64.whl (6.9 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.34+ x86-64

polypix-0.1.0-cp314-cp314-macosx_11_0_x86_64.whl (6.2 MB view details)

Uploaded CPython 3.14macOS 11.0+ x86-64

polypix-0.1.0-cp314-cp314-macosx_11_0_arm64.whl (5.9 MB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

polypix-0.1.0-cp313-cp313-manylinux_2_34_x86_64.whl (6.9 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.34+ x86-64

polypix-0.1.0-cp313-cp313-macosx_11_0_x86_64.whl (6.2 MB view details)

Uploaded CPython 3.13macOS 11.0+ x86-64

polypix-0.1.0-cp313-cp313-macosx_11_0_arm64.whl (5.9 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

polypix-0.1.0-cp312-cp312-manylinux_2_34_x86_64.whl (6.9 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.34+ x86-64

polypix-0.1.0-cp312-cp312-macosx_11_0_x86_64.whl (6.2 MB view details)

Uploaded CPython 3.12macOS 11.0+ x86-64

polypix-0.1.0-cp312-cp312-macosx_11_0_arm64.whl (5.9 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

File details

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

File metadata

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

File hashes

Hashes for polypix-0.1.0.tar.gz
Algorithm Hash digest
SHA256 ba93617275be81958e25598f6678fd739ab98beafa74022dd231637b8c776082
MD5 fca415bd899c3e1839b4e18f51bdf1ed
BLAKE2b-256 eb2a737e80db77e168ce27568235d00ffe56288e91795ba7a3c92282be00a161

See more details on using hashes here.

Provenance

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

Publisher: release.yml on JochimMaene/polypix

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

File details

Details for the file polypix-0.1.0-cp314-cp314-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for polypix-0.1.0-cp314-cp314-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 9dd4fce0e4c38d4d59cd1f6e4027039b4fa48e396cfd00fa686dde7250a8ae7c
MD5 c9ff70e64a17d2f2b48429c23e52dc60
BLAKE2b-256 64026044b51d2c5cce6cff36aaf4172384abf0d9ed0449d1633fe8d0a05b6dd6

See more details on using hashes here.

Provenance

The following attestation bundles were made for polypix-0.1.0-cp314-cp314-manylinux_2_34_x86_64.whl:

Publisher: release.yml on JochimMaene/polypix

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

File details

Details for the file polypix-0.1.0-cp314-cp314-macosx_11_0_x86_64.whl.

File metadata

File hashes

Hashes for polypix-0.1.0-cp314-cp314-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 e88728108dc6190d606392406d3ac4e8af3141bedcbd48059d7b826f0767e9be
MD5 808a0b30de830153abf478f262eeec8c
BLAKE2b-256 f13750499bf36a879ae5a1b65ae58e89a40739e919a928dc15235a0bf0ddcf74

See more details on using hashes here.

Provenance

The following attestation bundles were made for polypix-0.1.0-cp314-cp314-macosx_11_0_x86_64.whl:

Publisher: release.yml on JochimMaene/polypix

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

File details

Details for the file polypix-0.1.0-cp314-cp314-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for polypix-0.1.0-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 af2be68153d0d30518dfc945d53337d1100e357458db9f45d183d2a48ef2166d
MD5 2291205d5afbae5bd1676427feafabb6
BLAKE2b-256 2a4092a1ebe272f6937c9da9b90e57b3503e6a52d3603b51df24b8f82d2ca18b

See more details on using hashes here.

Provenance

The following attestation bundles were made for polypix-0.1.0-cp314-cp314-macosx_11_0_arm64.whl:

Publisher: release.yml on JochimMaene/polypix

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

File details

Details for the file polypix-0.1.0-cp313-cp313-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for polypix-0.1.0-cp313-cp313-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 f232dd64245edd0071bcef4afbf06d7a3168e1bedabe3e37278f5deee61c1c00
MD5 0521d0aef0ac8b53150ca29a9006c962
BLAKE2b-256 8158558b69580b01c77a08bab2a1e00f279514cd88bc04876d993cea06aa58c1

See more details on using hashes here.

Provenance

The following attestation bundles were made for polypix-0.1.0-cp313-cp313-manylinux_2_34_x86_64.whl:

Publisher: release.yml on JochimMaene/polypix

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

File details

Details for the file polypix-0.1.0-cp313-cp313-macosx_11_0_x86_64.whl.

File metadata

File hashes

Hashes for polypix-0.1.0-cp313-cp313-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 68884789c39d8ef453ab0a86c8cf7125466a4d44397cbb5222e7f389a8ff6ef1
MD5 3c522a8fb1d73b838e915627b0fd4550
BLAKE2b-256 ce107cad381b59941d46e7f7da1209a984adc4fd16e2996da1e1130112dd50f3

See more details on using hashes here.

Provenance

The following attestation bundles were made for polypix-0.1.0-cp313-cp313-macosx_11_0_x86_64.whl:

Publisher: release.yml on JochimMaene/polypix

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

File details

Details for the file polypix-0.1.0-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for polypix-0.1.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 075f3e49ca9dbf8033722ac25768d19d791d0ad687ab84bec40af47d57cd4634
MD5 5d7ec160209b665e561a35a4166dec65
BLAKE2b-256 a60c0be6401f538e1d1b5af93babf688c79657e22b76ab7e662233d6dc923847

See more details on using hashes here.

Provenance

The following attestation bundles were made for polypix-0.1.0-cp313-cp313-macosx_11_0_arm64.whl:

Publisher: release.yml on JochimMaene/polypix

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

File details

Details for the file polypix-0.1.0-cp312-cp312-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for polypix-0.1.0-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 e3aa421fb9cc9965ef2fa83e7091bb7a58a3d25cac77f55420b6f3c8c7906c2c
MD5 1fb8c6138d76190d7d9fe964f1214561
BLAKE2b-256 5f951655f29b1c4dd7e40361448134ec81c215404a0950e2e93321053595f96c

See more details on using hashes here.

Provenance

The following attestation bundles were made for polypix-0.1.0-cp312-cp312-manylinux_2_34_x86_64.whl:

Publisher: release.yml on JochimMaene/polypix

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

File details

Details for the file polypix-0.1.0-cp312-cp312-macosx_11_0_x86_64.whl.

File metadata

File hashes

Hashes for polypix-0.1.0-cp312-cp312-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 583279eff158dafc7c1f135d950f73ecdf87798609ec2b18cc904126e685cbfa
MD5 36878ee3d48c2f725065c45b4f8cc83c
BLAKE2b-256 4ba04846fe2a9c0a00bbd70ffccb579e1750609d8a440589e67144195cc5ba39

See more details on using hashes here.

Provenance

The following attestation bundles were made for polypix-0.1.0-cp312-cp312-macosx_11_0_x86_64.whl:

Publisher: release.yml on JochimMaene/polypix

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

File details

Details for the file polypix-0.1.0-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for polypix-0.1.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 aaea4d0cdc810f28a1db28a8c64a0e77218e395b64790225efe55f616b760927
MD5 8b08c4658921ca1037bf27b17b1e893b
BLAKE2b-256 235a716202c5dfbaf756f0e419a277c3020734059d1e3bd6a6b573a74db32295

See more details on using hashes here.

Provenance

The following attestation bundles were made for polypix-0.1.0-cp312-cp312-macosx_11_0_arm64.whl:

Publisher: release.yml on JochimMaene/polypix

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