Skip to content

Commit

Permalink
Merge pull request #28 from jwg4/exact_cover_1.0
Browse files Browse the repository at this point in the history
Update exact cover requirement to 1.0
  • Loading branch information
jwg4 authored Nov 11, 2023
2 parents a6b2012 + 3b7fbd7 commit 202551d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
6 changes: 5 additions & 1 deletion polyomino/problem.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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)
Expand Down
9 changes: 5 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,28 +1,29 @@
[tool.poetry]
name = "polyomino"
version = "0.6.6"
version = "0.7.0"
description = "Solve polyomino tiling problems."
readme = "README.md"
authors = ["Jack Grahl <[email protected]>"]
license = "MIT"

[tool.poetry.dependencies]
python = "^3.7.1"
exact-cover = "0.4.3"
numpy = "^1.20"
exact-cover = "1.3.0"
pretty-poly = "0.2.0"

[tool.poetry.dev-dependencies]
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"

0 comments on commit 202551d

Please sign in to comment.