Allow b_count=None

This commit is contained in:
Jan Petykiewicz 2020-05-17 23:00:25 -07:00
parent 22b2834d55
commit d7a8bd7e0d

View File

@ -102,7 +102,7 @@ class GridRepetition:
a_vector: numpy.ndarray, a_vector: numpy.ndarray,
a_count: int, a_count: int,
b_vector: Optional[numpy.ndarray] = None, b_vector: Optional[numpy.ndarray] = None,
b_count: int = 1, b_count: Optional[int] = 1,
offset: vector2 = (0.0, 0.0), offset: vector2 = (0.0, 0.0),
rotation: float = 0.0, rotation: float = 0.0,
mirrored: Optional[Sequence[bool]] = None, mirrored: Optional[Sequence[bool]] = None,
@ -134,6 +134,9 @@ class GridRepetition:
PatternError if `b_*` inputs conflict with each other PatternError if `b_*` inputs conflict with each other
or `a_count < 1`. or `a_count < 1`.
""" """
if b_count is None:
b_count = 1
if b_vector is None: if b_vector is None:
if b_count > 1: if b_count > 1:
raise PatternError('Repetition has b_count > 1 but no b_vector') raise PatternError('Repetition has b_count > 1 but no b_vector')