Skip to main content

pd-code-rotate

Rotate the local representation of every crossing while respecting component orientation.

Installation

pip install pd-code-rotate

Usage example

from pd_code_rotate import rotate

pd = [[1, 5, 2, 4], [3, 1, 4, 6], [5, 3, 6, 2]]
print(rotate(pd))

Algorithm

Predecessor/successor maps determine the direction of each strand. For crossing [a,b,c,d], the implementation selects either [b,a,d,c] or [d,c,b,a] so the rotated crossing remains consistent with the canonical component direction. Arc incidences and crossing count are preserved.

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_rotate-0.1.1.tar.gz (2.4 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_rotate-0.1.1-py3-none-any.whl (3.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pd_code_rotate-0.1.1.tar.gz
  • Upload date:
  • Size: 2.4 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_rotate-0.1.1.tar.gz
Algorithm Hash digest
SHA256 88679c8333c86cbb9638f43fa1fdf2bfff46d447cf8118dff0760579c822e8df
MD5 926187f7fb5758212c3e318cf5a79198
BLAKE2b-256 5890a0983eab78a487a832545f3ed7a8aecf2b67abdddcdabf79f874bdf08c4e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pd_code_rotate-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 3.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.4.1 CPython/3.11.15 Windows/10

File hashes

Hashes for pd_code_rotate-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7e61aebb03bfb72c64887905dc34e9a384b585a5aaff33e0257e883becc492e3
MD5 3584fd5f27d17b38044d25adc21289a7
BLAKE2b-256 6cacc98426436ae29aea7294c7da91f698901b47b03ab70f99c02071e016f2f8

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