spyrrow 0.2.0__cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
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.
Potentially problematic release.
This version of spyrrow might be problematic. Click here for more details.
spyrrow/__init__.py
ADDED
spyrrow/__init__.pyi
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
from typing import TypeAlias
|
|
2
|
+
|
|
3
|
+
Point: TypeAlias = tuple[float, float]
|
|
4
|
+
|
|
5
|
+
class Item:
|
|
6
|
+
id: int
|
|
7
|
+
demand: int
|
|
8
|
+
shape: list[Point]
|
|
9
|
+
allowed_orientations: list[float]
|
|
10
|
+
|
|
11
|
+
def __init__(
|
|
12
|
+
self,
|
|
13
|
+
id: int,
|
|
14
|
+
shape: list[Point],
|
|
15
|
+
demand: int,
|
|
16
|
+
allowed_orientations: list[float],
|
|
17
|
+
): ...
|
|
18
|
+
|
|
19
|
+
class PlacedItem:
|
|
20
|
+
id: int
|
|
21
|
+
shape: list[Point]
|
|
22
|
+
translation: Point
|
|
23
|
+
rotation: float
|
|
24
|
+
|
|
25
|
+
class StripPackingSolution:
|
|
26
|
+
width: float
|
|
27
|
+
density: float
|
|
28
|
+
placed_items: list[PlacedItem]
|
|
29
|
+
|
|
30
|
+
class StripPackingInstance:
|
|
31
|
+
name: str
|
|
32
|
+
height: float
|
|
33
|
+
items: list[Item]
|
|
34
|
+
|
|
35
|
+
def __init__(self, name: str, height: float, items: list[Item]): ...
|
|
36
|
+
def solve(self, computation_time: int = 600) -> StripPackingSolution: ...
|
spyrrow/py.typed
ADDED
|
File without changes
|
|
Binary file
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: spyrrow
|
|
3
|
+
Version: 0.2.0
|
|
4
|
+
Classifier: Programming Language :: Rust
|
|
5
|
+
Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
6
|
+
Classifier: Programming Language :: Python :: Implementation :: PyPy
|
|
7
|
+
License-File: LICENSE.txt
|
|
8
|
+
License: MIT
|
|
9
|
+
Requires-Python: >=3.10
|
|
10
|
+
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
|
|
11
|
+
|
|
12
|
+
# Spyrrow
|
|
13
|
+
|
|
14
|
+
Python wrapper on the Rust project [`sparrow`](https://github.com/JeroenGar/sparrow)
|
|
15
|
+
|
|
16
|
+
## Examples
|
|
17
|
+
```python
|
|
18
|
+
import spyrrow
|
|
19
|
+
|
|
20
|
+
rectangle1 = spyrrow.Item([(0,0),(1,0),(1,1),(0,1),(0,0)], demand=4, allowed_orientations=[0])
|
|
21
|
+
triangle1 = spyrrow.Item([(0,0),(1,0),(1,1),(0,0)], demand=6, allowed_orientations=[0,90,180,-90])
|
|
22
|
+
|
|
23
|
+
instance = spyrrow.StripPackingInstance("test", height=2.001, items=[rectangle1,triangle1])
|
|
24
|
+
sol:spyrrow.StripPackingSolution = instance.solve(30)
|
|
25
|
+
print(sol.width)
|
|
26
|
+
print(sol.density)
|
|
27
|
+
print("\n")
|
|
28
|
+
for pi in sol.placed_items:
|
|
29
|
+
print(pi.id)
|
|
30
|
+
print(pi.rotation)
|
|
31
|
+
print(pi.translation)
|
|
32
|
+
print("\n")
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Informations
|
|
36
|
+
|
|
37
|
+
The algorithmn is insensitive to rotation angles and shapes complexity (to a certain extend)
|
|
38
|
+
|
|
39
|
+
# TODOS
|
|
40
|
+
|
|
41
|
+
## Pay attention to that
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
use test-profile for local developpment
|
|
45
|
+
|
|
46
|
+
investiguate the compile options, nightly and SIMD and PyPa target architectures
|
|
47
|
+
|
|
48
|
+
- add presets for parameters as enums
|
|
49
|
+
|
|
50
|
+
## Mixed project Python/Rust
|
|
51
|
+
possibility to add conversion from shapely in a shapely variant
|
|
52
|
+
investiguate the possibility of maturin to handle extras
|
|
53
|
+
|
|
54
|
+
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
spyrrow-0.2.0.dist-info/METADATA,sha256=p9D_QSmvABrTUdR-gSzH7Jy4Q3KDGeclq7SlgSNpnZo,1467
|
|
2
|
+
spyrrow-0.2.0.dist-info/WHEEL,sha256=n6WM1ITxzKhX3-R1VvT6GrZ3REh83ujzl5Cw8VDoNRs,131
|
|
3
|
+
spyrrow-0.2.0.dist-info/licenses/LICENSE.txt,sha256=JOcOnGFqH2ZNyuMV3DBGh5kNL_3IqaS5832hwXhZ-Js,1076
|
|
4
|
+
spyrrow/__init__.py,sha256=MajlSBAliv8o8SqAqLgJARyi3egmvNIaXKTDXxvIAFY,111
|
|
5
|
+
spyrrow/__init__.pyi,sha256=9cCpUUc08P05BLw-ZZan96eJM9WaOdRDld42lWLHOTE,756
|
|
6
|
+
spyrrow/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
7
|
+
spyrrow/spyrrow.cpython-313-aarch64-linux-gnu.so,sha256=DlcsYIXkf_TSIiSmbyZtU6ebQbieItddmnuwIOT1b4Q,1556632
|
|
8
|
+
spyrrow-0.2.0.dist-info/RECORD,,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Paul Durand-Lupinski
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|