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.
Metadata
Release files for pd-code-mirror 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pd_code_mirror-0.1.1.tar.gz | 2.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pd_code_mirror-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 5.4 kB
Release files / pd_code_mirror-0.1.1.tar.gz
| Download URL | pd_code_mirror-0.1.1.tar.gz |
|---|---|
| Size | 2.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2765b3a89d4015dc9fd04f18af61316012ec25bfd35df7b3fe5045f15ee34c17
|
|
BLAKE2b-256 checksum How to use checksums |
219b8e22d9a9c40332b2d0039552937be1e3ca27dfafdfc73be0c7523e9bd9c5
|
| 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_mirror-0.1.1-py3-none-any.whl
| Download URL | pd_code_mirror-0.1.1-py3-none-any.whl |
|---|---|
| Size | 3.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2b53a02efc7439d0bb5e1ba399f88a10c1f63ac2ec019cb4e61cd1455a195536
|
|
BLAKE2b-256 checksum How to use checksums |
95717d099ece23c6d181c28be9f55689bdc9ce010280bce5c8a972f53d056143
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.4.1 CPython/3.11.15 Windows/10
|