diff --git a/masque/builder/device_library.py b/masque/builder/device_library.py index 0afed5a..d86a6cc 100644 --- a/masque/builder/device_library.py +++ b/masque/builder/device_library.py @@ -3,13 +3,13 @@ DeviceLibrary class for managing unique name->device mappings and deferred loading or creation. """ from typing import Dict, Callable, TypeVar, TYPE_CHECKING -from typing import Any, Tuple, Union, Iterator +from typing import Any, Tuple, Union, Iterator, Mapping import logging from pprint import pformat from abc import ABCMeta, abstractmethod from ..error import DeviceLibraryError -from ..library import Library +from ..library import Library, LazyLibrary from ..builder import Device, DeviceRef from .. import Pattern @@ -18,6 +18,7 @@ logger = logging.getLogger(__name__) DL = TypeVar('DL', bound='LazyDeviceLibrary') +DL2 = TypeVar('DL2', bound='LazyDeviceLibrary') LDL = TypeVar('LDL', bound='LibDeviceLibrary') diff --git a/masque/file/gdsii.py b/masque/file/gdsii.py index e96a082..416cb18 100644 --- a/masque/file/gdsii.py +++ b/masque/file/gdsii.py @@ -457,7 +457,7 @@ def _shapes_to_elements( layer=(layer, data_type), xy=xy, path_type=path_type, - width=width, + width=int(width), extension=extension, properties=properties, ) diff --git a/masque/file/utils.py b/masque/file/utils.py index 8d866a9..b475b47 100644 --- a/masque/file/utils.py +++ b/masque/file/utils.py @@ -138,7 +138,7 @@ def dose2dtype( library = WrapROLibrary(library) # Get a table of (id(pat), written_dose) for each pattern and subpattern - sd_table = make_dose_table(library.find_topcells(), library) + sd_table = make_dose_table(library.find_toplevel(), library) # Figure out all the unique doses necessary to write this pattern # This means going through each row in sd_table and adding the dose values needed to write diff --git a/masque/library.py b/masque/library.py index f4a381b..08a982f 100644 --- a/masque/library.py +++ b/masque/library.py @@ -684,7 +684,7 @@ class LazyLibrary(MutableLibrary): def __repr__(self) -> str: return '' - def precache(self: L) -> L: + def precache(self: LL) -> LL: """ Force all patterns into the cache @@ -695,7 +695,7 @@ class LazyLibrary(MutableLibrary): _ = self.dict.__getitem__(key) return self - def clear_cache(self: L) -> L: + def clear_cache(self: LL) -> LL: """ Clear the cache of this library. This is usually used before modifying or deleting cells, e.g. when merging