pd-code-mirror
Construct the mirror image of a knot or link represented by a PD code.
Installation
pip install pd-code-mirror
Usage example
from pd_code_mirror import mirror_pd_code
pd = [[1, 5, 2, 4], [3, 1, 4, 6], [5, 3, 6, 2]]
print(mirror_pd_code(pd))
Algorithm
Mirroring reverses the cyclic crossing order while keeping the first slot fixed: [a,b,c,d] becomes [a,d,c,b]. This switches over/under crossing information without changing arc incidences. The input and output are structurally validated, and the caller's list is not mutated.
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_mirror-0.1.1.tar.gz.
File metadata
- Download URL: pd_code_mirror-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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2765b3a89d4015dc9fd04f18af61316012ec25bfd35df7b3fe5045f15ee34c17
|
|
| MD5 |
b64dff312461ed83095e4624913703f2
|
|
| BLAKE2b-256 |
219b8e22d9a9c40332b2d0039552937be1e3ca27dfafdfc73be0c7523e9bd9c5
|
File details
Details for the file pd_code_mirror-0.1.1-py3-none-any.whl.
File metadata
- Download URL: pd_code_mirror-0.1.1-py3-none-any.whl
- Upload date:
- Size: 3.1 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 |
2b53a02efc7439d0bb5e1ba399f88a10c1f63ac2ec019cb4e61cd1455a195536
|
|
| MD5 |
7c1f5dc54325a0486fceab3dce9de45d
|
|
| BLAKE2b-256 |
95717d099ece23c6d181c28be9f55689bdc9ce010280bce5c8a972f53d056143
|