fix some type-related issues

This commit is contained in:
Jan Petykiewicz 2023-01-18 17:15:14 -08:00
parent ecb61c9174
commit dfdceefdcd
4 changed files with 7 additions and 6 deletions

View File

@ -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')

View File

@ -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,
)

View File

@ -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

View File

@ -684,7 +684,7 @@ class LazyLibrary(MutableLibrary):
def __repr__(self) -> str:
return '<LazyLibrary with keys ' + repr(list(self.dict.keys())) + '>'
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