tidy3d.plugins.klayout.DRCResults#

class DRCResults[source]#

Bases: Tidy3dBaseModel

A class for loading and storing KLayout DRC results.

Parameters:
  • attrs (dict = {}) – Dictionary storing arbitrary metadata for a Tidy3D object. This dictionary can be freely used by the user for storing data without affecting the operation of Tidy3D as it is not used internally. Note that, unlike regular Tidy3D fields, attrs are mutable. For example, the following is allowed for setting an attr obj.attrs['foo'] = bar. Also note that Tidy3D` will raise a TypeError if attrs contain objects that can not be serialized. One can check if attrs are serializable by calling obj.json().

  • violations_by_category (Mapping[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).

violation_counts

Counts violations by category.

attrs

Methods

load(resultsfile)

Create a DRCResults instance from a results file.

Inherited Common Usage

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 categories#

A tuple of all DRC categories.

__getitem__(category)[source]#

Get DRC violation result by category.

Parameters:

category (str) – The category of the DRC violation.

Returns:

The DRC violation result for the given category.

Return type:

DRCViolation

__str__()[source]#

Get a nice string representation of the DRC results.

classmethod load(resultsfile)[source]#

Create a DRCResults instance from a results file.

Parameters:

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

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) 
__hash__()#

Hash method.