From 2635c6c20cbeabde1a01616facd6bd53f3f0e7d5 Mon Sep 17 00:00:00 2001 From: Jan Petykiewicz Date: Wed, 18 Jan 2023 18:14:53 -0800 Subject: [PATCH] some type updates --- masque/builder/device_library.py | 4 ++-- masque/shapes/shape.py | 8 +++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/masque/builder/device_library.py b/masque/builder/device_library.py index d86a6cc..8e0cf40 100644 --- a/masque/builder/device_library.py +++ b/masque/builder/device_library.py @@ -22,7 +22,7 @@ DL2 = TypeVar('DL2', bound='LazyDeviceLibrary') LDL = TypeVar('LDL', bound='LibDeviceLibrary') -class LazyDeviceLibrary: +class LazyDeviceLibrary(Mapping[str, DeviceRef]): """ This class maps names to functions which generate or load the relevant `Device` object. @@ -61,7 +61,7 @@ class LazyDeviceLibrary: return iter(self.keys()) def __repr__(self) -> str: - return '' + return '' def get_device(self, key: str) -> Device: if self.enable_cache and key in self.cache: diff --git a/masque/shapes/shape.py b/masque/shapes/shape.py index 9eae34d..66f83db 100644 --- a/masque/shapes/shape.py +++ b/masque/shapes/shape.py @@ -15,9 +15,11 @@ if TYPE_CHECKING: # Type definitions -normalized_shape_tuple = Tuple[Tuple, - Tuple[NDArray[numpy.float64], float, float, bool, float], - Callable[[], 'Shape']] +normalized_shape_tuple = Tuple[ + Tuple, + Tuple[NDArray[numpy.float64], float, float, bool, float], + Callable[[], 'Shape'], + ] # ## Module-wide defaults # Default number of points per polygon for shapes