Skip to content

Commit

Permalink
Merge pull request #507 from gdsfactory/fix-convert-to-static
Browse files Browse the repository at this point in the history
fix convert to static not taking all metainfo
  • Loading branch information
sebastian-goeldi authored Nov 4, 2024
2 parents 7c572d7 + 71c4056 commit 9726404
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/kfactory/kcell.py
Original file line number Diff line number Diff line change
Expand Up @@ -2262,12 +2262,16 @@ def convert_to_static(self, recursive: bool = True) -> None:
"""Convert the KCell to a static cell if it is pdk KCell."""
if self.library().name == self.kcl.name:
raise ValueError(f"KCell {self.qname()} is already a static KCell.")
_lib_cell = kcls[self.library().name()][self.library_cell_index()]
_lib_cell.set_meta_data()
_kdb_cell = self.kcl.layout.cell(
self.kcl.convert_cell_to_static(self.cell_index())
)
_kdb_cell.name = self.qname()
_ci = _kdb_cell.cell_index()
_old_kdb_cell = self._kdb_cell
_kdb_cell.copy_meta_info(_lib_cell._kdb_cell)
self.get_meta_data()

if recursive:
for ci in self.called_cells():
Expand Down

0 comments on commit 9726404

Please sign in to comment.