Skip to main content

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

pd_code_strong_sanity-0.1.1.tar.gz (2.3 kB view details)

Uploaded Source

Built Distribution

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

pd_code_strong_sanity-0.1.1-py3-none-any.whl (3.2 kB view details)

Uploaded Python 3

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

Hashes for pd_code_strong_sanity-0.1.1.tar.gz
Algorithm Hash digest
SHA256 beb171f75eb35fe307fa5ff6fe7fa31fbda8024efb777ea05d27a41346f1c3d6
MD5 87d60309204422df79ea4fe8cb493169
BLAKE2b-256 415239560cdb084cc297b6cccaa175ae41bf362850be1588a14ec99cf2c9847b

See more details on using hashes here.

File details

Details for the file pd_code_strong_sanity-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for pd_code_strong_sanity-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 71d25fbe7ac351c74ddf1dab1769c7189e359a90f0201aba0455748359d46d20
MD5 5cebe15853a760662c216a4ab256ce1e
BLAKE2b-256 69f2c8b4d7933ac98ba87c714c1eeabc30764db14606bc6e2fd673fde67ebbaf

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 Sentry Error logging StatusPage Status page