pd-code-strong-sanity
Check whether a structurally valid PD code can be realized by the diagram-layout engine.
Installation
pip install pd-code-strong-sanity
Usage example
from pd_code_strong_sanity import sanity
pd = [[1, 5, 2, 4], [3, 1, 4, 6], [5, 3, 6, 2]]
print(sanity(pd))
Algorithm
Strong sanity delegates to the layout engine and returns True only when it can construct a routed planar matrix without inconsistent sockets or crossings. It catches layout failures and exposes a simple boolean API. This is intentionally more expensive than structural sanity and should be used when geometric realizability is required.
Input conventions
A PD code is represented as a list of four-entry crossings. Arc labels normally occur exactly twice. Public functions validate inputs and return new values rather than mutating caller-owned data unless their API explicitly says otherwise.
External software
- A C++17 compiler is required the first time the bundled layout engine is built.
- No display server or GUI is required.
Development
Run examples and package checks before release. Python packages require Python 3.10 or newer. Build PyPI artifacts with:
poetry check
poetry build
License
MIT. See LICENSE.
Metadata
Release files for pd-code-strong-sanity 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 | |
|---|---|---|---|
| pd_code_strong_sanity-0.1.1.tar.gz | 2.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pd_code_strong_sanity-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 5.5 kB
Release files / pd_code_strong_sanity-0.1.1.tar.gz
| Download URL | pd_code_strong_sanity-0.1.1.tar.gz |
|---|---|
| Size | 2.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
beb171f75eb35fe307fa5ff6fe7fa31fbda8024efb777ea05d27a41346f1c3d6
|
|
BLAKE2b-256 checksum How to use checksums |
415239560cdb084cc297b6cccaa175ae41bf362850be1588a14ec99cf2c9847b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.4.1 CPython/3.11.15 Windows/10
|
Release files / pd_code_strong_sanity-0.1.1-py3-none-any.whl
| Download URL | pd_code_strong_sanity-0.1.1-py3-none-any.whl |
|---|---|
| Size | 3.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
71d25fbe7ac351c74ddf1dab1769c7189e359a90f0201aba0455748359d46d20
|
|
BLAKE2b-256 checksum How to use checksums |
69f2c8b4d7933ac98ba87c714c1eeabc30764db14606bc6e2fd673fde67ebbaf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.4.1 CPython/3.11.15 Windows/10
|