spyrrow 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.
Potentially problematic release.
This version of spyrrow might be problematic. Click here for more details.
- {spyrrow-0.1.0 → spyrrow-0.2.0}/.github/workflows/CI.yml +107 -34
- {spyrrow-0.1.0 → spyrrow-0.2.0}/Cargo.lock +26 -71
- {spyrrow-0.1.0 → spyrrow-0.2.0}/Cargo.toml +3 -5
- {spyrrow-0.1.0 → spyrrow-0.2.0}/PKG-INFO +1 -1
- {spyrrow-0.1.0 → spyrrow-0.2.0}/pyproject.toml +6 -0
- spyrrow-0.2.0/spyrrow.pyi +36 -0
- {spyrrow-0.1.0 → spyrrow-0.2.0}/src/lib.rs +42 -46
- spyrrow-0.2.0/tests/test_basic.py +47 -0
- spyrrow-0.2.0/uv.lock +159 -0
- spyrrow-0.1.0/spyrrow.pyi +0 -32
- spyrrow-0.1.0/uv.lock +0 -7
- {spyrrow-0.1.0 → spyrrow-0.2.0}/.gitignore +0 -0
- {spyrrow-0.1.0 → spyrrow-0.2.0}/LICENSE.txt +0 -0
- {spyrrow-0.1.0 → spyrrow-0.2.0}/README.md +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# This file is autogenerated by maturin v1.8.3
|
|
2
2
|
# To update, run
|
|
3
3
|
#
|
|
4
|
-
# maturin generate-ci github
|
|
4
|
+
# maturin generate-ci github --pytest
|
|
5
5
|
#
|
|
6
6
|
name: CI
|
|
7
7
|
|
|
@@ -28,14 +28,14 @@ jobs:
|
|
|
28
28
|
target: x86_64
|
|
29
29
|
- runner: ubuntu-22.04
|
|
30
30
|
target: x86
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
31
|
+
- runner: ubuntu-22.04
|
|
32
|
+
target: aarch64
|
|
33
|
+
- runner: ubuntu-22.04
|
|
34
|
+
target: armv7
|
|
35
|
+
- runner: ubuntu-22.04
|
|
36
|
+
target: s390x
|
|
37
|
+
- runner: ubuntu-22.04
|
|
38
|
+
target: ppc64le
|
|
39
39
|
steps:
|
|
40
40
|
- uses: actions/checkout@v4
|
|
41
41
|
- uses: actions/setup-python@v5
|
|
@@ -53,6 +53,31 @@ jobs:
|
|
|
53
53
|
with:
|
|
54
54
|
name: wheels-linux-${{ matrix.platform.target }}
|
|
55
55
|
path: dist
|
|
56
|
+
- name: pytest
|
|
57
|
+
if: ${{ startsWith(matrix.platform.target, 'x86_64') }}
|
|
58
|
+
shell: bash
|
|
59
|
+
run: |
|
|
60
|
+
set -e
|
|
61
|
+
python3 -m venv .venv
|
|
62
|
+
source .venv/bin/activate
|
|
63
|
+
pip install spyrrow --find-links dist --force-reinstall
|
|
64
|
+
pip install pytest
|
|
65
|
+
pytest
|
|
66
|
+
- name: pytest
|
|
67
|
+
if: ${{ !startsWith(matrix.platform.target, 'x86') && matrix.platform.target != 'ppc64' }}
|
|
68
|
+
uses: uraimo/run-on-arch-action@v2
|
|
69
|
+
with:
|
|
70
|
+
arch: ${{ matrix.platform.target }}
|
|
71
|
+
distro: ubuntu22.04
|
|
72
|
+
githubToken: ${{ github.token }}
|
|
73
|
+
install: |
|
|
74
|
+
apt-get update
|
|
75
|
+
apt-get install -y --no-install-recommends python3 python3-pip
|
|
76
|
+
pip3 install -U pip pytest
|
|
77
|
+
run: |
|
|
78
|
+
set -e
|
|
79
|
+
pip3 install spyrrow --find-links dist --force-reinstall
|
|
80
|
+
pytest
|
|
56
81
|
|
|
57
82
|
musllinux:
|
|
58
83
|
runs-on: ${{ matrix.platform.runner }}
|
|
@@ -84,6 +109,36 @@ jobs:
|
|
|
84
109
|
with:
|
|
85
110
|
name: wheels-musllinux-${{ matrix.platform.target }}
|
|
86
111
|
path: dist
|
|
112
|
+
- name: pytest
|
|
113
|
+
if: ${{ startsWith(matrix.platform.target, 'x86_64') }}
|
|
114
|
+
uses: addnab/docker-run-action@v3
|
|
115
|
+
with:
|
|
116
|
+
image: alpine:latest
|
|
117
|
+
options: -v ${{ github.workspace }}:/io -w /io
|
|
118
|
+
run: |
|
|
119
|
+
set -e
|
|
120
|
+
apk add py3-pip py3-virtualenv
|
|
121
|
+
python3 -m virtualenv .venv
|
|
122
|
+
source .venv/bin/activate
|
|
123
|
+
pip install spyrrow --no-index --find-links dist --force-reinstall
|
|
124
|
+
pip install pytest
|
|
125
|
+
pytest
|
|
126
|
+
- name: pytest
|
|
127
|
+
if: ${{ !startsWith(matrix.platform.target, 'x86') }}
|
|
128
|
+
uses: uraimo/run-on-arch-action@v2
|
|
129
|
+
with:
|
|
130
|
+
arch: ${{ matrix.platform.target }}
|
|
131
|
+
distro: alpine_latest
|
|
132
|
+
githubToken: ${{ github.token }}
|
|
133
|
+
install: |
|
|
134
|
+
apk add py3-virtualenv
|
|
135
|
+
run: |
|
|
136
|
+
set -e
|
|
137
|
+
python3 -m virtualenv .venv
|
|
138
|
+
source .venv/bin/activate
|
|
139
|
+
pip install pytest
|
|
140
|
+
pip install spyrrow --find-links dist --force-reinstall
|
|
141
|
+
pytest
|
|
87
142
|
|
|
88
143
|
windows:
|
|
89
144
|
runs-on: ${{ matrix.platform.runner }}
|
|
@@ -111,6 +166,16 @@ jobs:
|
|
|
111
166
|
with:
|
|
112
167
|
name: wheels-windows-${{ matrix.platform.target }}
|
|
113
168
|
path: dist
|
|
169
|
+
- name: pytest
|
|
170
|
+
if: ${{ !startsWith(matrix.platform.target, 'aarch64') }}
|
|
171
|
+
shell: bash
|
|
172
|
+
run: |
|
|
173
|
+
set -e
|
|
174
|
+
python3 -m venv .venv
|
|
175
|
+
source .venv/Scripts/activate
|
|
176
|
+
pip install spyrrow --find-links dist --force-reinstall
|
|
177
|
+
pip install pytest
|
|
178
|
+
pytest
|
|
114
179
|
|
|
115
180
|
macos:
|
|
116
181
|
runs-on: ${{ matrix.platform.runner }}
|
|
@@ -137,6 +202,14 @@ jobs:
|
|
|
137
202
|
with:
|
|
138
203
|
name: wheels-macos-${{ matrix.platform.target }}
|
|
139
204
|
path: dist
|
|
205
|
+
- name: pytest
|
|
206
|
+
run: |
|
|
207
|
+
set -e
|
|
208
|
+
python3 -m venv .venv
|
|
209
|
+
source .venv/bin/activate
|
|
210
|
+
pip install spyrrow --find-links dist --force-reinstall
|
|
211
|
+
pip install pytest
|
|
212
|
+
pytest
|
|
140
213
|
|
|
141
214
|
sdist:
|
|
142
215
|
runs-on: ubuntu-latest
|
|
@@ -179,28 +252,28 @@ jobs:
|
|
|
179
252
|
command: upload
|
|
180
253
|
args: --non-interactive --skip-existing wheels-*/*
|
|
181
254
|
|
|
182
|
-
testpypi-release:
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
255
|
+
# testpypi-release:
|
|
256
|
+
# name: Release on Test PyPi to ensure the CI/CD validity
|
|
257
|
+
# runs-on: ubuntu-latest
|
|
258
|
+
# needs: [linux, musllinux, windows, macos, sdist]
|
|
259
|
+
# environment:
|
|
260
|
+
# name: testpypi
|
|
261
|
+
# url: https://test.pypi.org/p/spyrrow
|
|
262
|
+
# permissions:
|
|
263
|
+
# # Use to sign the release artifacts
|
|
264
|
+
# id-token: write
|
|
265
|
+
# # Used to upload release artifacts
|
|
266
|
+
# contents: write
|
|
267
|
+
# # Used to generate artifact attestation
|
|
268
|
+
# attestations: write
|
|
269
|
+
# steps:
|
|
270
|
+
# - uses: actions/download-artifact@v4
|
|
271
|
+
# - name: Generate artifact attestation
|
|
272
|
+
# uses: actions/attest-build-provenance@v2
|
|
273
|
+
# with:
|
|
274
|
+
# subject-path: 'wheels-*/*'
|
|
275
|
+
# - name: Publish to TestPyPI
|
|
276
|
+
# uses: PyO3/maturin-action@v1
|
|
277
|
+
# with:
|
|
278
|
+
# command: upload
|
|
279
|
+
# args: --non-interactive --skip-existing wheels-*/* --repository-url=https://test.pypi.org/legacy/ --verbose
|
|
@@ -53,13 +53,10 @@ dependencies = [
|
|
|
53
53
|
]
|
|
54
54
|
|
|
55
55
|
[[package]]
|
|
56
|
-
name = "
|
|
57
|
-
version = "0.
|
|
56
|
+
name = "anyhow"
|
|
57
|
+
version = "1.0.98"
|
|
58
58
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
59
|
-
checksum = "
|
|
60
|
-
dependencies = [
|
|
61
|
-
"num-traits",
|
|
62
|
-
]
|
|
59
|
+
checksum = "e16d2d3311acee920a9eb8d33b8cbc1787ce4a264e85f964c2404b969bdcd487"
|
|
63
60
|
|
|
64
61
|
[[package]]
|
|
65
62
|
name = "autocfg"
|
|
@@ -73,15 +70,6 @@ version = "2.9.0"
|
|
|
73
70
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
74
71
|
checksum = "5c8214115b7bf84099f1309324e63141d4c5d7cc26862f97a0a857dbefe165bd"
|
|
75
72
|
|
|
76
|
-
[[package]]
|
|
77
|
-
name = "cc"
|
|
78
|
-
version = "1.2.19"
|
|
79
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
80
|
-
checksum = "8e3a13707ac958681c13b39b458c073d0d9bc8a22cb1b2f4c8e55eb72c13f362"
|
|
81
|
-
dependencies = [
|
|
82
|
-
"shlex",
|
|
83
|
-
]
|
|
84
|
-
|
|
85
73
|
[[package]]
|
|
86
74
|
name = "cfg-if"
|
|
87
75
|
version = "1.0.0"
|
|
@@ -134,15 +122,6 @@ version = "0.7.4"
|
|
|
134
122
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
135
123
|
checksum = "f46ad14479a25103f283c0f10005961cf086d8dc42205bb44c46ac563475dca6"
|
|
136
124
|
|
|
137
|
-
[[package]]
|
|
138
|
-
name = "clipper-sys"
|
|
139
|
-
version = "0.8.0"
|
|
140
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
141
|
-
checksum = "b5141c32419064aef7322f754b92fd4ea53c360c1ad984ec38b58af533eba3ac"
|
|
142
|
-
dependencies = [
|
|
143
|
-
"cc",
|
|
144
|
-
]
|
|
145
|
-
|
|
146
125
|
[[package]]
|
|
147
126
|
name = "colorchoice"
|
|
148
127
|
version = "1.0.3"
|
|
@@ -184,6 +163,15 @@ dependencies = [
|
|
|
184
163
|
"windows-sys",
|
|
185
164
|
]
|
|
186
165
|
|
|
166
|
+
[[package]]
|
|
167
|
+
name = "document-features"
|
|
168
|
+
version = "0.2.11"
|
|
169
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
170
|
+
checksum = "95249b50c6c185bee49034bcb378a49dc2b5dff0be90ff6616d31d64febab05d"
|
|
171
|
+
dependencies = [
|
|
172
|
+
"litrs",
|
|
173
|
+
]
|
|
174
|
+
|
|
187
175
|
[[package]]
|
|
188
176
|
name = "dtoa"
|
|
189
177
|
version = "1.0.10"
|
|
@@ -214,39 +202,6 @@ dependencies = [
|
|
|
214
202
|
"num-traits",
|
|
215
203
|
]
|
|
216
204
|
|
|
217
|
-
[[package]]
|
|
218
|
-
name = "geo-clipper"
|
|
219
|
-
version = "0.9.0"
|
|
220
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
221
|
-
checksum = "2370335cc0c40c7bc1e5b0ead27bdbb2132d54cfbb96248a4bdd65db1a6873aa"
|
|
222
|
-
dependencies = [
|
|
223
|
-
"clipper-sys",
|
|
224
|
-
"geo-types",
|
|
225
|
-
]
|
|
226
|
-
|
|
227
|
-
[[package]]
|
|
228
|
-
name = "geo-offset"
|
|
229
|
-
version = "0.4.0"
|
|
230
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
231
|
-
checksum = "d74cc1ae801176d4cfee3f4be7dd8758aa5e3c6155bf7d1fd8b5db3546eb7fe4"
|
|
232
|
-
dependencies = [
|
|
233
|
-
"geo-clipper",
|
|
234
|
-
"geo-types",
|
|
235
|
-
"itertools",
|
|
236
|
-
"num-traits",
|
|
237
|
-
]
|
|
238
|
-
|
|
239
|
-
[[package]]
|
|
240
|
-
name = "geo-types"
|
|
241
|
-
version = "0.7.16"
|
|
242
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
243
|
-
checksum = "62ddb1950450d67efee2bbc5e429c68d052a822de3aad010d28b351fbb705224"
|
|
244
|
-
dependencies = [
|
|
245
|
-
"approx",
|
|
246
|
-
"num-traits",
|
|
247
|
-
"serde",
|
|
248
|
-
]
|
|
249
|
-
|
|
250
205
|
[[package]]
|
|
251
206
|
name = "getrandom"
|
|
252
207
|
version = "0.3.2"
|
|
@@ -300,21 +255,21 @@ checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c"
|
|
|
300
255
|
|
|
301
256
|
[[package]]
|
|
302
257
|
name = "jagua-rs"
|
|
303
|
-
version = "0.
|
|
304
|
-
source = "git+https://github.com/JeroenGar/jagua-rs.git?rev=
|
|
258
|
+
version = "0.5.1"
|
|
259
|
+
source = "git+https://github.com/JeroenGar/jagua-rs.git?rev=06152d8654d8b9b0652c14ccd1f5d693b703b5de#06152d8654d8b9b0652c14ccd1f5d693b703b5de"
|
|
305
260
|
dependencies = [
|
|
261
|
+
"anyhow",
|
|
262
|
+
"document-features",
|
|
306
263
|
"float-cmp",
|
|
307
|
-
"geo-offset",
|
|
308
|
-
"geo-types",
|
|
309
264
|
"itertools",
|
|
310
265
|
"log",
|
|
311
266
|
"ndarray",
|
|
312
267
|
"ordered-float",
|
|
313
|
-
"rand",
|
|
314
268
|
"rand_distr",
|
|
315
269
|
"rayon",
|
|
316
270
|
"serde",
|
|
317
271
|
"slotmap",
|
|
272
|
+
"svg",
|
|
318
273
|
"tribool",
|
|
319
274
|
]
|
|
320
275
|
|
|
@@ -371,6 +326,12 @@ version = "0.2.11"
|
|
|
371
326
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
372
327
|
checksum = "8355be11b20d696c8f18f6cc018c4e372165b1fa8126cef092399c9951984ffa"
|
|
373
328
|
|
|
329
|
+
[[package]]
|
|
330
|
+
name = "litrs"
|
|
331
|
+
version = "0.4.1"
|
|
332
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
333
|
+
checksum = "b4ce301924b7887e9d637144fdade93f9dfff9b60981d4ac161db09720d39aa5"
|
|
334
|
+
|
|
374
335
|
[[package]]
|
|
375
336
|
name = "log"
|
|
376
337
|
version = "0.4.27"
|
|
@@ -707,12 +668,6 @@ dependencies = [
|
|
|
707
668
|
"serde",
|
|
708
669
|
]
|
|
709
670
|
|
|
710
|
-
[[package]]
|
|
711
|
-
name = "shlex"
|
|
712
|
-
version = "1.3.0"
|
|
713
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
714
|
-
checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64"
|
|
715
|
-
|
|
716
671
|
[[package]]
|
|
717
672
|
name = "slotmap"
|
|
718
673
|
version = "1.0.7"
|
|
@@ -725,8 +680,9 @@ dependencies = [
|
|
|
725
680
|
[[package]]
|
|
726
681
|
name = "sparrow"
|
|
727
682
|
version = "0.1.0"
|
|
728
|
-
source = "git+https://github.com/JeroenGar/sparrow.git?rev=
|
|
683
|
+
source = "git+https://github.com/JeroenGar/sparrow.git?rev=cb456fe41443c6c3153141aa8e945fedba78e60b#cb456fe41443c6c3153141aa8e945fedba78e60b"
|
|
729
684
|
dependencies = [
|
|
685
|
+
"anyhow",
|
|
730
686
|
"clap",
|
|
731
687
|
"ctrlc",
|
|
732
688
|
"fern",
|
|
@@ -737,7 +693,6 @@ dependencies = [
|
|
|
737
693
|
"log",
|
|
738
694
|
"num_cpus",
|
|
739
695
|
"numfmt",
|
|
740
|
-
"once_cell",
|
|
741
696
|
"ordered-float",
|
|
742
697
|
"rand",
|
|
743
698
|
"rand_distr",
|
|
@@ -752,7 +707,7 @@ dependencies = [
|
|
|
752
707
|
|
|
753
708
|
[[package]]
|
|
754
709
|
name = "spyrrow"
|
|
755
|
-
version = "0.
|
|
710
|
+
version = "0.2.0"
|
|
756
711
|
dependencies = [
|
|
757
712
|
"jagua-rs",
|
|
758
713
|
"pyo3",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[package]
|
|
2
2
|
name = "spyrrow"
|
|
3
|
-
version = "0.
|
|
3
|
+
version = "0.2.0"
|
|
4
4
|
edition = "2021"
|
|
5
5
|
license = "MIT"
|
|
6
6
|
|
|
@@ -10,9 +10,7 @@ name = "spyrrow"
|
|
|
10
10
|
crate-type = ["cdylib"]
|
|
11
11
|
|
|
12
12
|
[dependencies]
|
|
13
|
-
jagua-rs = { git = "https://github.com/JeroenGar/jagua-rs.git", rev="
|
|
13
|
+
jagua-rs = { git = "https://github.com/JeroenGar/jagua-rs.git", rev="06152d8654d8b9b0652c14ccd1f5d693b703b5de", features = ["spp"], default-features = false}
|
|
14
14
|
pyo3 = "0.24.0"
|
|
15
15
|
rand = { version = "0.9.0", features = ["small_rng"] }
|
|
16
|
-
sparrow = { git = "https://github.com/JeroenGar/sparrow.git",rev="
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
sparrow = { git = "https://github.com/JeroenGar/sparrow.git",rev="cb456fe41443c6c3153141aa8e945fedba78e60b",features = ["only_final_svg"], default-features = false}
|
|
@@ -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: ...
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
use jagua_rs::io::
|
|
2
|
-
use jagua_rs::io::
|
|
1
|
+
use jagua_rs::io::ext_repr::{ExtItem as BaseItem, ExtSPolygon, ExtShape};
|
|
2
|
+
use jagua_rs::io::import::Importer;
|
|
3
|
+
use jagua_rs::probs::spp::io::ext_repr::{ExtItem, ExtSPInstance};
|
|
3
4
|
use pyo3::prelude::*;
|
|
4
5
|
use rand::prelude::SmallRng;
|
|
5
6
|
use rand::SeedableRng;
|
|
@@ -7,14 +8,14 @@ use sparrow::config::{
|
|
|
7
8
|
CDE_CONFIG, COMPRESS_TIME_RATIO, EXPLORE_TIME_RATIO, MIN_ITEM_SEPARATION, SIMPL_TOLERANCE,
|
|
8
9
|
};
|
|
9
10
|
use sparrow::optimizer::{optimize, Terminator};
|
|
10
|
-
use sparrow::
|
|
11
|
-
use sparrow::util::io::to_sp_instance;
|
|
11
|
+
use sparrow::EPOCH;
|
|
12
12
|
use std::fs;
|
|
13
13
|
use std::time::Duration;
|
|
14
14
|
|
|
15
15
|
#[pyclass(name = "Item", get_all, set_all)]
|
|
16
16
|
#[derive(Clone)]
|
|
17
17
|
struct ItemPy {
|
|
18
|
+
id: u64,
|
|
18
19
|
demand: u64,
|
|
19
20
|
allowed_orientations: Option<Vec<f32>>,
|
|
20
21
|
shape: Vec<(f32, f32)>,
|
|
@@ -23,31 +24,36 @@ struct ItemPy {
|
|
|
23
24
|
#[pymethods]
|
|
24
25
|
impl ItemPy {
|
|
25
26
|
#[new]
|
|
26
|
-
fn new(shape: Vec<(f32, f32)>, demand: u64, allowed_orientations:
|
|
27
|
+
fn new(id: u64, shape: Vec<(f32, f32)>, demand: u64, allowed_orientations: Vec<f32>) -> Self {
|
|
27
28
|
ItemPy {
|
|
29
|
+
id,
|
|
28
30
|
demand,
|
|
29
|
-
allowed_orientations,
|
|
31
|
+
allowed_orientations: Some(allowed_orientations),
|
|
30
32
|
shape,
|
|
31
33
|
}
|
|
32
34
|
}
|
|
33
35
|
|
|
34
36
|
fn __repr__(&self) -> String {
|
|
35
37
|
format!(
|
|
36
|
-
"Item(shape={:?}, demand='{}', allowed_orientations={:?})",
|
|
37
|
-
self.shape, self.demand, self.allowed_orientations
|
|
38
|
+
"Item(id={},shape={:?}, demand='{}', allowed_orientations={:?})",
|
|
39
|
+
self.id, self.shape, self.demand, self.allowed_orientations
|
|
38
40
|
)
|
|
39
41
|
}
|
|
40
42
|
}
|
|
41
43
|
|
|
42
|
-
impl From<ItemPy> for
|
|
44
|
+
impl From<ItemPy> for ExtItem {
|
|
43
45
|
fn from(value: ItemPy) -> Self {
|
|
44
|
-
let
|
|
45
|
-
|
|
46
|
+
let polygon = ExtSPolygon(value.shape);
|
|
47
|
+
let shape = ExtShape::SimplePolygon(polygon);
|
|
48
|
+
let base = BaseItem {
|
|
49
|
+
id: value.id,
|
|
46
50
|
allowed_orientations: value.allowed_orientations,
|
|
47
|
-
demand: value.demand,
|
|
48
51
|
shape,
|
|
49
|
-
|
|
50
|
-
|
|
52
|
+
min_quality: None,
|
|
53
|
+
};
|
|
54
|
+
ExtItem {
|
|
55
|
+
base,
|
|
56
|
+
demand: value.demand,
|
|
51
57
|
}
|
|
52
58
|
}
|
|
53
59
|
}
|
|
@@ -55,7 +61,7 @@ impl From<ItemPy> for JsonItem {
|
|
|
55
61
|
#[pyclass(name = "PlacedItem", get_all)]
|
|
56
62
|
#[derive(Clone, Debug)]
|
|
57
63
|
struct PlacedItemPy {
|
|
58
|
-
pub id:
|
|
64
|
+
pub id: u64,
|
|
59
65
|
pub translation: (f32, f32),
|
|
60
66
|
pub rotation: f32,
|
|
61
67
|
}
|
|
@@ -76,16 +82,12 @@ struct StripPackingInstancePy {
|
|
|
76
82
|
pub items: Vec<ItemPy>,
|
|
77
83
|
}
|
|
78
84
|
|
|
79
|
-
impl From<StripPackingInstancePy> for
|
|
85
|
+
impl From<StripPackingInstancePy> for ExtSPInstance {
|
|
80
86
|
fn from(value: StripPackingInstancePy) -> Self {
|
|
81
87
|
let items = value.items.into_iter().map(|v| v.into()).collect();
|
|
82
|
-
|
|
83
|
-
height: value.height,
|
|
84
|
-
});
|
|
85
|
-
JsonInstance {
|
|
88
|
+
ExtSPInstance {
|
|
86
89
|
name: value.name,
|
|
87
|
-
|
|
88
|
-
strip,
|
|
90
|
+
strip_height: value.height,
|
|
89
91
|
items,
|
|
90
92
|
}
|
|
91
93
|
}
|
|
@@ -102,7 +104,8 @@ impl StripPackingInstancePy {
|
|
|
102
104
|
}
|
|
103
105
|
}
|
|
104
106
|
|
|
105
|
-
|
|
107
|
+
#[pyo3(signature = (computation_time=600))]
|
|
108
|
+
fn solve(&self, computation_time: u64, py: Python) -> StripPackingSolutionPy {
|
|
106
109
|
// Temporary output dir for intermediary solution
|
|
107
110
|
|
|
108
111
|
// let tmp = TempDir::new().expect("could not create output directory");
|
|
@@ -114,25 +117,19 @@ impl StripPackingInstancePy {
|
|
|
114
117
|
let rng = SmallRng::seed_from_u64(seed);
|
|
115
118
|
|
|
116
119
|
// Execution Time
|
|
117
|
-
let (explore_dur, compress_dur) =
|
|
118
|
-
(
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
)
|
|
122
|
-
} else {
|
|
123
|
-
(
|
|
124
|
-
Duration::from_secs(600).mul_f32(EXPLORE_TIME_RATIO),
|
|
125
|
-
Duration::from_secs(600).mul_f32(COMPRESS_TIME_RATIO),
|
|
126
|
-
)
|
|
127
|
-
};
|
|
120
|
+
let (explore_dur, compress_dur) = (
|
|
121
|
+
Duration::from_secs(computation_time).mul_f32(EXPLORE_TIME_RATIO),
|
|
122
|
+
Duration::from_secs(computation_time).mul_f32(COMPRESS_TIME_RATIO),
|
|
123
|
+
);
|
|
128
124
|
|
|
129
|
-
let
|
|
130
|
-
let
|
|
131
|
-
|
|
132
|
-
let instance =
|
|
125
|
+
let ext_instance = self.clone().into();
|
|
126
|
+
let importer = Importer::new(CDE_CONFIG, SIMPL_TOLERANCE, MIN_ITEM_SEPARATION);
|
|
127
|
+
// TODO Investigate the rules about ids
|
|
128
|
+
let instance = jagua_rs::probs::spp::io::import(&importer, &ext_instance)
|
|
129
|
+
.expect("Expected a Strip Packing Problem Instance");
|
|
133
130
|
|
|
134
|
-
let terminator = Terminator::new_with_ctrlc_handler();
|
|
135
131
|
py.allow_threads(move || {
|
|
132
|
+
let terminator = Terminator::new_without_ctrlc();
|
|
136
133
|
let solution = optimize(
|
|
137
134
|
instance.clone(),
|
|
138
135
|
rng,
|
|
@@ -141,16 +138,15 @@ impl StripPackingInstancePy {
|
|
|
141
138
|
explore_dur,
|
|
142
139
|
compress_dur,
|
|
143
140
|
);
|
|
144
|
-
let density = solution.density(&instance);
|
|
145
141
|
|
|
146
|
-
let
|
|
147
|
-
|
|
148
|
-
let
|
|
149
|
-
|
|
142
|
+
let solution = jagua_rs::probs::spp::io::export(&instance, &solution, *EPOCH);
|
|
143
|
+
|
|
144
|
+
let placed_items: Vec<PlacedItemPy> = solution
|
|
145
|
+
.layout
|
|
150
146
|
.placed_items
|
|
151
147
|
.into_iter()
|
|
152
148
|
.map(|jpi| PlacedItemPy {
|
|
153
|
-
id: jpi.
|
|
149
|
+
id: jpi.item_id,
|
|
154
150
|
rotation: jpi.transformation.rotation,
|
|
155
151
|
translation: jpi.transformation.translation,
|
|
156
152
|
})
|
|
@@ -158,7 +154,7 @@ impl StripPackingInstancePy {
|
|
|
158
154
|
fs::remove_dir_all(&tmp_str).expect("Should be able to remove tmp dir");
|
|
159
155
|
StripPackingSolutionPy {
|
|
160
156
|
width: solution.strip_width,
|
|
161
|
-
density,
|
|
157
|
+
density: solution.density,
|
|
162
158
|
placed_items,
|
|
163
159
|
}
|
|
164
160
|
})
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import spyrrow
|
|
2
|
+
import pytest
|
|
3
|
+
|
|
4
|
+
def test_basic():
|
|
5
|
+
## Continuous rotation seems to not be implemented for strip packing
|
|
6
|
+
rectangle1 = spyrrow.Item(
|
|
7
|
+
0, [(0, 0), (1, 0), (1, 1), (0, 1), (0, 0)], demand=4, allowed_orientations=[0]
|
|
8
|
+
)
|
|
9
|
+
triangle1 = spyrrow.Item(
|
|
10
|
+
1,
|
|
11
|
+
[(0, 0), (1, 0), (1, 1), (0, 0)],
|
|
12
|
+
demand=6,
|
|
13
|
+
allowed_orientations=[0, 90, 180, -90],
|
|
14
|
+
)
|
|
15
|
+
|
|
16
|
+
instance = spyrrow.StripPackingInstance(
|
|
17
|
+
"test", height=2.001, items=[rectangle1, triangle1]
|
|
18
|
+
)
|
|
19
|
+
sol = instance.solve(30)
|
|
20
|
+
assert sol.width == pytest.approx(4,rel=0.2)
|
|
21
|
+
|
|
22
|
+
def test_2_consecutive_calls():
|
|
23
|
+
# Test correpsonding to crash on the second consecutive call of solve method
|
|
24
|
+
rectangle1 = spyrrow.Item(
|
|
25
|
+
0, [(0, 0), (1, 0), (1, 1), (0, 1), (0, 0)], demand=4, allowed_orientations=[0]
|
|
26
|
+
)
|
|
27
|
+
triangle1 = spyrrow.Item(
|
|
28
|
+
1,
|
|
29
|
+
[(0, 0), (1, 0), (1, 1), (0, 0)],
|
|
30
|
+
demand=6,
|
|
31
|
+
allowed_orientations=[0, 90, 180, -90],
|
|
32
|
+
)
|
|
33
|
+
|
|
34
|
+
instance = spyrrow.StripPackingInstance(
|
|
35
|
+
"test", height=2.001, items=[rectangle1, triangle1]
|
|
36
|
+
)
|
|
37
|
+
sol = instance.solve(10)
|
|
38
|
+
sol = instance.solve(30)
|
|
39
|
+
assert sol.width == pytest.approx(4,rel=0.2)
|
|
40
|
+
|
|
41
|
+
def test_concave_polygons():
|
|
42
|
+
poly1 = spyrrow.Item(0,[(0, 0), (3, 0), (4, 1), (3, 2), (0, 2), (1, 1), (0, 0)],demand=2,allowed_orientations=[0,90,180,270])
|
|
43
|
+
poly2 = spyrrow.Item(1,[(0, 0), (1, 0), (1, 2), (3, 2), (3, 0), (4, 0), (4, 3), (0, 3), (0, 0)], demand=3, allowed_orientations=[0,90,180,270])
|
|
44
|
+
instance = spyrrow.StripPackingInstance(
|
|
45
|
+
"test", height=4.001, items=[poly1, poly2]
|
|
46
|
+
)
|
|
47
|
+
sol = instance.solve(30)
|
spyrrow-0.2.0/uv.lock
ADDED
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
version = 1
|
|
2
|
+
revision = 1
|
|
3
|
+
requires-python = ">=3.10"
|
|
4
|
+
|
|
5
|
+
[[package]]
|
|
6
|
+
name = "colorama"
|
|
7
|
+
version = "0.4.6"
|
|
8
|
+
source = { registry = "https://pypi.org/simple" }
|
|
9
|
+
sdist = { url = "https://files.pythonhosted.org/packages/d8/53/6f443c9a4a8358a93a6792e2acffb9d9d5cb0a5cfd8802644b7b1c9a02e4/colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44", size = 27697 }
|
|
10
|
+
wheels = [
|
|
11
|
+
{ url = "https://files.pythonhosted.org/packages/d1/d6/3965ed04c63042e047cb6a3e6ed1a63a35087b6a609aa3a15ed8ac56c221/colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6", size = 25335 },
|
|
12
|
+
]
|
|
13
|
+
|
|
14
|
+
[[package]]
|
|
15
|
+
name = "exceptiongroup"
|
|
16
|
+
version = "1.3.0"
|
|
17
|
+
source = { registry = "https://pypi.org/simple" }
|
|
18
|
+
dependencies = [
|
|
19
|
+
{ name = "typing-extensions", marker = "python_full_version < '3.13'" },
|
|
20
|
+
]
|
|
21
|
+
sdist = { url = "https://files.pythonhosted.org/packages/0b/9f/a65090624ecf468cdca03533906e7c69ed7588582240cfe7cc9e770b50eb/exceptiongroup-1.3.0.tar.gz", hash = "sha256:b241f5885f560bc56a59ee63ca4c6a8bfa46ae4ad651af316d4e81817bb9fd88", size = 29749 }
|
|
22
|
+
wheels = [
|
|
23
|
+
{ url = "https://files.pythonhosted.org/packages/36/f4/c6e662dade71f56cd2f3735141b265c3c79293c109549c1e6933b0651ffc/exceptiongroup-1.3.0-py3-none-any.whl", hash = "sha256:4d111e6e0c13d0644cad6ddaa7ed0261a0b36971f6d23e7ec9b4b9097da78a10", size = 16674 },
|
|
24
|
+
]
|
|
25
|
+
|
|
26
|
+
[[package]]
|
|
27
|
+
name = "iniconfig"
|
|
28
|
+
version = "2.1.0"
|
|
29
|
+
source = { registry = "https://pypi.org/simple" }
|
|
30
|
+
sdist = { url = "https://files.pythonhosted.org/packages/f2/97/ebf4da567aa6827c909642694d71c9fcf53e5b504f2d96afea02718862f3/iniconfig-2.1.0.tar.gz", hash = "sha256:3abbd2e30b36733fee78f9c7f7308f2d0050e88f0087fd25c2645f63c773e1c7", size = 4793 }
|
|
31
|
+
wheels = [
|
|
32
|
+
{ url = "https://files.pythonhosted.org/packages/2c/e1/e6716421ea10d38022b952c159d5161ca1193197fb744506875fbb87ea7b/iniconfig-2.1.0-py3-none-any.whl", hash = "sha256:9deba5723312380e77435581c6bf4935c94cbfab9b1ed33ef8d238ea168eb760", size = 6050 },
|
|
33
|
+
]
|
|
34
|
+
|
|
35
|
+
[[package]]
|
|
36
|
+
name = "packaging"
|
|
37
|
+
version = "25.0"
|
|
38
|
+
source = { registry = "https://pypi.org/simple" }
|
|
39
|
+
sdist = { url = "https://files.pythonhosted.org/packages/a1/d4/1fc4078c65507b51b96ca8f8c3ba19e6a61c8253c72794544580a7b6c24d/packaging-25.0.tar.gz", hash = "sha256:d443872c98d677bf60f6a1f2f8c1cb748e8fe762d2bf9d3148b5599295b0fc4f", size = 165727 }
|
|
40
|
+
wheels = [
|
|
41
|
+
{ url = "https://files.pythonhosted.org/packages/20/12/38679034af332785aac8774540895e234f4d07f7545804097de4b666afd8/packaging-25.0-py3-none-any.whl", hash = "sha256:29572ef2b1f17581046b3a2227d5c611fb25ec70ca1ba8554b24b0e69331a484", size = 66469 },
|
|
42
|
+
]
|
|
43
|
+
|
|
44
|
+
[[package]]
|
|
45
|
+
name = "pluggy"
|
|
46
|
+
version = "1.5.0"
|
|
47
|
+
source = { registry = "https://pypi.org/simple" }
|
|
48
|
+
sdist = { url = "https://files.pythonhosted.org/packages/96/2d/02d4312c973c6050a18b314a5ad0b3210edb65a906f868e31c111dede4a6/pluggy-1.5.0.tar.gz", hash = "sha256:2cffa88e94fdc978c4c574f15f9e59b7f4201d439195c3715ca9e2486f1d0cf1", size = 67955 }
|
|
49
|
+
wheels = [
|
|
50
|
+
{ url = "https://files.pythonhosted.org/packages/88/5f/e351af9a41f866ac3f1fac4ca0613908d9a41741cfcf2228f4ad853b697d/pluggy-1.5.0-py3-none-any.whl", hash = "sha256:44e1ad92c8ca002de6377e165f3e0f1be63266ab4d554740532335b9d75ea669", size = 20556 },
|
|
51
|
+
]
|
|
52
|
+
|
|
53
|
+
[[package]]
|
|
54
|
+
name = "pytest"
|
|
55
|
+
version = "8.3.5"
|
|
56
|
+
source = { registry = "https://pypi.org/simple" }
|
|
57
|
+
dependencies = [
|
|
58
|
+
{ name = "colorama", marker = "sys_platform == 'win32'" },
|
|
59
|
+
{ name = "exceptiongroup", marker = "python_full_version < '3.11'" },
|
|
60
|
+
{ name = "iniconfig" },
|
|
61
|
+
{ name = "packaging" },
|
|
62
|
+
{ name = "pluggy" },
|
|
63
|
+
{ name = "tomli", marker = "python_full_version < '3.11'" },
|
|
64
|
+
]
|
|
65
|
+
sdist = { url = "https://files.pythonhosted.org/packages/ae/3c/c9d525a414d506893f0cd8a8d0de7706446213181570cdbd766691164e40/pytest-8.3.5.tar.gz", hash = "sha256:f4efe70cc14e511565ac476b57c279e12a855b11f48f212af1080ef2263d3845", size = 1450891 }
|
|
66
|
+
wheels = [
|
|
67
|
+
{ url = "https://files.pythonhosted.org/packages/30/3d/64ad57c803f1fa1e963a7946b6e0fea4a70df53c1a7fed304586539c2bac/pytest-8.3.5-py3-none-any.whl", hash = "sha256:c69214aa47deac29fad6c2a4f590b9c4a9fdb16a403176fe154b79c0b4d4d820", size = 343634 },
|
|
68
|
+
]
|
|
69
|
+
|
|
70
|
+
[[package]]
|
|
71
|
+
name = "ruff"
|
|
72
|
+
version = "0.11.9"
|
|
73
|
+
source = { registry = "https://pypi.org/simple" }
|
|
74
|
+
sdist = { url = "https://files.pythonhosted.org/packages/f5/e7/e55dda1c92cdcf34b677ebef17486669800de01e887b7831a1b8fdf5cb08/ruff-0.11.9.tar.gz", hash = "sha256:ebd58d4f67a00afb3a30bf7d383e52d0e036e6195143c6db7019604a05335517", size = 4132134 }
|
|
75
|
+
wheels = [
|
|
76
|
+
{ url = "https://files.pythonhosted.org/packages/fb/71/75dfb7194fe6502708e547941d41162574d1f579c4676a8eb645bf1a6842/ruff-0.11.9-py3-none-linux_armv6l.whl", hash = "sha256:a31a1d143a5e6f499d1fb480f8e1e780b4dfdd580f86e05e87b835d22c5c6f8c", size = 10335453 },
|
|
77
|
+
{ url = "https://files.pythonhosted.org/packages/74/fc/ad80c869b1732f53c4232bbf341f33c5075b2c0fb3e488983eb55964076a/ruff-0.11.9-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:66bc18ca783b97186a1f3100e91e492615767ae0a3be584e1266aa9051990722", size = 11072566 },
|
|
78
|
+
{ url = "https://files.pythonhosted.org/packages/87/0d/0ccececef8a0671dae155cbf7a1f90ea2dd1dba61405da60228bbe731d35/ruff-0.11.9-py3-none-macosx_11_0_arm64.whl", hash = "sha256:bd576cd06962825de8aece49f28707662ada6a1ff2db848d1348e12c580acbf1", size = 10435020 },
|
|
79
|
+
{ url = "https://files.pythonhosted.org/packages/52/01/e249e1da6ad722278094e183cbf22379a9bbe5f21a3e46cef24ccab76e22/ruff-0.11.9-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5b1d18b4be8182cc6fddf859ce432cc9631556e9f371ada52f3eaefc10d878de", size = 10593935 },
|
|
80
|
+
{ url = "https://files.pythonhosted.org/packages/ed/9a/40cf91f61e3003fe7bd43f1761882740e954506c5a0f9097b1cff861f04c/ruff-0.11.9-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:0f3f46f759ac623e94824b1e5a687a0df5cd7f5b00718ff9c24f0a894a683be7", size = 10172971 },
|
|
81
|
+
{ url = "https://files.pythonhosted.org/packages/61/12/d395203de1e8717d7a2071b5a340422726d4736f44daf2290aad1085075f/ruff-0.11.9-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:f34847eea11932d97b521450cf3e1d17863cfa5a94f21a056b93fb86f3f3dba2", size = 11748631 },
|
|
82
|
+
{ url = "https://files.pythonhosted.org/packages/66/d6/ef4d5eba77677eab511644c37c55a3bb8dcac1cdeb331123fe342c9a16c9/ruff-0.11.9-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:f33b15e00435773df97cddcd263578aa83af996b913721d86f47f4e0ee0ff271", size = 12409236 },
|
|
83
|
+
{ url = "https://files.pythonhosted.org/packages/c5/8f/5a2c5fc6124dd925a5faf90e1089ee9036462118b619068e5b65f8ea03df/ruff-0.11.9-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:7b27613a683b086f2aca8996f63cb3dd7bc49e6eccf590563221f7b43ded3f65", size = 11881436 },
|
|
84
|
+
{ url = "https://files.pythonhosted.org/packages/39/d1/9683f469ae0b99b95ef99a56cfe8c8373c14eba26bd5c622150959ce9f64/ruff-0.11.9-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:9e0d88756e63e8302e630cee3ce2ffb77859797cc84a830a24473939e6da3ca6", size = 13982759 },
|
|
85
|
+
{ url = "https://files.pythonhosted.org/packages/4e/0b/c53a664f06e0faab596397867c6320c3816df479e888fe3af63bc3f89699/ruff-0.11.9-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:537c82c9829d7811e3aa680205f94c81a2958a122ac391c0eb60336ace741a70", size = 11541985 },
|
|
86
|
+
{ url = "https://files.pythonhosted.org/packages/23/a0/156c4d7e685f6526a636a60986ee4a3c09c8c4e2a49b9a08c9913f46c139/ruff-0.11.9-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:440ac6a7029f3dee7d46ab7de6f54b19e34c2b090bb4f2480d0a2d635228f381", size = 10465775 },
|
|
87
|
+
{ url = "https://files.pythonhosted.org/packages/43/d5/88b9a6534d9d4952c355e38eabc343df812f168a2c811dbce7d681aeb404/ruff-0.11.9-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:71c539bac63d0788a30227ed4d43b81353c89437d355fdc52e0cda4ce5651787", size = 10170957 },
|
|
88
|
+
{ url = "https://files.pythonhosted.org/packages/f0/b8/2bd533bdaf469dc84b45815ab806784d561fab104d993a54e1852596d581/ruff-0.11.9-py3-none-musllinux_1_2_i686.whl", hash = "sha256:c67117bc82457e4501473c5f5217d49d9222a360794bfb63968e09e70f340abd", size = 11143307 },
|
|
89
|
+
{ url = "https://files.pythonhosted.org/packages/2f/d9/43cfba291788459b9bfd4e09a0479aa94d05ab5021d381a502d61a807ec1/ruff-0.11.9-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:e4b78454f97aa454586e8a5557facb40d683e74246c97372af3c2d76901d697b", size = 11603026 },
|
|
90
|
+
{ url = "https://files.pythonhosted.org/packages/22/e6/7ed70048e89b01d728ccc950557a17ecf8df4127b08a56944b9d0bae61bc/ruff-0.11.9-py3-none-win32.whl", hash = "sha256:7fe1bc950e7d7b42caaee2a8a3bc27410547cc032c9558ee2e0f6d3b209e845a", size = 10548627 },
|
|
91
|
+
{ url = "https://files.pythonhosted.org/packages/90/36/1da5d566271682ed10f436f732e5f75f926c17255c9c75cefb77d4bf8f10/ruff-0.11.9-py3-none-win_amd64.whl", hash = "sha256:52edaa4a6d70f8180343a5b7f030c7edd36ad180c9f4d224959c2d689962d964", size = 11634340 },
|
|
92
|
+
{ url = "https://files.pythonhosted.org/packages/40/f7/70aad26e5877c8f7ee5b161c4c9fa0100e63fc4c944dc6d97b9c7e871417/ruff-0.11.9-py3-none-win_arm64.whl", hash = "sha256:bcf42689c22f2e240f496d0c183ef2c6f7b35e809f12c1db58f75d9aa8d630ca", size = 10741080 },
|
|
93
|
+
]
|
|
94
|
+
|
|
95
|
+
[[package]]
|
|
96
|
+
name = "spyrrow"
|
|
97
|
+
source = { editable = "." }
|
|
98
|
+
|
|
99
|
+
[package.dev-dependencies]
|
|
100
|
+
dev = [
|
|
101
|
+
{ name = "pytest" },
|
|
102
|
+
{ name = "ruff" },
|
|
103
|
+
]
|
|
104
|
+
|
|
105
|
+
[package.metadata]
|
|
106
|
+
|
|
107
|
+
[package.metadata.requires-dev]
|
|
108
|
+
dev = [
|
|
109
|
+
{ name = "pytest", specifier = ">=8.3.4" },
|
|
110
|
+
{ name = "ruff", specifier = ">=0.9.7" },
|
|
111
|
+
]
|
|
112
|
+
|
|
113
|
+
[[package]]
|
|
114
|
+
name = "tomli"
|
|
115
|
+
version = "2.2.1"
|
|
116
|
+
source = { registry = "https://pypi.org/simple" }
|
|
117
|
+
sdist = { url = "https://files.pythonhosted.org/packages/18/87/302344fed471e44a87289cf4967697d07e532f2421fdaf868a303cbae4ff/tomli-2.2.1.tar.gz", hash = "sha256:cd45e1dc79c835ce60f7404ec8119f2eb06d38b1deba146f07ced3bbc44505ff", size = 17175 }
|
|
118
|
+
wheels = [
|
|
119
|
+
{ url = "https://files.pythonhosted.org/packages/43/ca/75707e6efa2b37c77dadb324ae7d9571cb424e61ea73fad7c56c2d14527f/tomli-2.2.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:678e4fa69e4575eb77d103de3df8a895e1591b48e740211bd1067378c69e8249", size = 131077 },
|
|
120
|
+
{ url = "https://files.pythonhosted.org/packages/c7/16/51ae563a8615d472fdbffc43a3f3d46588c264ac4f024f63f01283becfbb/tomli-2.2.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:023aa114dd824ade0100497eb2318602af309e5a55595f76b626d6d9f3b7b0a6", size = 123429 },
|
|
121
|
+
{ url = "https://files.pythonhosted.org/packages/f1/dd/4f6cd1e7b160041db83c694abc78e100473c15d54620083dbd5aae7b990e/tomli-2.2.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ece47d672db52ac607a3d9599a9d48dcb2f2f735c6c2d1f34130085bb12b112a", size = 226067 },
|
|
122
|
+
{ url = "https://files.pythonhosted.org/packages/a9/6b/c54ede5dc70d648cc6361eaf429304b02f2871a345bbdd51e993d6cdf550/tomli-2.2.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6972ca9c9cc9f0acaa56a8ca1ff51e7af152a9f87fb64623e31d5c83700080ee", size = 236030 },
|
|
123
|
+
{ url = "https://files.pythonhosted.org/packages/1f/47/999514fa49cfaf7a92c805a86c3c43f4215621855d151b61c602abb38091/tomli-2.2.1-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c954d2250168d28797dd4e3ac5cf812a406cd5a92674ee4c8f123c889786aa8e", size = 240898 },
|
|
124
|
+
{ url = "https://files.pythonhosted.org/packages/73/41/0a01279a7ae09ee1573b423318e7934674ce06eb33f50936655071d81a24/tomli-2.2.1-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:8dd28b3e155b80f4d54beb40a441d366adcfe740969820caf156c019fb5c7ec4", size = 229894 },
|
|
125
|
+
{ url = "https://files.pythonhosted.org/packages/55/18/5d8bc5b0a0362311ce4d18830a5d28943667599a60d20118074ea1b01bb7/tomli-2.2.1-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:e59e304978767a54663af13c07b3d1af22ddee3bb2fb0618ca1593e4f593a106", size = 245319 },
|
|
126
|
+
{ url = "https://files.pythonhosted.org/packages/92/a3/7ade0576d17f3cdf5ff44d61390d4b3febb8a9fc2b480c75c47ea048c646/tomli-2.2.1-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:33580bccab0338d00994d7f16f4c4ec25b776af3ffaac1ed74e0b3fc95e885a8", size = 238273 },
|
|
127
|
+
{ url = "https://files.pythonhosted.org/packages/72/6f/fa64ef058ac1446a1e51110c375339b3ec6be245af9d14c87c4a6412dd32/tomli-2.2.1-cp311-cp311-win32.whl", hash = "sha256:465af0e0875402f1d226519c9904f37254b3045fc5084697cefb9bdde1ff99ff", size = 98310 },
|
|
128
|
+
{ url = "https://files.pythonhosted.org/packages/6a/1c/4a2dcde4a51b81be3530565e92eda625d94dafb46dbeb15069df4caffc34/tomli-2.2.1-cp311-cp311-win_amd64.whl", hash = "sha256:2d0f2fdd22b02c6d81637a3c95f8cd77f995846af7414c5c4b8d0545afa1bc4b", size = 108309 },
|
|
129
|
+
{ url = "https://files.pythonhosted.org/packages/52/e1/f8af4c2fcde17500422858155aeb0d7e93477a0d59a98e56cbfe75070fd0/tomli-2.2.1-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:4a8f6e44de52d5e6c657c9fe83b562f5f4256d8ebbfe4ff922c495620a7f6cea", size = 132762 },
|
|
130
|
+
{ url = "https://files.pythonhosted.org/packages/03/b8/152c68bb84fc00396b83e7bbddd5ec0bd3dd409db4195e2a9b3e398ad2e3/tomli-2.2.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:8d57ca8095a641b8237d5b079147646153d22552f1c637fd3ba7f4b0b29167a8", size = 123453 },
|
|
131
|
+
{ url = "https://files.pythonhosted.org/packages/c8/d6/fc9267af9166f79ac528ff7e8c55c8181ded34eb4b0e93daa767b8841573/tomli-2.2.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4e340144ad7ae1533cb897d406382b4b6fede8890a03738ff1683af800d54192", size = 233486 },
|
|
132
|
+
{ url = "https://files.pythonhosted.org/packages/5c/51/51c3f2884d7bab89af25f678447ea7d297b53b5a3b5730a7cb2ef6069f07/tomli-2.2.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:db2b95f9de79181805df90bedc5a5ab4c165e6ec3fe99f970d0e302f384ad222", size = 242349 },
|
|
133
|
+
{ url = "https://files.pythonhosted.org/packages/ab/df/bfa89627d13a5cc22402e441e8a931ef2108403db390ff3345c05253935e/tomli-2.2.1-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:40741994320b232529c802f8bc86da4e1aa9f413db394617b9a256ae0f9a7f77", size = 252159 },
|
|
134
|
+
{ url = "https://files.pythonhosted.org/packages/9e/6e/fa2b916dced65763a5168c6ccb91066f7639bdc88b48adda990db10c8c0b/tomli-2.2.1-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:400e720fe168c0f8521520190686ef8ef033fb19fc493da09779e592861b78c6", size = 237243 },
|
|
135
|
+
{ url = "https://files.pythonhosted.org/packages/b4/04/885d3b1f650e1153cbb93a6a9782c58a972b94ea4483ae4ac5cedd5e4a09/tomli-2.2.1-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:02abe224de6ae62c19f090f68da4e27b10af2b93213d36cf44e6e1c5abd19fdd", size = 259645 },
|
|
136
|
+
{ url = "https://files.pythonhosted.org/packages/9c/de/6b432d66e986e501586da298e28ebeefd3edc2c780f3ad73d22566034239/tomli-2.2.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:b82ebccc8c8a36f2094e969560a1b836758481f3dc360ce9a3277c65f374285e", size = 244584 },
|
|
137
|
+
{ url = "https://files.pythonhosted.org/packages/1c/9a/47c0449b98e6e7d1be6cbac02f93dd79003234ddc4aaab6ba07a9a7482e2/tomli-2.2.1-cp312-cp312-win32.whl", hash = "sha256:889f80ef92701b9dbb224e49ec87c645ce5df3fa2cc548664eb8a25e03127a98", size = 98875 },
|
|
138
|
+
{ url = "https://files.pythonhosted.org/packages/ef/60/9b9638f081c6f1261e2688bd487625cd1e660d0a85bd469e91d8db969734/tomli-2.2.1-cp312-cp312-win_amd64.whl", hash = "sha256:7fc04e92e1d624a4a63c76474610238576942d6b8950a2d7f908a340494e67e4", size = 109418 },
|
|
139
|
+
{ url = "https://files.pythonhosted.org/packages/04/90/2ee5f2e0362cb8a0b6499dc44f4d7d48f8fff06d28ba46e6f1eaa61a1388/tomli-2.2.1-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:f4039b9cbc3048b2416cc57ab3bda989a6fcf9b36cf8937f01a6e731b64f80d7", size = 132708 },
|
|
140
|
+
{ url = "https://files.pythonhosted.org/packages/c0/ec/46b4108816de6b385141f082ba99e315501ccd0a2ea23db4a100dd3990ea/tomli-2.2.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:286f0ca2ffeeb5b9bd4fcc8d6c330534323ec51b2f52da063b11c502da16f30c", size = 123582 },
|
|
141
|
+
{ url = "https://files.pythonhosted.org/packages/a0/bd/b470466d0137b37b68d24556c38a0cc819e8febe392d5b199dcd7f578365/tomli-2.2.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a92ef1a44547e894e2a17d24e7557a5e85a9e1d0048b0b5e7541f76c5032cb13", size = 232543 },
|
|
142
|
+
{ url = "https://files.pythonhosted.org/packages/d9/e5/82e80ff3b751373f7cead2815bcbe2d51c895b3c990686741a8e56ec42ab/tomli-2.2.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9316dc65bed1684c9a98ee68759ceaed29d229e985297003e494aa825ebb0281", size = 241691 },
|
|
143
|
+
{ url = "https://files.pythonhosted.org/packages/05/7e/2a110bc2713557d6a1bfb06af23dd01e7dde52b6ee7dadc589868f9abfac/tomli-2.2.1-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e85e99945e688e32d5a35c1ff38ed0b3f41f43fad8df0bdf79f72b2ba7bc5272", size = 251170 },
|
|
144
|
+
{ url = "https://files.pythonhosted.org/packages/64/7b/22d713946efe00e0adbcdfd6d1aa119ae03fd0b60ebed51ebb3fa9f5a2e5/tomli-2.2.1-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:ac065718db92ca818f8d6141b5f66369833d4a80a9d74435a268c52bdfa73140", size = 236530 },
|
|
145
|
+
{ url = "https://files.pythonhosted.org/packages/38/31/3a76f67da4b0cf37b742ca76beaf819dca0ebef26d78fc794a576e08accf/tomli-2.2.1-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:d920f33822747519673ee656a4b6ac33e382eca9d331c87770faa3eef562aeb2", size = 258666 },
|
|
146
|
+
{ url = "https://files.pythonhosted.org/packages/07/10/5af1293da642aded87e8a988753945d0cf7e00a9452d3911dd3bb354c9e2/tomli-2.2.1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:a198f10c4d1b1375d7687bc25294306e551bf1abfa4eace6650070a5c1ae2744", size = 243954 },
|
|
147
|
+
{ url = "https://files.pythonhosted.org/packages/5b/b9/1ed31d167be802da0fc95020d04cd27b7d7065cc6fbefdd2f9186f60d7bd/tomli-2.2.1-cp313-cp313-win32.whl", hash = "sha256:d3f5614314d758649ab2ab3a62d4f2004c825922f9e370b29416484086b264ec", size = 98724 },
|
|
148
|
+
{ url = "https://files.pythonhosted.org/packages/c7/32/b0963458706accd9afcfeb867c0f9175a741bf7b19cd424230714d722198/tomli-2.2.1-cp313-cp313-win_amd64.whl", hash = "sha256:a38aa0308e754b0e3c67e344754dff64999ff9b513e691d0e786265c93583c69", size = 109383 },
|
|
149
|
+
{ url = "https://files.pythonhosted.org/packages/6e/c2/61d3e0f47e2b74ef40a68b9e6ad5984f6241a942f7cd3bbfbdbd03861ea9/tomli-2.2.1-py3-none-any.whl", hash = "sha256:cb55c73c5f4408779d0cf3eef9f762b9c9f147a77de7b258bef0a5628adc85cc", size = 14257 },
|
|
150
|
+
]
|
|
151
|
+
|
|
152
|
+
[[package]]
|
|
153
|
+
name = "typing-extensions"
|
|
154
|
+
version = "4.13.2"
|
|
155
|
+
source = { registry = "https://pypi.org/simple" }
|
|
156
|
+
sdist = { url = "https://files.pythonhosted.org/packages/f6/37/23083fcd6e35492953e8d2aaaa68b860eb422b34627b13f2ce3eb6106061/typing_extensions-4.13.2.tar.gz", hash = "sha256:e6c81219bd689f51865d9e372991c540bda33a0379d5573cddb9a3a23f7caaef", size = 106967 }
|
|
157
|
+
wheels = [
|
|
158
|
+
{ url = "https://files.pythonhosted.org/packages/8b/54/b1ae86c0973cc6f0210b53d508ca3641fb6d0c56823f288d108bc7ab3cc8/typing_extensions-4.13.2-py3-none-any.whl", hash = "sha256:a439e7c04b49fec3e5d3e2beaa21755cadbbdc391694e28ccdd36ca4a1408f8c", size = 45806 },
|
|
159
|
+
]
|
spyrrow-0.1.0/spyrrow.pyi
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
from typing import TypeAlias
|
|
2
|
-
|
|
3
|
-
Point: TypeAlias = tuple[float,float]
|
|
4
|
-
|
|
5
|
-
ItemId: TypeAlias = int
|
|
6
|
-
|
|
7
|
-
class Item:
|
|
8
|
-
demand:int
|
|
9
|
-
shape:list[Point]
|
|
10
|
-
allowed_orientations: list[float] |None
|
|
11
|
-
|
|
12
|
-
def __init__(self, shape:list[Point], demand:int,allowed_orientations: list[float] |None): ...
|
|
13
|
-
|
|
14
|
-
class PlacedItem:
|
|
15
|
-
id:int
|
|
16
|
-
shape:list[Point]
|
|
17
|
-
translation: Point
|
|
18
|
-
rotation:float
|
|
19
|
-
|
|
20
|
-
class StripPackingSolution:
|
|
21
|
-
width: float
|
|
22
|
-
density: float
|
|
23
|
-
placed_items: list[PlacedItem]
|
|
24
|
-
|
|
25
|
-
class StripPackingInstance:
|
|
26
|
-
name:str
|
|
27
|
-
height:float
|
|
28
|
-
items: list[Item]
|
|
29
|
-
|
|
30
|
-
def __init__(self, name:str, height:float, items:list[Item]): ...
|
|
31
|
-
|
|
32
|
-
def solve(self, computation_time:int|None)-> StripPackingSolution: ...
|
spyrrow-0.1.0/uv.lock
DELETED
|
File without changes
|
|
File without changes
|
|
File without changes
|