Skip to content

Commit

Permalink
add save_options argument when writing gds
Browse files Browse the repository at this point in the history
  • Loading branch information
tvt173 committed Nov 14, 2023
1 parent 1df0943 commit 0fcffc0
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion gplugins/klayout/dataprep/regions.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,19 +123,24 @@ def write_gds(
gdspath: PathType = GDSDIR_TEMP / "out.gds",
top_cell_name: str | None = None,
keep_original: bool = True,
save_options: kdb.SaveLayoutOptions | None = None,
) -> None:
"""Write gds.
Args:
gdspath: output gds path
top_cell_name: name to use for the top cell of the output library
keep_original: if True, keeps all original cells (and hierarchy, to the extent possible) in the output. If false, only explicitly defined layers are output.
save_options: if provided, specified KLayout SaveLayoutOptions are used when writing the GDS
"""
# use the working top cell name if not provided
if top_cell_name is None:
top_cell_name = self.layout.name
c = self.get_kcell(cellname=top_cell_name, keep_original=keep_original)
c.write(gdspath)
if save_options:
c.write(gdspath, save_options=save_options)
else:
c.write(gdspath)

def plot(self, **kwargs):
"""Plot regions."""
Expand Down

0 comments on commit 0fcffc0

Please sign in to comment.