repetition related fixup
This commit is contained in:
parent
bab40474a0
commit
794ebb6b37
11 changed files with 112 additions and 68 deletions
|
|
@ -28,10 +28,10 @@ class Doseable(metaclass=ABCMeta):
|
|||
"""
|
||||
pass
|
||||
|
||||
@dose.setter
|
||||
@abstractmethod
|
||||
def dose(self, val: float):
|
||||
pass
|
||||
# @dose.setter
|
||||
# @abstractmethod
|
||||
# def dose(self, val: float):
|
||||
# pass
|
||||
|
||||
'''
|
||||
---- Methods
|
||||
|
|
|
|||
|
|
@ -25,12 +25,12 @@ class Layerable(metaclass=ABCMeta):
|
|||
"""
|
||||
Layer number or name (int, tuple of ints, or string)
|
||||
"""
|
||||
return self._layer
|
||||
pass
|
||||
|
||||
@layer.setter
|
||||
@abstractmethod
|
||||
def layer(self, val: layer_t):
|
||||
self._layer = val
|
||||
# @layer.setter
|
||||
# @abstractmethod
|
||||
# def layer(self, val: layer_t):
|
||||
# pass
|
||||
|
||||
'''
|
||||
---- Methods
|
||||
|
|
|
|||
|
|
@ -19,18 +19,6 @@ class Lockable(metaclass=ABCMeta):
|
|||
'''
|
||||
---- Methods
|
||||
'''
|
||||
def set_dose(self: T, dose: float) -> T:
|
||||
"""
|
||||
Set the dose
|
||||
|
||||
Args:
|
||||
dose: new value for dose
|
||||
|
||||
Returns:
|
||||
self
|
||||
"""
|
||||
pass
|
||||
|
||||
def lock(self: T) -> T:
|
||||
"""
|
||||
Lock the object, disallowing further changes
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ import numpy
|
|||
from ..error import PatternError, PatternLockedError
|
||||
|
||||
T = TypeVar('T', bound='Mirrorable')
|
||||
T = TypeVar('T', bound='MirrorableImpl')
|
||||
#I = TypeVar('I', bound='MirrorableImpl')
|
||||
|
||||
|
||||
class Mirrorable(metaclass=ABCMeta):
|
||||
|
|
|
|||
|
|
@ -30,10 +30,10 @@ class Positionable(metaclass=ABCMeta):
|
|||
"""
|
||||
pass
|
||||
|
||||
@offset.setter
|
||||
@abstractmethod
|
||||
def offset(self, val: vector2):
|
||||
pass
|
||||
# @offset.setter
|
||||
# @abstractmethod
|
||||
# def offset(self, val: vector2):
|
||||
# pass
|
||||
|
||||
'''
|
||||
--- Abstract methods
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
from typing import List, Tuple, Callable, TypeVar, Optional
|
||||
from typing import List, Tuple, Callable, TypeVar, Optional, TYPE_CHECKING
|
||||
from abc import ABCMeta, abstractmethod
|
||||
import copy
|
||||
import numpy
|
||||
|
|
@ -6,6 +6,10 @@ import numpy
|
|||
from ..error import PatternError, PatternLockedError
|
||||
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from ..repetition import Repetition
|
||||
|
||||
|
||||
T = TypeVar('T', bound='Repeatable')
|
||||
I = TypeVar('I', bound='RepeatableImpl')
|
||||
|
||||
|
|
@ -27,14 +31,15 @@ class Repeatable(metaclass=ABCMeta):
|
|||
"""
|
||||
pass
|
||||
|
||||
@repetition.setter
|
||||
@abstractmethod
|
||||
def repetition(self, repetition: Optional['Repetition']):
|
||||
pass
|
||||
# @repetition.setter
|
||||
# @abstractmethod
|
||||
# def repetition(self, repetition: Optional['Repetition']):
|
||||
# pass
|
||||
|
||||
'''
|
||||
---- Methods
|
||||
'''
|
||||
@abstractmethod
|
||||
def set_repetition(self: T, repetition: Optional['Repetition']) -> T:
|
||||
"""
|
||||
Set the repetition
|
||||
|
|
@ -74,6 +79,6 @@ class RepeatableImpl(Repeatable, metaclass=ABCMeta):
|
|||
'''
|
||||
---- Non-abstract methods
|
||||
'''
|
||||
def set_repetition(self: I, repetition: 'Repetition') -> I:
|
||||
def set_repetition(self: I, repetition: Optional['Repetition']) -> I:
|
||||
self.repetition = repetition
|
||||
return self
|
||||
|
|
|
|||
Loading…
Reference in a new issue