pd-code-components 0.1.0__tar.gz → 0.1.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,63 @@
1
+ Metadata-Version: 2.4
2
+ Name: pd-code-components
3
+ Version: 0.1.1
4
+ Summary: get all components from a link pd code.
5
+ License: MIT
6
+ License-File: LICENSE
7
+ Author: GGN_2015
8
+ Author-email: premierbob@qq.com
9
+ Requires-Python: >=3.10
10
+ Classifier: License :: OSI Approved :: MIT License
11
+ Classifier: Programming Language :: Python :: 3
12
+ Classifier: Programming Language :: Python :: 3.10
13
+ Classifier: Programming Language :: Python :: 3.11
14
+ Classifier: Programming Language :: Python :: 3.12
15
+ Classifier: Programming Language :: Python :: 3.13
16
+ Classifier: Programming Language :: Python :: 3.14
17
+ Description-Content-Type: text/markdown
18
+
19
+ # pd-code-components
20
+
21
+ Find the components represented by a planar-diagram code.
22
+
23
+ ## Installation
24
+
25
+ ```bash
26
+ pip install pd-code-components
27
+ ```
28
+
29
+ ## Usage example
30
+
31
+ ```python
32
+ from pd_code_components import get_components_from_pd_code
33
+
34
+ hopf = [[2, 3, 1, 4], [4, 1, 3, 2]]
35
+ print(get_components_from_pd_code(hopf))
36
+ # [[1, 2], [3, 4]]
37
+ ```
38
+
39
+ ## Algorithm
40
+
41
+ At each crossing, slots `0` and `2` belong to one strand and slots `1` and `3` to the other. These opposite-slot pairs form an undirected graph on arc labels. Iterative depth-first traversal finds connected components in `O(V + E)` time. Sets are used for adjacency and visitation, avoiding the quadratic membership checks in the original list-based implementation.
42
+
43
+ ## Input conventions
44
+
45
+ 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.
46
+
47
+ ## External software
48
+
49
+ No external software is required.
50
+
51
+ ## Development
52
+
53
+ Run examples and package checks before release. Python packages require Python 3.10 or newer. Build PyPI artifacts with:
54
+
55
+ ```bash
56
+ poetry check
57
+ poetry build
58
+ ```
59
+
60
+ ## License
61
+
62
+ MIT. See `LICENSE`.
63
+
@@ -0,0 +1,44 @@
1
+ # pd-code-components
2
+
3
+ Find the components represented by a planar-diagram code.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ pip install pd-code-components
9
+ ```
10
+
11
+ ## Usage example
12
+
13
+ ```python
14
+ from pd_code_components import get_components_from_pd_code
15
+
16
+ hopf = [[2, 3, 1, 4], [4, 1, 3, 2]]
17
+ print(get_components_from_pd_code(hopf))
18
+ # [[1, 2], [3, 4]]
19
+ ```
20
+
21
+ ## Algorithm
22
+
23
+ At each crossing, slots `0` and `2` belong to one strand and slots `1` and `3` to the other. These opposite-slot pairs form an undirected graph on arc labels. Iterative depth-first traversal finds connected components in `O(V + E)` time. Sets are used for adjacency and visitation, avoiding the quadratic membership checks in the original list-based implementation.
24
+
25
+ ## Input conventions
26
+
27
+ 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.
28
+
29
+ ## External software
30
+
31
+ No external software is required.
32
+
33
+ ## Development
34
+
35
+ Run examples and package checks before release. Python packages require Python 3.10 or newer. Build PyPI artifacts with:
36
+
37
+ ```bash
38
+ poetry check
39
+ poetry build
40
+ ```
41
+
42
+ ## License
43
+
44
+ MIT. See `LICENSE`.
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "pd-code-components"
3
- version = "0.1.0"
3
+ version = "0.1.1"
4
4
  description = "get all components from a link pd code."
5
5
  authors = [
6
6
  {name = "GGN_2015",email = "premierbob@qq.com"}
@@ -1,42 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: pd-code-components
3
- Version: 0.1.0
4
- Summary: get all components from a link pd code.
5
- License: MIT
6
- License-File: LICENSE
7
- Author: GGN_2015
8
- Author-email: premierbob@qq.com
9
- Requires-Python: >=3.10
10
- Classifier: License :: OSI Approved :: MIT License
11
- Classifier: Programming Language :: Python :: 3
12
- Classifier: Programming Language :: Python :: 3.10
13
- Classifier: Programming Language :: Python :: 3.11
14
- Classifier: Programming Language :: Python :: 3.12
15
- Classifier: Programming Language :: Python :: 3.13
16
- Classifier: Programming Language :: Python :: 3.14
17
- Description-Content-Type: text/markdown
18
-
19
- # pd-code-components
20
-
21
- Find link components in a planar-diagram code.
22
-
23
- ## Installation
24
-
25
- ```bash
26
- pip install pd-code-components
27
- ```
28
-
29
- ## Quick start
30
-
31
- `from pd_code_components import get_components_from_pd_code`.
32
-
33
- PD codes are lists of four-entry crossings. Each arc label must occur exactly twice. Functions validate their inputs and do not mutate caller-owned PD-code lists unless explicitly documented.
34
-
35
- ## Development
36
-
37
- Use Python 3.10 or newer for Python packages. Build distributions with `poetry build`. Run the package's tests or examples before publishing. C++ projects require a modern standards-compliant compiler.
38
-
39
- ## License
40
-
41
- MIT. See `LICENSE`.
42
-
@@ -1,23 +0,0 @@
1
- # pd-code-components
2
-
3
- Find link components in a planar-diagram code.
4
-
5
- ## Installation
6
-
7
- ```bash
8
- pip install pd-code-components
9
- ```
10
-
11
- ## Quick start
12
-
13
- `from pd_code_components import get_components_from_pd_code`.
14
-
15
- PD codes are lists of four-entry crossings. Each arc label must occur exactly twice. Functions validate their inputs and do not mutate caller-owned PD-code lists unless explicitly documented.
16
-
17
- ## Development
18
-
19
- Use Python 3.10 or newer for Python packages. Build distributions with `poetry build`. Run the package's tests or examples before publishing. C++ projects require a modern standards-compliant compiler.
20
-
21
- ## License
22
-
23
- MIT. See `LICENSE`.