1- from itertools import chain
2- from typing import List , Optional
1+ from typing import Iterable , List , Optional
32
3+ from comb_spec_searcher import Rule
44from permuta import Perm
55from tilings import Tiling
66from tilings .algorithms import (CellInsertion , ColInsertion , CrossingInsertion ,
1111def all_cell_insertions (tiling : Tiling , maxreqlen : int = 1 , extra_basis :
1212 Optional [List [Perm ]] = None ,
1313 ignore_parent : bool = False ,
14- ** kwargs ):
14+ ** kwargs ) -> Iterable [ Rule ] :
1515 """
1616 The cell insertion strategy.
1717
@@ -25,7 +25,7 @@ def all_cell_insertions(tiling: Tiling, maxreqlen: int = 1, extra_basis:
2525 extra_basis ).rules (ignore_parent )
2626
2727
28- def root_requirement_insertion (tiling , ** kwargs ):
28+ def root_requirement_insertion (tiling , ** kwargs ) -> Iterable [ Rule ] :
2929 """
3030 The cell insertion strategy performed only on 1 by 1 tilings.
3131 """
@@ -34,7 +34,7 @@ def root_requirement_insertion(tiling, **kwargs):
3434 yield from all_cell_insertions (tiling , ** kwargs )
3535
3636
37- def all_point_insertions (tiling , ** kwargs ):
37+ def all_point_insertions (tiling , ** kwargs ) -> Iterable [ Rule ] :
3838 """
3939 The cell insertion strategy using only points.
4040 """
@@ -43,28 +43,31 @@ def all_point_insertions(tiling, **kwargs):
4343
4444def all_requirement_extensions (tiling : Tiling , maxreqlen : int = 2 ,
4545 extra_basis : Optional [List [Perm ]] = None ,
46- ignore_parent : bool = False , ** kwargs ):
46+ ignore_parent : bool = False ,
47+ ** kwargs ) -> Iterable [Rule ]:
4748 """
4849 Insert longer requirements in to cells which contain a requirement
4950 """
5051 yield from RequirementExtension (tiling , maxreqlen ,
5152 extra_basis ).rules (ignore_parent )
5253
5354
54- def all_row_insertions (tiling : Tiling , ignore_parent : bool = False , ** kwargs ):
55+ def all_row_insertions (tiling : Tiling , ignore_parent : bool = False ,
56+ ** kwargs ) -> Iterable [Rule ]:
5557 """Insert a list requirement into every possibly empty row."""
5658 yield from RowInsertion (tiling ).rules (ignore_parent )
5759
5860
59- def all_col_insertions (tiling , ignore_parent : bool = False , ** kwargs ):
61+ def all_col_insertions (tiling , ignore_parent : bool = False ,
62+ ** kwargs ) -> Iterable [Rule ]:
6063 """Insert a list requirement into every possibly empty column."""
6164 yield from ColInsertion (tiling ).rules (ignore_parent )
6265
6366
6467def all_requirement_insertions (tiling : Tiling , maxreqlen : int = 1 ,
6568 extra_basis : Optional [List [Perm ]] = None ,
6669 ignore_parent : bool = False ,
67- ** kwargs ):
70+ ** kwargs ) -> Iterable [ Rule ] :
6871 """
6972 Insert all possible requirements the obstruction allows if the tiling does
7073 not have requirements.
@@ -76,7 +79,7 @@ def all_requirement_insertions(tiling: Tiling, maxreqlen: int = 1,
7679
7780
7881def all_factor_insertions (tiling : Tiling , ignore_parent : bool = False ,
79- ** kwargs ):
82+ ** kwargs ) -> Iterable [ Rule ] :
8083 """
8184 Insert all proper factor of the requirement or obstructions on the tiling.
8285 """
0 commit comments