From eb7757428984727202c03a3196c7df10ef8b92ed Mon Sep 17 00:00:00 2001 From: Jack Grahl Date: Sun, 6 Mar 2022 12:15:04 +0000 Subject: [PATCH 1/5] Update exact cover requirement to 1.0" --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 7bc2135..51cbf1c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -8,7 +8,7 @@ license = "MIT" [tool.poetry.dependencies] python = "^3.7.1" -exact-cover = "0.4.3" +exact-cover = "1.0" numpy = "^1.20" pretty-poly = "0.2.0" From 81cfd6bf04c133c0d1fc9f2011e42e28c521639a Mon Sep 17 00:00:00 2001 From: Jack Grahl Date: Tue, 25 Oct 2022 19:36:13 +0100 Subject: [PATCH 2/5] Minor version. --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 51cbf1c..38031f8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "polyomino" -version = "0.6.6" +version = "0.7.0a0" description = "Solve polyomino tiling problems." readme = "README.md" authors = ["Jack Grahl "] From 8d0d94ad0a5f59b334e322cd7356f432790e3ef7 Mon Sep 17 00:00:00 2001 From: Jack Grahl Date: Sat, 11 Nov 2023 17:31:10 +0000 Subject: [PATCH 3/5] Catch NoSolution - exact_cover now throws. --- polyomino/problem.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/polyomino/problem.py b/polyomino/problem.py index 9c40c4a..5e4c9e2 100644 --- a/polyomino/problem.py +++ b/polyomino/problem.py @@ -1,6 +1,7 @@ import numpy as np from exact_cover import get_exact_cover +from exact_cover.error import NoSolution from .error import CantPlaceSinglePiece from .solution import Solution @@ -60,7 +61,10 @@ def make_problem(self): def solve(self): self.make_problem() - solution = get_exact_cover(self.array) + try: + solution = get_exact_cover(self.array) + except NoSolution: + return None tiling = [self.key[s] for s in solution] if tiling: return Solution(tiling, self.board) From b590a2bae2ecc3c222ade75a7b62ae412fb1a562 Mon Sep 17 00:00:00 2001 From: Jack Grahl Date: Sat, 11 Nov 2023 17:31:44 +0000 Subject: [PATCH 4/5] Update requirements. --- pyproject.toml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 38031f8..09a6c55 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -8,8 +8,7 @@ license = "MIT" [tool.poetry.dependencies] python = "^3.7.1" -exact-cover = "1.0" -numpy = "^1.20" +exact-cover = "1.3.0" pretty-poly = "0.2.0" [tool.poetry.dev-dependencies] @@ -17,12 +16,14 @@ pytest = "^6.2.1" hypothesis = "^6.0.2" pytest-profiling = "^1.7.0" black = "^21.6b0" -pytest-fail-slow = "^0.1.0" [tool.poetry.scripts] test = 'run_tests:run_tests' doctest = 'run_tests:run_doctests' +[tool.poetry.group.dev.dependencies] +pytest-fail-slow = ">=0.2.0,<0.3.0" + [build-system] requires = ["poetry-core>=1.0.0"] build-backend = "poetry.core.masonry.api" From 3b7fbd7f8c65b60e653a3971754d5937317dfc68 Mon Sep 17 00:00:00 2001 From: Jack Grahl Date: Sat, 11 Nov 2023 19:10:06 +0000 Subject: [PATCH 5/5] Version 0.7.0 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 09a6c55..112ac61 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "polyomino" -version = "0.7.0a0" +version = "0.7.0" description = "Solve polyomino tiling problems." readme = "README.md" authors = ["Jack Grahl "]