Skip to content

Commit 7d8625e

Browse files
committed
refactoring of the command line interface, moved requirements to pyproject.toml, added example problem, fixed tests
1 parent 38184fd commit 7d8625e

7 files changed

Lines changed: 337 additions & 183 deletions

File tree

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,6 @@ __pycache__/
1111
# Coverage reports
1212
.coverage
1313
htmlcov/
14+
15+
# CLI output
16+
output/

examples/problem_60x60.json

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"problem": {
3+
"sheet_size": [60, 60],
4+
"items": [
5+
{"id": 0, "width": 3, "height": 3},
6+
{"id": 1, "width": 4, "height": 5},
7+
{"id": 2, "width": 5, "height": 4},
8+
{"id": 3, "width": 6, "height": 6}
9+
],
10+
"defects": [
11+
{"x": 5, "y": 5, "width": 2, "height": 2},
12+
{"x": 12, "y": 7, "width": 1, "height": 1},
13+
{"x": 18, "y": 10, "width": 3, "height": 1},
14+
{"x": 21, "y": 15, "width": 2, "height": 3},
15+
{"x": 30, "y": 20, "width": 1, "height": 2},
16+
{"x": 32, "y": 25, "width": 2, "height": 1},
17+
{"x": 38, "y": 28, "width": 3, "height": 1},
18+
{"x": 40, "y": 30, "width": 1, "height": 2},
19+
{"x": 47, "y": 35, "width": 2, "height": 3},
20+
{"x": 52, "y": 40, "width": 2, "height": 1}
21+
]
22+
}
23+
}

pyproject.toml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,24 @@ dependencies = [
1313
"matplotlib>=3.3.0",
1414
]
1515

16+
[project.scripts]
17+
guillotine = "guillotine.__main__:main"
18+
19+
[project.optional-dependencies]
20+
dev = [
21+
"pytest>=7.0.0",
22+
"pytest-cov>=4.0.0",
23+
"pytest-benchmark>=4.0.0",
24+
"pytest-xdist>=3.0.0",
25+
"hypothesis>=6.0.0",
26+
"black>=22.0.0",
27+
"flake8>=4.0.0",
28+
"mypy>=0.950",
29+
"coverage>=6.0.0",
30+
"build>=0.7.0",
31+
"ipython>=8.0.0",
32+
]
33+
1634
[tool.pytest.ini_options]
1735
minversion = "7.0"
1836
addopts = "-ra -q --strict-markers"

requirements-dev.txt

Lines changed: 0 additions & 12 deletions
This file was deleted.

requirements.txt

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)