Skip to content

Commit 10cb74d

Browse files
authoredDec 28, 2019
Merge pull request #20 from unmade/boards
Rename `entities` -> `boards`
2 parents 40d1dcc + c2767d4 commit 10cb74d

14 files changed

+23
-16
lines changed
 

‎README.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ For example to see all techniques that sudoku has:
6666
.. code-block:: python
6767
6868
from dokusan import solvers
69-
from dokusan.entities import BoxSize, Sudoku
69+
from dokusan.boards import BoxSize, Sudoku
7070
7171
7272
sudoku = Sudoku.from_list(
@@ -95,7 +95,7 @@ however slightly modified to work fast
9595
.. code-block:: python
9696
9797
from dokusan import solvers, renderers
98-
from dokusan.entities import BoxSize, Sudoku
98+
from dokusan.boards import BoxSize, Sudoku
9999
100100
101101
sudoku = Sudoku.from_list(

‎pyproject.toml

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "dokusan"
3-
version = "0.1.0-alpha.5"
3+
version = "0.1.0-alpha.6"
44
description = "Sudoku generator and solver with a step-by-step guidance"
55
keywords = ["sudoku", "sudoku-solver", "sudoku-generator", "solver", "generator"]
66
readme = "README.rst"
@@ -29,6 +29,8 @@ pre-commit = "^1.20"
2929
line_length = 88
3030
multi_line_output = 3
3131
include_trailing_comma = true
32+
known_first_party = ["dokusan"]
33+
default_section = "THIRDPARTY"
3234

3335
[build-system]
3436
requires = ["poetry>=0.12"]
File renamed without changes.

‎src/dokusan/generators.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from typing import List
33

44
from dokusan import exceptions, solvers, stats
5-
from dokusan.entities import BoxSize, Cell, Position, Sudoku
5+
from dokusan.boards import BoxSize, Cell, Position, Sudoku
66

77
MAX_ITERATIONS = 300
88

@@ -37,10 +37,10 @@ def _random_initial_cells(box_size: BoxSize) -> List[Cell]:
3737
for i in range(box_size.width)
3838
]
3939

40-
while True:
40+
while True: # pragma: no branch
4141
row_values = random.sample(all_values - set(box_values[0]), k=box_size.length)
4242
used_values = [sorted(box_values[i]) for i in range(1, box_size.width)]
43-
if sorted(row_values) not in used_values: # pragma: no cover
43+
if sorted(row_values) not in used_values:
4444
break
4545

4646
row_values += random.sample(

‎src/dokusan/renderers.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from enum import Enum
22
from typing import List, NamedTuple, Protocol
33

4-
from dokusan.entities import BoxSize, Cell, Sudoku
4+
from dokusan.boards import BoxSize, Cell, Sudoku
55

66

77
class Color(Protocol):

‎src/dokusan/solvers.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from typing import Iterator
33

44
from dokusan import exceptions, techniques
5-
from dokusan.entities import Cell, Sudoku
5+
from dokusan.boards import Cell, Sudoku
66
from dokusan.techniques import Step
77

88

‎src/dokusan/stats.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import operator
22

33
from dokusan import exceptions, solvers
4-
from dokusan.entities import Cell, Sudoku
4+
from dokusan.boards import Cell, Sudoku
55

66

77
def rank(sudoku: Sudoku) -> int:

‎src/dokusan/techniques.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from dataclasses import dataclass
77
from typing import Dict, Iterable, Iterator, List, Optional, Set, Tuple
88

9-
from dokusan.entities import Cell, Sudoku
9+
from dokusan.boards import Cell, Sudoku
1010

1111

1212
class NotFound(Exception):

‎tests/test_entities.py ‎tests/test_boards.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import operator
22

33
import pytest
4-
from dokusan.entities import BoxSize, Cell, Position, Sudoku
4+
5+
from dokusan.boards import BoxSize, Cell, Position, Sudoku
56

67

78
@pytest.fixture

‎tests/test_generators.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import pytest
2+
23
from dokusan import generators
3-
from dokusan.entities import BoxSize, Sudoku
4+
from dokusan.boards import BoxSize, Sudoku
45

56

67
@pytest.mark.slow

‎tests/test_renderers.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from dokusan import renderers, techniques
2-
from dokusan.entities import BoxSize, Sudoku
2+
from dokusan.boards import BoxSize, Sudoku
33

44

55
def test_plain():

‎tests/test_solvers.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import pytest
2+
23
from dokusan import exceptions, solvers
3-
from dokusan.entities import BoxSize, Sudoku
4+
from dokusan.boards import BoxSize, Sudoku
45

56

67
def test_eliminate():

‎tests/test_stats.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import pytest
2+
23
from dokusan import exceptions, stats
3-
from dokusan.entities import BoxSize, Sudoku
4+
from dokusan.boards import BoxSize, Sudoku
45

56

67
@pytest.mark.parametrize(

‎tests/test_techniques.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22
from typing import List
33

44
import pytest
5+
56
from dokusan import techniques
6-
from dokusan.entities import BoxSize, Cell, Position, Sudoku
7+
from dokusan.boards import BoxSize, Cell, Position, Sudoku
78

89

910
def make_sudoku_with_marks(puzzle: List[List[int]], box_size: BoxSize) -> Sudoku:

0 commit comments

Comments
 (0)
Please sign in to comment.