From 2516f06e401a17702f5039719d0b50aed00c5663 Mon Sep 17 00:00:00 2001 From: jan Date: Sat, 18 Nov 2023 12:28:33 -0800 Subject: [PATCH 1/3] add missing returns --- masque/builder/builder.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/masque/builder/builder.py b/masque/builder/builder.py index 1fbbe88..bc837f6 100644 --- a/masque/builder/builder.py +++ b/masque/builder/builder.py @@ -192,22 +192,27 @@ class Builder(PortList): @wraps(Pattern.label) def label(self, *args, **kwargs) -> Self: self.pattern.label(*args, **kwargs) + return self @wraps(Pattern.ref) def ref(self, *args, **kwargs) -> Self: self.pattern.ref(*args, **kwargs) + return self @wraps(Pattern.polygon) def polygon(self, *args, **kwargs) -> Self: self.pattern.polygon(*args, **kwargs) + return self @wraps(Pattern.rect) def rect(self, *args, **kwargs) -> Self: self.pattern.rect(*args, **kwargs) + return self @wraps(Pattern.path) def path(self, *args, **kwargs) -> Self: self.pattern.path(*args, **kwargs) + return self def plug( self, From 33529f5ed300b9e1cab657429fde0689c6d7b053 Mon Sep 17 00:00:00 2001 From: jan Date: Sat, 18 Nov 2023 12:28:51 -0800 Subject: [PATCH 2/3] pattern shouldn't have an offset --- masque/pattern.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/masque/pattern.py b/masque/pattern.py index bb077be..0d98164 100644 --- a/masque/pattern.py +++ b/masque/pattern.py @@ -87,7 +87,7 @@ class Pattern(PortList, AnnotatableImpl, Mirrorable): __slots__ = ( 'shapes', 'labels', 'refs', '_ports', # inherited - '_offset', '_annotations', + '_annotations', ) shapes: defaultdict[layer_t, list[Shape]] From 24c77fd3c3f1c55d33d75a0a5aadcb308718e2eb Mon Sep 17 00:00:00 2001 From: jan Date: Sat, 18 Nov 2023 12:29:36 -0800 Subject: [PATCH 3/3] remove custom __copy__ no longer necessary now that we're not locking anything --- masque/shapes/shape.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/masque/shapes/shape.py b/masque/shapes/shape.py index d65c05b..4263531 100644 --- a/masque/shapes/shape.py +++ b/masque/shapes/shape.py @@ -1,4 +1,4 @@ -from typing import Callable, Self, TYPE_CHECKING +from typing import Callable, TYPE_CHECKING, Any from abc import ABCMeta, abstractmethod import numpy @@ -32,12 +32,12 @@ class Shape(PositionableImpl, Rotatable, Mirrorable, Copyable, Scalable, """ __slots__ = () # Children should use AutoSlots or set slots themselves - def __copy__(self) -> Self: - cls = self.__class__ - new = cls.__new__(cls) - for name in self.__slots__: # type: str - object.__setattr__(new, name, getattr(self, name)) - return new + #def __copy__(self) -> Self: + # cls = self.__class__ + # new = cls.__new__(cls) + # for name in self.__slots__: # type: str + # object.__setattr__(new, name, getattr(self, name)) + # return new # # Methods (abstract)