diff --git a/changelog.d/+ab59f6ef.added.md b/changelog.d/+ab59f6ef.added.md new file mode 100644 index 00000000..80687cf7 --- /dev/null +++ b/changelog.d/+ab59f6ef.added.md @@ -0,0 +1 @@ +Add PDK capabilities to KCLayout [#171](https://github.com/gdsfactory/kfactory/pull/171) \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index a52e9a29..844af41b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -49,6 +49,9 @@ dev = [ "towncrier", "tbump", "types-requests", + "types-setuptools", + "types-docutils", + "types-Pygments", ] docs = [ "kfactory[ipy]", diff --git a/src/kfactory/kcell.py b/src/kfactory/kcell.py index 5d762ad6..e23f82c3 100644 --- a/src/kfactory/kcell.py +++ b/src/kfactory/kcell.py @@ -375,20 +375,6 @@ def __getattr__(self, __key: str) -> LayerEnclosure: return self.enclosure_map[__key] -# class CellFactoryModel(BaseModel, arbitrary_types_allowed=True): -# """PDK access model for KCellFactories.""" - -# cellfactory_map: dict[str, CellFactory] = Field(default={}) - -# def __getitem__(self, __key: str) -> CellFactory: -# """Retrieve element by string key.""" -# return self.cellfactory_map[__key] - -# def __getattr__(self, __key: str) -> CellFactory: -# """Retrieve attribute by key.""" -# return self.cellfactory_map[__key] - - class KCell: """KLayout cell and change its class to KCell. @@ -750,7 +736,7 @@ def plot(self) -> None: Usage: Pass the kcell variable as an argument in the cell at the end """ - from .widgets.interactive import display_kcell + from .widgets.interactive import display_kcell # type: ignore[attr-defined] display_kcell(self) diff --git a/src/kfactory/widgets/interactive.py b/src/kfactory/widgets/interactive.py index 73c869d7..61c09797 100644 --- a/src/kfactory/widgets/interactive.py +++ b/src/kfactory/widgets/interactive.py @@ -1,3 +1,4 @@ +# type: ignore """Interactivate jupyter widget.""" from __future__ import annotations @@ -34,6 +35,8 @@ print("You need install jupyter notebook plugin with `pip install kfactory[ipy]`") raise e +__all__ = ["display_kcell"] + def display_kcell(kc: KCell) -> None: cell_dup = kc.kcl[kc.name]