style and type fixes (per flake8)
could potentially fix some bugs in `Library` class and dxf reader
This commit is contained in:
parent
f6ad272c2c
commit
f364970403
31 changed files with 293 additions and 297 deletions
|
|
@ -1,7 +1,6 @@
|
|||
from typing import TypeVar
|
||||
from types import MappingProxyType
|
||||
#from types import MappingProxyType
|
||||
from abc import ABCMeta, abstractmethod
|
||||
import copy
|
||||
|
||||
from ..utils import annotations_t
|
||||
from ..error import PatternError
|
||||
|
|
@ -44,10 +43,10 @@ class AnnotatableImpl(Annotatable, metaclass=ABCMeta):
|
|||
'''
|
||||
@property
|
||||
def annotations(self) -> annotations_t:
|
||||
return self._annotations
|
||||
# # TODO: Find a way to make sure the subclass implements Lockable without dealing with diamond inheritance or this extra hasattr
|
||||
# if hasattr(self, 'is_locked') and self.is_locked():
|
||||
# return MappingProxyType(self._annotations)
|
||||
return self._annotations
|
||||
|
||||
@annotations.setter
|
||||
def annotations(self, annotations: annotations_t):
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
from typing import List, Tuple, Callable, TypeVar, Optional
|
||||
from abc import ABCMeta, abstractmethod
|
||||
from typing import TypeVar
|
||||
from abc import ABCMeta
|
||||
import copy
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,9 +1,7 @@
|
|||
from typing import List, Tuple, Callable, TypeVar, Optional
|
||||
from typing import TypeVar
|
||||
from abc import ABCMeta, abstractmethod
|
||||
import copy
|
||||
|
||||
from ..error import PatternError, PatternLockedError
|
||||
from ..utils import is_scalar
|
||||
from ..error import PatternError
|
||||
|
||||
|
||||
T = TypeVar('T', bound='Doseable')
|
||||
|
|
@ -70,7 +68,6 @@ class DoseableImpl(Doseable, metaclass=ABCMeta):
|
|||
raise PatternError('Dose must be non-negative')
|
||||
self._dose = val
|
||||
|
||||
|
||||
'''
|
||||
---- Non-abstract methods
|
||||
'''
|
||||
|
|
|
|||
|
|
@ -1,8 +1,6 @@
|
|||
from typing import List, Tuple, Callable, TypeVar, Optional
|
||||
from typing import TypeVar
|
||||
from abc import ABCMeta, abstractmethod
|
||||
import copy
|
||||
|
||||
from ..error import PatternError, PatternLockedError
|
||||
from ..utils import layer_t
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,7 @@
|
|||
from typing import List, Tuple, Callable, TypeVar, Optional
|
||||
from typing import TypeVar
|
||||
from abc import ABCMeta, abstractmethod
|
||||
import copy
|
||||
|
||||
from ..error import PatternError, PatternLockedError
|
||||
from ..error import PatternLockedError
|
||||
|
||||
|
||||
T = TypeVar('T', bound='Lockable')
|
||||
|
|
|
|||
|
|
@ -1,8 +1,5 @@
|
|||
from typing import List, Tuple, Callable, TypeVar, Optional
|
||||
from typing import TypeVar
|
||||
from abc import ABCMeta, abstractmethod
|
||||
import copy
|
||||
|
||||
from ..error import PatternError, PatternLockedError
|
||||
|
||||
|
||||
T = TypeVar('T', bound='Mirrorable')
|
||||
|
|
|
|||
|
|
@ -1,12 +1,11 @@
|
|||
# TODO top-level comment about how traits should set __slots__ = (), and how to use AutoSlots
|
||||
|
||||
from typing import List, Tuple, Callable, TypeVar, Optional
|
||||
from typing import TypeVar
|
||||
from abc import ABCMeta, abstractmethod
|
||||
import copy
|
||||
import numpy # type: ignore
|
||||
|
||||
from ..error import PatternError, PatternLockedError
|
||||
from ..utils import is_scalar, rotation_matrix_2d, vector2
|
||||
from ..error import PatternError
|
||||
from ..utils import vector2
|
||||
|
||||
|
||||
T = TypeVar('T', bound='Positionable')
|
||||
|
|
@ -101,7 +100,6 @@ class PositionableImpl(Positionable, metaclass=ABCMeta):
|
|||
raise PatternError('Offset must be convertible to size-2 ndarray')
|
||||
self._offset = val.flatten()
|
||||
|
||||
|
||||
'''
|
||||
---- Methods
|
||||
'''
|
||||
|
|
|
|||
|
|
@ -1,8 +1,7 @@
|
|||
from typing import List, Tuple, Callable, TypeVar, Optional, TYPE_CHECKING
|
||||
from typing import TypeVar, Optional, TYPE_CHECKING
|
||||
from abc import ABCMeta, abstractmethod
|
||||
import copy
|
||||
|
||||
from ..error import PatternError, PatternLockedError
|
||||
from ..error import PatternError
|
||||
|
||||
|
||||
if TYPE_CHECKING:
|
||||
|
|
|
|||
|
|
@ -1,12 +1,11 @@
|
|||
from typing import List, Tuple, Callable, TypeVar, Optional
|
||||
from typing import TypeVar
|
||||
from abc import ABCMeta, abstractmethod
|
||||
import copy
|
||||
|
||||
import numpy # type: ignore
|
||||
from numpy import pi
|
||||
|
||||
from .positionable import Positionable
|
||||
from ..error import PatternError, PatternLockedError
|
||||
#from .positionable import Positionable
|
||||
from ..error import PatternError
|
||||
from ..utils import is_scalar, rotation_matrix_2d, vector2
|
||||
|
||||
T = TypeVar('T', bound='Rotatable')
|
||||
|
|
|
|||
|
|
@ -1,8 +1,7 @@
|
|||
from typing import List, Tuple, Callable, TypeVar, Optional
|
||||
from typing import TypeVar
|
||||
from abc import ABCMeta, abstractmethod
|
||||
import copy
|
||||
|
||||
from ..error import PatternError, PatternLockedError
|
||||
from ..error import PatternError
|
||||
from ..utils import is_scalar
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue