Skip to main content

pd-code-reverse-component

Reverse the orientation encoding of one selected PD-code component.

Installation

pip install pd-code-reverse-component

Usage example

from pd_code_reverse_component import reverse_component

pd = [[2, 3, 1, 4], [4, 1, 3, 2]]
reversed_pd = reverse_component(pd, 1)
print(reversed_pd)

Algorithm

The selected label identifies its component cycle through predecessor/successor maps. The cycle is placed in canonical order and mapped to its reverse order. Every occurrence of a component label is replaced through that bijection; labels belonging to other components remain unchanged. The operation returns a deep copy and leaves the input untouched.

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

No external software 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_reverse_component-0.1.1.tar.gz (3.0 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_reverse_component-0.1.1-py3-none-any.whl (3.9 kB view details)

Uploaded Python 3

File details

Details for the file pd_code_reverse_component-0.1.1.tar.gz.

File metadata

  • Download URL: pd_code_reverse_component-0.1.1.tar.gz
  • Upload date:
  • Size: 3.0 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_reverse_component-0.1.1.tar.gz
Algorithm Hash digest
SHA256 5431f0683665d6e14c81ab32106d945d3080b56afb57447931a990f2978c1490
MD5 1e1643f87b62b7aeb6ceea7beab0201e
BLAKE2b-256 73ecf53cf5024564741b4a102b9d7e4e51accf357a5d0fd43fcfb72f099c8ed1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pd_code_reverse_component-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d7e6e93839845889571dcb4c247210c6c6797c405f4070161de415348f7befe1
MD5 e89d2938700fdccf19fb1795ae64d3b8
BLAKE2b-256 ead0f3493ac1d41ed07998f75c317a5892b220e82655c3eb6c2effb3b3ff5147

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