tidy3d.plugins.klayout.DRCResults#

class DRCResults[source]#

Bases: Tidy3dBaseModel

A class for loading and storing KLayout DRC results.

Parameters:

violations_by_category (dict[str, DRCViolation]) – Dictionary of DRC violations by category.

Attributes

categories

A tuple of all DRC categories.

is_clean

Whether the DRC is clean (no violations).

violated_cells

Tuple of cells that contain at least one violation.

violation_counts

Counts violations by category.

violations_by_cell

Aggregate violations grouped by cell across all categories.

violations_by_category

Methods

load(resultsfile[, max_results])

Create a DRCResults instance from a results file.

violations_by_category#
property is_clean#

Whether the DRC is clean (no violations).

property violation_counts#

Counts violations by category.

Returns:

A dictionary of violation counts for each category.

Return type:

dict[str, int]

property violations_by_cell#

Aggregate violations grouped by cell across all categories.

property violated_cells#

Tuple of cells that contain at least one violation.

property categories#

A tuple of all DRC categories.

classmethod load(resultsfile, max_results=None)[source]#

Create a DRCResults instance from a results file.

Parameters:
  • resultsfile (Union[str, Path]) – Path to the KLayout DRC results file.

  • max_results (Optional[int]) – Maximum number of markers to load from the file. If None (default), all markers are loaded.

Returns:

A DRCResults object containing the DRC results.

Return type:

DRCResults

Raises:
  • FileNotFoundError – If the DRC result file is not found.

  • ET.ParseError – If the DRC result file is not a valid XML file.

Example

>>> from tidy3d.plugins.klayout.drc import DRCResults
>>> results = DRCResults.load(resultsfile="drc_results.lyrdb") 
>>> print(results)