From 4eee4d19e9cf66794a3867ba10eda8e54971d832 Mon Sep 17 00:00:00 2001 From: jan Date: Thu, 6 Apr 2023 17:03:31 -0700 Subject: [PATCH] cleanup --- masque/builder/builder.py | 4 ++-- masque/file/oasis.py | 6 +++--- masque/ref.py | 2 +- masque/shapes/shape.py | 2 +- masque/traits/annotatable.py | 1 - 5 files changed, 7 insertions(+), 8 deletions(-) diff --git a/masque/builder/builder.py b/masque/builder/builder.py index ab20d3d..8fce958 100644 --- a/masque/builder/builder.py +++ b/masque/builder/builder.py @@ -8,7 +8,7 @@ from numpy.typing import ArrayLike from ..pattern import Pattern from ..ref import Ref -from ..library import MutableLibrary, Tree +from ..library import MutableLibrary from ..error import PortError, BuildError from ..ports import PortList, Port from ..abstract import Abstract @@ -602,7 +602,7 @@ class Pather(Builder): library: MutableLibrary, base_name: str, *, - ports: str | Mapping[str, Port] | None= None, + ports: str | Mapping[str, Port] | None = None, tools: Tool | MutableMapping[str | None, Tool] | None = None, ) -> tuple['Pather', str]: """ Name-and-make combination """ diff --git a/masque/file/oasis.py b/masque/file/oasis.py index 714af3f..3a6db97 100644 --- a/masque/file/oasis.py +++ b/masque/file/oasis.py @@ -646,9 +646,9 @@ def repetition_fata2masq( def repetition_masq2fata( rep: Repetition | None, ) -> tuple[ - fatamorgana.GridRepetition | fatamorgana.ArbitraryRepetition | None, - tuple[int, int] - ]: + fatamorgana.GridRepetition | fatamorgana.ArbitraryRepetition | None, + tuple[int, int] + ]: frep: fatamorgana.GridRepetition | fatamorgana.ArbitraryRepetition | None if isinstance(rep, Grid): a_vector = rint_cast(rep.a_vector) diff --git a/masque/ref.py b/masque/ref.py index f490c41..d3bdc94 100644 --- a/masque/ref.py +++ b/masque/ref.py @@ -4,7 +4,7 @@ """ #TODO more top-level documentation -from typing import Sequence, Mapping, TYPE_CHECKING, Any, Self, cast +from typing import Sequence, Mapping, TYPE_CHECKING, Any, Self import copy import numpy diff --git a/masque/shapes/shape.py b/masque/shapes/shape.py index 0bd7087..b88a17b 100644 --- a/masque/shapes/shape.py +++ b/masque/shapes/shape.py @@ -33,7 +33,7 @@ class Shape(PositionableImpl, LayerableImpl, Rotatable, Mirrorable, Copyable, Sc """ __slots__ = () # Children should use AutoSlots - def __copy__(self) -> 'Shape': + def __copy__(self) -> Self: cls = self.__class__ new = cls.__new__(cls) for name in self.__slots__: # type: str diff --git a/masque/traits/annotatable.py b/masque/traits/annotatable.py index e36ceee..0060238 100644 --- a/masque/traits/annotatable.py +++ b/masque/traits/annotatable.py @@ -1,4 +1,3 @@ -from typing import Self #from types import MappingProxyType from abc import ABCMeta, abstractmethod