pd-code-delete-nugatory 0.1.0__tar.gz → 0.2.0__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.
- pd_code_delete_nugatory-0.2.0/PKG-INFO +44 -0
- pd_code_delete_nugatory-0.2.0/README.md +23 -0
- {pd_code_delete_nugatory-0.1.0 → pd_code_delete_nugatory-0.2.0}/pd_code_delete_nugatory/main.py +4 -4
- {pd_code_delete_nugatory-0.1.0 → pd_code_delete_nugatory-0.2.0}/pyproject.toml +3 -3
- pd_code_delete_nugatory-0.1.0/PKG-INFO +0 -41
- pd_code_delete_nugatory-0.1.0/README.md +0 -20
- {pd_code_delete_nugatory-0.1.0 → pd_code_delete_nugatory-0.2.0}/LICENSE +0 -0
- {pd_code_delete_nugatory-0.1.0 → pd_code_delete_nugatory-0.2.0}/pd_code_delete_nugatory/__init__.py +0 -0
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: pd-code-delete-nugatory
|
|
3
|
+
Version: 0.2.0
|
|
4
|
+
Summary: delete all nugatory crossing from a pd_code (link or knot).
|
|
5
|
+
License: MIT
|
|
6
|
+
License-File: LICENSE
|
|
7
|
+
Author: GGN_2015
|
|
8
|
+
Author-email: neko@jlulug.org
|
|
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
|
+
Requires-Dist: pd-code-de-r1 (>=0.1.1)
|
|
18
|
+
Requires-Dist: pd-code-pre-nxt (>=0.1.0)
|
|
19
|
+
Description-Content-Type: text/markdown
|
|
20
|
+
|
|
21
|
+
# pd-code-delete-nugatory
|
|
22
|
+
|
|
23
|
+
Detect and remove nugatory crossings from PD codes.
|
|
24
|
+
|
|
25
|
+
## Installation
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
pip install pd-code-delete-nugatory
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Quick start
|
|
32
|
+
|
|
33
|
+
`from pd_code_delete_nugatory import erase_all_nugatory`.
|
|
34
|
+
|
|
35
|
+
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.
|
|
36
|
+
|
|
37
|
+
## Development
|
|
38
|
+
|
|
39
|
+
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.
|
|
40
|
+
|
|
41
|
+
## License
|
|
42
|
+
|
|
43
|
+
MIT. See `LICENSE`.
|
|
44
|
+
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# pd-code-delete-nugatory
|
|
2
|
+
|
|
3
|
+
Detect and remove nugatory crossings from PD codes.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pip install pd-code-delete-nugatory
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Quick start
|
|
12
|
+
|
|
13
|
+
`from pd_code_delete_nugatory import erase_all_nugatory`.
|
|
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`.
|
{pd_code_delete_nugatory-0.1.0 → pd_code_delete_nugatory-0.2.0}/pd_code_delete_nugatory/main.py
RENAMED
|
@@ -29,7 +29,7 @@ def dfs_1(node, nxt:dict[Any, set], vis:set):
|
|
|
29
29
|
if node in vis:
|
|
30
30
|
return
|
|
31
31
|
vis.add(node)
|
|
32
|
-
for nxt_node in nxt[node]:
|
|
32
|
+
for nxt_node in sorted(nxt[node]):
|
|
33
33
|
dfs_1(nxt_node, nxt, vis)
|
|
34
34
|
|
|
35
35
|
def graph_cc_cnt(weak_pd_code:list[list]):
|
|
@@ -85,18 +85,18 @@ def dfs_2(num, vis:set, nxt:dict, new_num:dict):
|
|
|
85
85
|
raise AssertionError()
|
|
86
86
|
|
|
87
87
|
# 遍历所有后继
|
|
88
|
-
for nxt_num in nxt[num]:
|
|
88
|
+
for nxt_num in sorted(nxt[num]):
|
|
89
89
|
if nxt_num not in vis:
|
|
90
90
|
dfs_2(nxt_num, vis, nxt, new_num)
|
|
91
91
|
|
|
92
92
|
# 从 1 开始重新给所有元素编号
|
|
93
93
|
def renumber(pd_code:list[list]) -> list[list]:
|
|
94
94
|
pd_code = json.loads(json.dumps(pd_code))
|
|
95
|
-
num_set = set([
|
|
95
|
+
num_set = sorted(set([
|
|
96
96
|
item
|
|
97
97
|
for crossing in pd_code
|
|
98
98
|
for item in crossing
|
|
99
|
-
])
|
|
99
|
+
]))
|
|
100
100
|
|
|
101
101
|
# 这里不能直接用 get_pre_nxt
|
|
102
102
|
# 因为 renumber 之前有不连贯的编号
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "pd-code-delete-nugatory"
|
|
3
|
-
version = "0.
|
|
3
|
+
version = "0.2.0"
|
|
4
4
|
description = "delete all nugatory crossing from a pd_code (link or knot)."
|
|
5
5
|
authors = [
|
|
6
6
|
{name = "GGN_2015",email = "neko@jlulug.org"}
|
|
@@ -9,8 +9,8 @@ license = {text = "MIT"}
|
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.10"
|
|
11
11
|
dependencies = [
|
|
12
|
-
"
|
|
13
|
-
"
|
|
12
|
+
"pd-code-de-r1>=0.1.1",
|
|
13
|
+
"pd-code-pre-nxt>=0.1.0"
|
|
14
14
|
]
|
|
15
15
|
|
|
16
16
|
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: pd-code-delete-nugatory
|
|
3
|
-
Version: 0.1.0
|
|
4
|
-
Summary: delete all nugatory crossing from a pd_code (link or knot).
|
|
5
|
-
License: MIT
|
|
6
|
-
License-File: LICENSE
|
|
7
|
-
Author: GGN_2015
|
|
8
|
-
Author-email: neko@jlulug.org
|
|
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
|
-
Requires-Dist: pd_code_de_r1
|
|
18
|
-
Requires-Dist: pd_code_pre_nxt
|
|
19
|
-
Description-Content-Type: text/markdown
|
|
20
|
-
|
|
21
|
-
# pd_code_delete_nugatory
|
|
22
|
-
delete all nugatory crossing from a pd_code (link or knot).
|
|
23
|
-
|
|
24
|
-
## Install
|
|
25
|
-
|
|
26
|
-
```bash
|
|
27
|
-
pip install pd-code-delete-nugatory
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
## Usage
|
|
31
|
-
|
|
32
|
-
```python
|
|
33
|
-
import pd_code_delete_nugatory
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
pd_code = [[8, 11, 9, 12], [12, 9, 13, 10], [10, 13, 11, 14], [7, 14, 8, 1], [4, 1, 5, 2], [2, 5, 3, 6], [6, 3, 7, 4]]
|
|
37
|
-
|
|
38
|
-
# output a 6-crossing knot
|
|
39
|
-
print(pd_code_delete_nugatory.erase_all_nugatory(pd_code))
|
|
40
|
-
```
|
|
41
|
-
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
# pd_code_delete_nugatory
|
|
2
|
-
delete all nugatory crossing from a pd_code (link or knot).
|
|
3
|
-
|
|
4
|
-
## Install
|
|
5
|
-
|
|
6
|
-
```bash
|
|
7
|
-
pip install pd-code-delete-nugatory
|
|
8
|
-
```
|
|
9
|
-
|
|
10
|
-
## Usage
|
|
11
|
-
|
|
12
|
-
```python
|
|
13
|
-
import pd_code_delete_nugatory
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
pd_code = [[8, 11, 9, 12], [12, 9, 13, 10], [10, 13, 11, 14], [7, 14, 8, 1], [4, 1, 5, 2], [2, 5, 3, 6], [6, 3, 7, 4]]
|
|
17
|
-
|
|
18
|
-
# output a 6-crossing knot
|
|
19
|
-
print(pd_code_delete_nugatory.erase_all_nugatory(pd_code))
|
|
20
|
-
```
|
|
File without changes
|
{pd_code_delete_nugatory-0.1.0 → pd_code_delete_nugatory-0.2.0}/pd_code_delete_nugatory/__init__.py
RENAMED
|
File without changes
|