tidy3d.plugins.klayout.DRCRunner#
- class DRCRunner[source]#
Bases:
Tidy3dBaseModelA class for running KLayout DRC. Can be used to run DRC on a Tidy3D object or a GDS file.
- Parameters:
drc_runset (Path) – Path to the KLayout DRC runset file.
verbose (bool) – Whether to print logging.
drc_runset – The path to the KLayout DRC runset file.
verbose – Whether to print logging. Default is
True.
Example
>>> # Running DRC on a GDS file: >>> from tidy3d.plugins.klayout.drc import DRCRunner >>> runner = DRCRunner(drc_runset="my_drc_runset.drc", verbose=True) >>> results = runner.run(source="my_layout.gds", resultsfile="drc_results.lyrdb") >>> print(results) >>> # Running DRC on a Tidy3D object: >>> import tidy3d as td >>> from tidy3d.plugins.klayout.drc import DRCRunner >>> vertices = [(-2, 0), (-1, 1), (0, 0.5), (1, 1), (2, 0), (0, -1)] >>> geom = td.PolySlab(vertices=vertices, slab_bounds=(0, 0.22), axis=2) >>> runner = DRCRunner(drc_runset="my_drc_runset.drc", verbose=True) >>> results = runner.run(source=geom, td_object_gds_savefile="geom.gds", resultsfile="drc_results.lyrdb", z=0.1, gds_layer=0, gds_dtype=0) >>> print(results)
Attributes
Methods
run(source[, td_object_gds_savefile, ...])Runs KLayout's DRC on a GDS file or a Tidy3D object.
- drc_runset#
- verbose#
- run(source, td_object_gds_savefile=PosixPath('layout.gds'), resultsfile=PosixPath('drc_results.lyrdb'), drc_args=None, max_results=None, **to_gds_file_kwargs)[source]#
Runs KLayout’s DRC on a GDS file or a Tidy3D object. The Tidy3D object can be a
Geometry,Structure, orSimulation.- Parameters:
source (Union[
Geometry,Structure,Simulation, Path]) – TheGeometry,Structure,Simulation, or GDS file to run DRC on.td_object_gds_savefile (Path) – The path to save the Tidy3D object to. Defaults to
"layout.gds".resultsfile (Path) – The path to save the KLayout DRC results file to. Defaults to
"drc_results.lyrdb".drc_args (Optional[dict[str, str]] = None) – Additional key/value pairs passed through to KLayout as
-rd key=valueCLI arguments.max_results (Optional[int]) – Maximum number of markers to load from the results file.
None(default) loads all markers.**to_gds_file_kwargs – Additional keyword arguments to pass to the Tidy3D object-specific
to_gds_file()method.
- Returns:
The DRC results object containing violations and status.
- Return type:
Example
Running DRC on a GDS file: >>> from tidy3d.plugins.klayout.drc import DRCRunner >>> runner = DRCRunner(drc_runset=”my_drc_runset.drc”, verbose=True) # doctest: +SKIP >>> results = runner.run(source=”my_layout.gds”) # doctest: +SKIP >>> print(results) # doctest: +SKIP
Running DRC on a Tidy3D object: >>> import tidy3d as td >>> from tidy3d.plugins.klayout.drc import DRCRunner >>> vertices = [(-2, 0), (-1, 1), (0, 0.5), (1, 1), (2, 0), (0, -1)] >>> geom = td.PolySlab(vertices=vertices, slab_bounds=(0, 0.22), axis=2) >>> runner = DRCRunner(drc_runset=”my_drc_runset.drc”, verbose=True) # doctest: +SKIP >>> results = runner.run(source=geom, z=0.1, gds_layer=0, gds_dtype=0) # doctest: +SKIP >>> print(results) # doctest: +SKIP