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.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pd_code_strong_sanity-0.1.1.tar.gz.
File metadata
- Download URL: pd_code_strong_sanity-0.1.1.tar.gz
- Upload date:
- Size: 2.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.4.1 CPython/3.11.15 Windows/10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
beb171f75eb35fe307fa5ff6fe7fa31fbda8024efb777ea05d27a41346f1c3d6
|
|
| MD5 |
87d60309204422df79ea4fe8cb493169
|
|
| BLAKE2b-256 |
415239560cdb084cc297b6cccaa175ae41bf362850be1588a14ec99cf2c9847b
|
File details
Details for the file pd_code_strong_sanity-0.1.1-py3-none-any.whl.
File metadata
- Download URL: pd_code_strong_sanity-0.1.1-py3-none-any.whl
- Upload date:
- Size: 3.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.4.1 CPython/3.11.15 Windows/10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
71d25fbe7ac351c74ddf1dab1769c7189e359a90f0201aba0455748359d46d20
|
|
| MD5 |
5cebe15853a760662c216a4ab256ce1e
|
|
| BLAKE2b-256 |
69f2c8b4d7933ac98ba87c714c1eeabc30764db14606bc6e2fd673fde67ebbaf
|