From 0e04633f618b34e8e946f58f8fc90a78520c2973 Mon Sep 17 00:00:00 2001 From: Jan Petykiewicz Date: Thu, 10 Sep 2020 20:37:19 -0700 Subject: [PATCH] Force use of keyword args on most constructors --- masque/label.py | 1 + masque/pattern.py | 1 + masque/shapes/arc.py | 1 + masque/shapes/circle.py | 1 + masque/shapes/ellipse.py | 1 + masque/shapes/path.py | 1 + masque/shapes/polygon.py | 1 + masque/shapes/text.py | 1 + masque/subpattern.py | 1 + 9 files changed, 9 insertions(+) diff --git a/masque/label.py b/masque/label.py index f157f46..96c5aa1 100644 --- a/masque/label.py +++ b/masque/label.py @@ -40,6 +40,7 @@ class Label(PositionableImpl, LayerableImpl, LockableImpl, RepeatableImpl, Annot def __init__(self, string: str, + *, offset: vector2 = (0.0, 0.0), layer: layer_t = 0, repetition: Optional[Repetition] = None, diff --git a/masque/pattern.py b/masque/pattern.py index de7ecd2..5a7dd01 100644 --- a/masque/pattern.py +++ b/masque/pattern.py @@ -50,6 +50,7 @@ class Pattern(LockableImpl, AnnotatableImpl, metaclass=AutoSlots): def __init__(self, name: str = '', + *, shapes: Sequence[Shape] = (), labels: Sequence[Label] = (), subpatterns: Sequence[SubPattern] = (), diff --git a/masque/shapes/arc.py b/masque/shapes/arc.py index ea9b4c7..6f75e7e 100644 --- a/masque/shapes/arc.py +++ b/masque/shapes/arc.py @@ -154,6 +154,7 @@ class Arc(Shape, metaclass=AutoSlots): radii: vector2, angles: vector2, width: float, + *, poly_num_points: Optional[int] = DEFAULT_POLY_NUM_POINTS, poly_max_arclen: Optional[float] = None, offset: vector2 = (0.0, 0.0), diff --git a/masque/shapes/circle.py b/masque/shapes/circle.py index 447145f..b3e07ae 100644 --- a/masque/shapes/circle.py +++ b/masque/shapes/circle.py @@ -44,6 +44,7 @@ class Circle(Shape, metaclass=AutoSlots): def __init__(self, radius: float, + *, poly_num_points: Optional[int] = DEFAULT_POLY_NUM_POINTS, poly_max_arclen: Optional[float] = None, offset: vector2 = (0.0, 0.0), diff --git a/masque/shapes/ellipse.py b/masque/shapes/ellipse.py index 0b73dd1..b2ceec6 100644 --- a/masque/shapes/ellipse.py +++ b/masque/shapes/ellipse.py @@ -89,6 +89,7 @@ class Ellipse(Shape, metaclass=AutoSlots): def __init__(self, radii: vector2, + *, poly_num_points: Optional[int] = DEFAULT_POLY_NUM_POINTS, poly_max_arclen: Optional[float] = None, offset: vector2 = (0.0, 0.0), diff --git a/masque/shapes/path.py b/masque/shapes/path.py index 4d11d9e..b25f464 100644 --- a/masque/shapes/path.py +++ b/masque/shapes/path.py @@ -143,6 +143,7 @@ class Path(Shape, metaclass=AutoSlots): def __init__(self, vertices: numpy.ndarray, width: float = 0.0, + *, cap: PathCap = PathCap.Flush, cap_extensions: numpy.ndarray = None, offset: vector2 = (0.0, 0.0), diff --git a/masque/shapes/polygon.py b/masque/shapes/polygon.py index 24d609c..c11b662 100644 --- a/masque/shapes/polygon.py +++ b/masque/shapes/polygon.py @@ -73,6 +73,7 @@ class Polygon(Shape, metaclass=AutoSlots): def __init__(self, vertices: numpy.ndarray, + *, offset: vector2 = (0.0, 0.0), rotation: float = 0.0, mirrored: Sequence[bool] = (False, False), diff --git a/masque/shapes/text.py b/masque/shapes/text.py index c8af2cc..debd994 100644 --- a/masque/shapes/text.py +++ b/masque/shapes/text.py @@ -64,6 +64,7 @@ class Text(RotatableImpl, Shape, metaclass=AutoSlots): string: str, height: float, font_path: str, + *, offset: vector2 = (0.0, 0.0), rotation: float = 0.0, mirrored: Tuple[bool, bool] = (False, False), diff --git a/masque/subpattern.py b/masque/subpattern.py index 6462cff..6d0c2a9 100644 --- a/masque/subpattern.py +++ b/masque/subpattern.py @@ -45,6 +45,7 @@ class SubPattern(PositionableImpl, DoseableImpl, RotatableImpl, ScalableImpl, Mi def __init__(self, pattern: Optional['Pattern'], + *, offset: vector2 = (0.0, 0.0), rotation: float = 0.0, mirrored: Optional[Sequence[bool]] = None,