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
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_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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
88679c8333c86cbb9638f43fa1fdf2bfff46d447cf8118dff0760579c822e8df
|
|
| MD5 |
926187f7fb5758212c3e318cf5a79198
|
|
| BLAKE2b-256 |
5890a0983eab78a487a832545f3ed7a8aecf2b67abdddcdabf79f874bdf08c4e
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7e61aebb03bfb72c64887905dc34e9a384b585a5aaff33e0257e883becc492e3
|
|
| MD5 |
3584fd5f27d17b38044d25adc21289a7
|
|
| BLAKE2b-256 |
6cacc98426436ae29aea7294c7da91f698901b47b03ab70f99c02071e016f2f8
|