cube-python 0.4.0__tar.gz → 0.5.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.
- {cube_python-0.4.0 → cube_python-0.5.0}/PKG-INFO +13 -12
- {cube_python-0.4.0 → cube_python-0.5.0}/README.md +11 -10
- {cube_python-0.4.0 → cube_python-0.5.0}/cube_python.egg-info/PKG-INFO +13 -12
- {cube_python-0.4.0 → cube_python-0.5.0}/cube_python.egg-info/SOURCES.txt +1 -2
- {cube_python-0.4.0 → cube_python-0.5.0}/cxx/cube_amalg.min.cpp +717 -539
- {cube_python-0.4.0 → cube_python-0.5.0}/pycube/__init__.py +12 -7
- cube_python-0.5.0/pycube/_exceptions.py +31 -0
- {cube_python-0.4.0 → cube_python-0.5.0}/pycube/_ffi.py +1 -4
- {cube_python-0.4.0 → cube_python-0.5.0}/pyproject.toml +2 -2
- {cube_python-0.4.0 → cube_python-0.5.0}/setup.py +2 -2
- {cube_python-0.4.0 → cube_python-0.5.0}/test/test.2.py +1 -1
- cube_python-0.4.0/pycube/_exceptions.py +0 -20
- cube_python-0.4.0/test/test_cube.py +0 -30
- {cube_python-0.4.0 → cube_python-0.5.0}/LICENSE +0 -0
- {cube_python-0.4.0 → cube_python-0.5.0}/cube_python.egg-info/dependency_links.txt +0 -0
- {cube_python-0.4.0 → cube_python-0.5.0}/cube_python.egg-info/top_level.txt +0 -0
- {cube_python-0.4.0 → cube_python-0.5.0}/setup.cfg +0 -0
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: cube-python
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.5.0
|
|
4
4
|
Summary: Python binding for Cube C++ library
|
|
5
5
|
Author-email: coshz <fsinhx@gmail.com>
|
|
6
6
|
License: MIT
|
|
7
|
-
Project-URL: Documentation, https://github.com/coshz/cube/tree/
|
|
7
|
+
Project-URL: Documentation, https://github.com/coshz/cube/tree/HEAD/bindings/python#readme
|
|
8
8
|
Project-URL: Source, https://github.com/coshz/cube
|
|
9
9
|
Project-URL: Bug Tracker, https://github.com/coshz/cube/issues
|
|
10
10
|
Keywords: game,rubiks-cube,bindings
|
|
@@ -20,8 +20,8 @@ Dynamic: license-file
|
|
|
20
20
|
# cube-python
|
|
21
21
|
|
|
22
22
|
[](https://pypi.org/project/cube-python/)
|
|
23
|
-
[](https://github.com/coshz/cube/tree/
|
|
23
|
+
[](https://pypi.org/project/cube-python/)
|
|
24
|
+
[](https://github.com/coshz/cube/tree/HEAD/bindings/python)
|
|
25
25
|
|
|
26
26
|
|
|
27
27
|
High-performance Rubik's Cube solver Python bindings powered by C/C++ FFI.
|
|
@@ -37,7 +37,7 @@ pip install cube-python
|
|
|
37
37
|
## Quickstart
|
|
38
38
|
|
|
39
39
|
```python
|
|
40
|
-
|
|
40
|
+
import pycube
|
|
41
41
|
from pycube import SolveError
|
|
42
42
|
|
|
43
43
|
# Default solved cube string representation
|
|
@@ -49,7 +49,7 @@ scrambled = pycube.facecube("U F U' L2 R L' D2 B")
|
|
|
49
49
|
if pycube.solvable(scrambled):
|
|
50
50
|
try:
|
|
51
51
|
# Find solution sequence
|
|
52
|
-
solution = pycube.solve(scrambled,
|
|
52
|
+
solution = pycube.solve(scrambled,good=22)
|
|
53
53
|
print(f"Solution: {solution}")
|
|
54
54
|
|
|
55
55
|
# Apply solution to verify end state
|
|
@@ -64,24 +64,25 @@ if pycube.solvable(scrambled):
|
|
|
64
64
|
|
|
65
65
|
```python
|
|
66
66
|
import pycube
|
|
67
|
-
from pycube import SolveError, CUBE_ID
|
|
67
|
+
from pycube import SolveError, CUBE_ID, PermFormat
|
|
68
68
|
```
|
|
69
69
|
|
|
70
70
|
### Functions
|
|
71
71
|
|
|
72
72
|
| Function | Description |
|
|
73
73
|
| :--- | :--- |
|
|
74
|
-
| `solve(src,
|
|
75
|
-
| `facecube(maneuver,
|
|
74
|
+
| `solve(src,tgt=CUBE_ID,good=22)` | Solve cube state `src`; stops as soon as a solution <= `good` moves is found. Returns solution string or raises `SolveError`. |
|
|
75
|
+
| `facecube(maneuver,cube=CUBE_ID)` | Applies move sequence (e.g., `"U F U' L2"`) to a cube state and returns the new state. |
|
|
76
76
|
| `solvable(cube)` | Returns `True` if the 54-character state string is physically solvable. |
|
|
77
|
-
| `permutation(
|
|
77
|
+
| `permutation(ms_or_cube,fmt=PermFormat.Cycle)` | Returns a permutation representation for a move sequence or state. |
|
|
78
78
|
|
|
79
79
|
### Constants & Exceptions
|
|
80
80
|
|
|
81
81
|
| Name | Type | Description |
|
|
82
82
|
| :--- | :--- | :--- |
|
|
83
|
-
| `CUBE_ID` | `str` | Constant representing the standard solved state
|
|
84
|
-
| `
|
|
83
|
+
| `CUBE_ID` | `str` | Constant representing the standard solved state `UUUUUUUUURRRRRRRRRFFFFFFFFFDDDDDDDDDLLLLLLLLLBBBBBBBBB`. |
|
|
84
|
+
| `PermFormat` | `IntEnum` | Permutation output format. Members: `Face`,`Cubie`,`Cycle`. Defaults to `Cycle`. |
|
|
85
|
+
| `SolveError` | `Exception` | Raised when the state is invalid or unsolvable. |
|
|
85
86
|
|
|
86
87
|
## 📄 License
|
|
87
88
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# cube-python
|
|
2
2
|
|
|
3
3
|
[](https://pypi.org/project/cube-python/)
|
|
4
|
-
[](https://github.com/coshz/cube/tree/
|
|
4
|
+
[](https://pypi.org/project/cube-python/)
|
|
5
|
+
[](https://github.com/coshz/cube/tree/HEAD/bindings/python)
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
High-performance Rubik's Cube solver Python bindings powered by C/C++ FFI.
|
|
@@ -18,7 +18,7 @@ pip install cube-python
|
|
|
18
18
|
## Quickstart
|
|
19
19
|
|
|
20
20
|
```python
|
|
21
|
-
|
|
21
|
+
import pycube
|
|
22
22
|
from pycube import SolveError
|
|
23
23
|
|
|
24
24
|
# Default solved cube string representation
|
|
@@ -30,7 +30,7 @@ scrambled = pycube.facecube("U F U' L2 R L' D2 B")
|
|
|
30
30
|
if pycube.solvable(scrambled):
|
|
31
31
|
try:
|
|
32
32
|
# Find solution sequence
|
|
33
|
-
solution = pycube.solve(scrambled,
|
|
33
|
+
solution = pycube.solve(scrambled,good=22)
|
|
34
34
|
print(f"Solution: {solution}")
|
|
35
35
|
|
|
36
36
|
# Apply solution to verify end state
|
|
@@ -45,24 +45,25 @@ if pycube.solvable(scrambled):
|
|
|
45
45
|
|
|
46
46
|
```python
|
|
47
47
|
import pycube
|
|
48
|
-
from pycube import SolveError, CUBE_ID
|
|
48
|
+
from pycube import SolveError, CUBE_ID, PermFormat
|
|
49
49
|
```
|
|
50
50
|
|
|
51
51
|
### Functions
|
|
52
52
|
|
|
53
53
|
| Function | Description |
|
|
54
54
|
| :--- | :--- |
|
|
55
|
-
| `solve(src,
|
|
56
|
-
| `facecube(maneuver,
|
|
55
|
+
| `solve(src,tgt=CUBE_ID,good=22)` | Solve cube state `src`; stops as soon as a solution <= `good` moves is found. Returns solution string or raises `SolveError`. |
|
|
56
|
+
| `facecube(maneuver,cube=CUBE_ID)` | Applies move sequence (e.g., `"U F U' L2"`) to a cube state and returns the new state. |
|
|
57
57
|
| `solvable(cube)` | Returns `True` if the 54-character state string is physically solvable. |
|
|
58
|
-
| `permutation(
|
|
58
|
+
| `permutation(ms_or_cube,fmt=PermFormat.Cycle)` | Returns a permutation representation for a move sequence or state. |
|
|
59
59
|
|
|
60
60
|
### Constants & Exceptions
|
|
61
61
|
|
|
62
62
|
| Name | Type | Description |
|
|
63
63
|
| :--- | :--- | :--- |
|
|
64
|
-
| `CUBE_ID` | `str` | Constant representing the standard solved state
|
|
65
|
-
| `
|
|
64
|
+
| `CUBE_ID` | `str` | Constant representing the standard solved state `UUUUUUUUURRRRRRRRRFFFFFFFFFDDDDDDDDDLLLLLLLLLBBBBBBBBB`. |
|
|
65
|
+
| `PermFormat` | `IntEnum` | Permutation output format. Members: `Face`,`Cubie`,`Cycle`. Defaults to `Cycle`. |
|
|
66
|
+
| `SolveError` | `Exception` | Raised when the state is invalid or unsolvable. |
|
|
66
67
|
|
|
67
68
|
## 📄 License
|
|
68
69
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: cube-python
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.5.0
|
|
4
4
|
Summary: Python binding for Cube C++ library
|
|
5
5
|
Author-email: coshz <fsinhx@gmail.com>
|
|
6
6
|
License: MIT
|
|
7
|
-
Project-URL: Documentation, https://github.com/coshz/cube/tree/
|
|
7
|
+
Project-URL: Documentation, https://github.com/coshz/cube/tree/HEAD/bindings/python#readme
|
|
8
8
|
Project-URL: Source, https://github.com/coshz/cube
|
|
9
9
|
Project-URL: Bug Tracker, https://github.com/coshz/cube/issues
|
|
10
10
|
Keywords: game,rubiks-cube,bindings
|
|
@@ -20,8 +20,8 @@ Dynamic: license-file
|
|
|
20
20
|
# cube-python
|
|
21
21
|
|
|
22
22
|
[](https://pypi.org/project/cube-python/)
|
|
23
|
-
[](https://github.com/coshz/cube/tree/
|
|
23
|
+
[](https://pypi.org/project/cube-python/)
|
|
24
|
+
[](https://github.com/coshz/cube/tree/HEAD/bindings/python)
|
|
25
25
|
|
|
26
26
|
|
|
27
27
|
High-performance Rubik's Cube solver Python bindings powered by C/C++ FFI.
|
|
@@ -37,7 +37,7 @@ pip install cube-python
|
|
|
37
37
|
## Quickstart
|
|
38
38
|
|
|
39
39
|
```python
|
|
40
|
-
|
|
40
|
+
import pycube
|
|
41
41
|
from pycube import SolveError
|
|
42
42
|
|
|
43
43
|
# Default solved cube string representation
|
|
@@ -49,7 +49,7 @@ scrambled = pycube.facecube("U F U' L2 R L' D2 B")
|
|
|
49
49
|
if pycube.solvable(scrambled):
|
|
50
50
|
try:
|
|
51
51
|
# Find solution sequence
|
|
52
|
-
solution = pycube.solve(scrambled,
|
|
52
|
+
solution = pycube.solve(scrambled,good=22)
|
|
53
53
|
print(f"Solution: {solution}")
|
|
54
54
|
|
|
55
55
|
# Apply solution to verify end state
|
|
@@ -64,24 +64,25 @@ if pycube.solvable(scrambled):
|
|
|
64
64
|
|
|
65
65
|
```python
|
|
66
66
|
import pycube
|
|
67
|
-
from pycube import SolveError, CUBE_ID
|
|
67
|
+
from pycube import SolveError, CUBE_ID, PermFormat
|
|
68
68
|
```
|
|
69
69
|
|
|
70
70
|
### Functions
|
|
71
71
|
|
|
72
72
|
| Function | Description |
|
|
73
73
|
| :--- | :--- |
|
|
74
|
-
| `solve(src,
|
|
75
|
-
| `facecube(maneuver,
|
|
74
|
+
| `solve(src,tgt=CUBE_ID,good=22)` | Solve cube state `src`; stops as soon as a solution <= `good` moves is found. Returns solution string or raises `SolveError`. |
|
|
75
|
+
| `facecube(maneuver,cube=CUBE_ID)` | Applies move sequence (e.g., `"U F U' L2"`) to a cube state and returns the new state. |
|
|
76
76
|
| `solvable(cube)` | Returns `True` if the 54-character state string is physically solvable. |
|
|
77
|
-
| `permutation(
|
|
77
|
+
| `permutation(ms_or_cube,fmt=PermFormat.Cycle)` | Returns a permutation representation for a move sequence or state. |
|
|
78
78
|
|
|
79
79
|
### Constants & Exceptions
|
|
80
80
|
|
|
81
81
|
| Name | Type | Description |
|
|
82
82
|
| :--- | :--- | :--- |
|
|
83
|
-
| `CUBE_ID` | `str` | Constant representing the standard solved state
|
|
84
|
-
| `
|
|
83
|
+
| `CUBE_ID` | `str` | Constant representing the standard solved state `UUUUUUUUURRRRRRRRRFFFFFFFFFDDDDDDDDDLLLLLLLLLBBBBBBBBB`. |
|
|
84
|
+
| `PermFormat` | `IntEnum` | Permutation output format. Members: `Face`,`Cubie`,`Cycle`. Defaults to `Cycle`. |
|
|
85
|
+
| `SolveError` | `Exception` | Raised when the state is invalid or unsolvable. |
|
|
85
86
|
|
|
86
87
|
## 📄 License
|
|
87
88
|
|