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.

Metadata

Release files for pd-code-rotate 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pd-code-rotate 0.1.1
File Size Uploaded
pd_code_rotate-0.1.1.tar.gz 2.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pd-code-rotate 0.1.1
File Interpreter ABI Platform
pd_code_rotate-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 5.7 kB

Release files / pd_code_rotate-0.1.1.tar.gz

Download URL pd_code_rotate-0.1.1.tar.gz
Size 2.4 kB
Tags Source
SHA-256 checksum
How to use checksums
88679c8333c86cbb9638f43fa1fdf2bfff46d447cf8118dff0760579c822e8df
BLAKE2b-256 checksum
How to use checksums
5890a0983eab78a487a832545f3ed7a8aecf2b67abdddcdabf79f874bdf08c4e
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_rotate-0.1.1-py3-none-any.whl

Download URL pd_code_rotate-0.1.1-py3-none-any.whl
Size 3.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7e61aebb03bfb72c64887905dc34e9a384b585a5aaff33e0257e883becc492e3
BLAKE2b-256 checksum
How to use checksums
6cacc98426436ae29aea7294c7da91f698901b47b03ab70f99c02071e016f2f8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.4.1 CPython/3.11.15 Windows/10

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page