polylabel-pyo3
polylabel-pyo3 lets you calculate the pole of inaccessibility in Python. It's a pyo3 wrapper of polylabel-rs.
Install
pip install polylabel-pyo3
Use
from polylabel_pyo3 import polylabel_ext, polylabel_ext_np
# define an open L-shape
L = [(0,0),(1,0),(1,1),(2,1),(2,2),(0,2)]
polylabel_ext(L, 1.0)
# (0.5, 0.5)
# A version for numpy.ndarray only is slightly faster
import numpy as np
polylabel_ext_np(np.array(L, dtype=np.float), 1.0)
# (0.5, 0.5)
# Note that the optional polylabel center for an L-shape
# is in between its mean of exterior vertices and origin
np.mean(L, axis=0)
# array([1., 1.])
GUI Example
pip install -r examples/requirements.txt
python examples/polylabel_gui.py
Drag your shape with the mouse and observe a momentum based center in grey and polylabel center in green:
Develop
Requirements:
- Rust Toolchain
- Python >=3.7
In a venv or conda env:
pip install maturin -r requirements.txt
pre-commit install
Test
maturin develop
pytest -v
Benchmark
maturin develop --release
pyest benchmark
Metadata
Release files for polylabel-pyo3 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| polylabel_pyo3-0.1.1.tar.gz | 37.5 kB | Without provenance | Details for polylabel_pyo3-0.1.1.tar.gz |
Built distributions (wheels)
Total release size: 3.3 MB
Release files / polylabel_pyo3-0.1.1.tar.gz
| Download URL | polylabel_pyo3-0.1.1.tar.gz |
|---|---|
| Size | 37.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
06cc915b364665825bf641e9de93c99cfe336bcf85b133d01da1f500dceb2d58
|
|
BLAKE2b-256 checksum How to use checksums |
94ecedf43ad089dc35caf2d65272e32dff8174498740dafe309e2ca05946697d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/0.12.6
|
Release files / polylabel_pyo3-0.1.1-cp310-none-win_amd64.whl
| Download URL | polylabel_pyo3-0.1.1-cp310-none-win_amd64.whl |
|---|---|
| Size | 123.8 kB |
| Tags | CPython 3.10 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
823f0f995e6637c9261437701d8e97f6bc3485b5a4ace37f0dd897b26b4842c1
|
|
BLAKE2b-256 checksum How to use checksums |
dbc1362d5c472537d3c183a4dfa50559212951888583ea4d7ffa0c0178d72737
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/0.12.6
|
Release files / polylabel_pyo3-0.1.1-cp310-cp310-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
| Download URL | polylabel_pyo3-0.1.1-cp310-cp310-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl |
|---|---|
| Size | 445.6 kB |
| Tags | CPython 3.10 macOS 10.9+ universal2 (ARM64, x86-64) macOS 10.9+ x86-64 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
7caba01e1b042f964259c2df6b3da1565aef2c4a7e51597bae2e96d0ab2767b3
|
|
BLAKE2b-256 checksum How to use checksums |
79718e4cba1573d57d64e7e70190e08a8ee3fdba3d058af8da6a5e4cc8e843bc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/0.12.6
|
Release files / polylabel_pyo3-0.1.1-cp39-none-win_amd64.whl
| Download URL | polylabel_pyo3-0.1.1-cp39-none-win_amd64.whl |
|---|---|
| Size | 123.8 kB |
| Tags | CPython 3.9 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
8c2eab4ec06f60b76af81d8b61468034d2fbd24d23e20cf14dbe353a2c83eec7
|
|
BLAKE2b-256 checksum How to use checksums |
68ef7223a689273e16e6bf9abd7c838820f8ed09c188baa84574798f47491089
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/0.12.6
|
Release files / polylabel_pyo3-0.1.1-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl
| Download URL | polylabel_pyo3-0.1.1-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl |
|---|---|
| Size | 950.3 kB |
| Tags | CPython 3.9 Linux glibc 2.5+ x86-64 |
|
SHA-256 checksum How to use checksums |
feb37c619069de865fc4a4b0dd29bd108cb897028aeab4d484a1ee398decb1bd
|
|
BLAKE2b-256 checksum How to use checksums |
c278c4889c7c6a45d6c6e2b2436dc87e73aad69faeac271d923a0a29a893af36
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/0.12.6
|
Release files / polylabel_pyo3-0.1.1-cp39-cp39-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
| Download URL | polylabel_pyo3-0.1.1-cp39-cp39-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl |
|---|---|
| Size | 445.6 kB |
| Tags | CPython 3.9 macOS 10.9+ universal2 (ARM64, x86-64) macOS 10.9+ x86-64 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
b8616d0d451d395751cc4c6bd7efc49d1e6f269c7328d6e34876f0bf9e145701
|
|
BLAKE2b-256 checksum How to use checksums |
3e4c4460297a09290855cfcc6a8c74b13c618615c141e465be1e480d3c96dfca
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/0.12.6
|
Release files / polylabel_pyo3-0.1.1-cp38-none-win_amd64.whl
| Download URL | polylabel_pyo3-0.1.1-cp38-none-win_amd64.whl |
|---|---|
| Size | 123.9 kB |
| Tags | CPython 3.8 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
065ab19b50ffba2ed868a7ba3b502b8f01f19bd2ce0a36635a280b4d65b509fd
|
|
BLAKE2b-256 checksum How to use checksums |
cf8dcf0eb6897b4f341712f4c0e1ba932a4039ad74a2a666d267d1af38d8b2e9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/0.12.6
|
Release files / polylabel_pyo3-0.1.1-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
| Download URL | polylabel_pyo3-0.1.1-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl |
|---|---|
| Size | 445.3 kB |
| Tags | CPython 3.8 macOS 10.9+ universal2 (ARM64, x86-64) macOS 10.9+ x86-64 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
0cec781a0a9da0c9643773ffe15e91c0c12142da3212785bd0fbce42f82add2c
|
|
BLAKE2b-256 checksum How to use checksums |
29e093a66bab6d9ee8bdd69951337652d6f9829ce29d690d3a910b4ecf9f3ea5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/0.12.6
|
Release files / polylabel_pyo3-0.1.1-cp37-none-win_amd64.whl
| Download URL | polylabel_pyo3-0.1.1-cp37-none-win_amd64.whl |
|---|---|
| Size | 123.9 kB |
| Tags | CPython 3.7 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
dfa4cfe5dac4f53c27ccae26fbcfecd4a72233668593094490352bfa14371b87
|
|
BLAKE2b-256 checksum How to use checksums |
8f957cc89e5c3d66de6b0f9c639e73e0fbdcbb7df57c53c8932044a7170df6ff
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/0.12.6
|
Release files / polylabel_pyo3-0.1.1-cp37-cp37m-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
| Download URL | polylabel_pyo3-0.1.1-cp37-cp37m-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl |
|---|---|
| Size | 445.3 kB |
| Tags | CPython 3.7 CPython 3.7 pymalloc macOS 10.9+ universal2 (ARM64, x86-64) macOS 10.9+ x86-64 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
55f00ac6ef3d8e8bece37223c4c8bce7466943a0acb17dce20bc86280ebcf530
|
|
BLAKE2b-256 checksum How to use checksums |
7a2d9f2f939facbd9e1ad15011dfa3174c968cae21b1eb9def420cb8f31bb400
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/0.12.6
|
Security for polylabel-pyo3 0.1.1
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.