Skip to main content

calculate 2d-diagram from pd_code.

Project description

pd_code_to_diagram

given a pd_code for a topological link or knot, output a possible 2d-diagram.

Install

pip install pd-code-to-diagram

Usage

import pd_code_to_diagram

# pd_code is a list of list of int
pd_code = [[6, 1, 7, 2], [14, 7, 15, 8], [4, 15, 1, 16], [10, 6, 11, 5], [8, 4, 9, 3], [18, 11, 19, 12], [20, 17, 5, 18], [12, 19, 13, 20], [16, 10, 17, 9], [2, 14, 3, 13]]

# last_socket should be int or None
#   the program will ensure in the components contains last_socket
#   there will be at least one arc on the border of 
last_socket = 1

# diagram_2d will be a matrix of int
#   its type will be list of list of int
#   get_diagram_from_pd_code will raise an RuntimeError if such diagram not exists
diagram_2d = pd_code_to_diagram.get_diagram_from_pd_code(pd_code, last_socket)
for line in diagram_2d:
    print(line)

Project details


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_to_diagram-0.0.1.tar.gz (41.8 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_to_diagram-0.0.1-py3-none-any.whl (69.5 kB view details)

Uploaded Python 3

File details

Details for the file pd_code_to_diagram-0.0.1.tar.gz.

File metadata

  • Download URL: pd_code_to_diagram-0.0.1.tar.gz
  • Upload date:
  • Size: 41.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.3.2 CPython/3.13.12 Windows/11

File hashes

Hashes for pd_code_to_diagram-0.0.1.tar.gz
Algorithm Hash digest
SHA256 986be0e048739d34c8abc352fe5d83a66c2a184001ee3c8099cde6401d7c297a
MD5 f3b3d9072f454f9a1e473fe9010f4177
BLAKE2b-256 f9697611e8b37629ee51e001b9afcac416e813a9de64090f76b05078a83c8cdc

See more details on using hashes here.

File details

Details for the file pd_code_to_diagram-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for pd_code_to_diagram-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a9de4ba14a16542eb1d6b50041989cc20ff4e45e75d9dd4fe976eb2b28ee2667
MD5 9d802274d36885f51a2642001c8ed4dc
BLAKE2b-256 e5beb76000a77631dfe4db3c6fcf2f64fbde5b191cfb652b815921da8dd99546

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 Pingdom Monitoring Sentry Error logging StatusPage Status page