fix some type-related issues
This commit is contained in:
parent
a0ca53f57a
commit
f7a2edfe23
@ -3,13 +3,13 @@ DeviceLibrary class for managing unique name->device mappings and
|
|||||||
deferred loading or creation.
|
deferred loading or creation.
|
||||||
"""
|
"""
|
||||||
from typing import Dict, Callable, TypeVar, TYPE_CHECKING
|
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
|
import logging
|
||||||
from pprint import pformat
|
from pprint import pformat
|
||||||
from abc import ABCMeta, abstractmethod
|
from abc import ABCMeta, abstractmethod
|
||||||
|
|
||||||
from ..error import DeviceLibraryError
|
from ..error import DeviceLibraryError
|
||||||
from ..library import Library
|
from ..library import Library, LazyLibrary
|
||||||
from ..builder import Device, DeviceRef
|
from ..builder import Device, DeviceRef
|
||||||
from .. import Pattern
|
from .. import Pattern
|
||||||
|
|
||||||
@ -18,6 +18,7 @@ logger = logging.getLogger(__name__)
|
|||||||
|
|
||||||
|
|
||||||
DL = TypeVar('DL', bound='LazyDeviceLibrary')
|
DL = TypeVar('DL', bound='LazyDeviceLibrary')
|
||||||
|
DL2 = TypeVar('DL2', bound='LazyDeviceLibrary')
|
||||||
LDL = TypeVar('LDL', bound='LibDeviceLibrary')
|
LDL = TypeVar('LDL', bound='LibDeviceLibrary')
|
||||||
|
|
||||||
|
|
||||||
|
@ -457,7 +457,7 @@ def _shapes_to_elements(
|
|||||||
layer=(layer, data_type),
|
layer=(layer, data_type),
|
||||||
xy=xy,
|
xy=xy,
|
||||||
path_type=path_type,
|
path_type=path_type,
|
||||||
width=width,
|
width=int(width),
|
||||||
extension=extension,
|
extension=extension,
|
||||||
properties=properties,
|
properties=properties,
|
||||||
)
|
)
|
||||||
|
@ -138,7 +138,7 @@ def dose2dtype(
|
|||||||
library = WrapROLibrary(library)
|
library = WrapROLibrary(library)
|
||||||
|
|
||||||
# Get a table of (id(pat), written_dose) for each pattern and subpattern
|
# 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
|
# 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
|
# This means going through each row in sd_table and adding the dose values needed to write
|
||||||
|
@ -684,7 +684,7 @@ class LazyLibrary(MutableLibrary):
|
|||||||
def __repr__(self) -> str:
|
def __repr__(self) -> str:
|
||||||
return '<LazyLibrary with keys ' + repr(list(self.dict.keys())) + '>'
|
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
|
Force all patterns into the cache
|
||||||
|
|
||||||
@ -695,7 +695,7 @@ class LazyLibrary(MutableLibrary):
|
|||||||
_ = self.dict.__getitem__(key)
|
_ = self.dict.__getitem__(key)
|
||||||
return self
|
return self
|
||||||
|
|
||||||
def clear_cache(self: L) -> L:
|
def clear_cache(self: LL) -> LL:
|
||||||
"""
|
"""
|
||||||
Clear the cache of this library.
|
Clear the cache of this library.
|
||||||
This is usually used before modifying or deleting cells, e.g. when merging
|
This is usually used before modifying or deleting cells, e.g. when merging
|
||||||
|
Loading…
Reference in New Issue
Block a user