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 anattr
obj.attrs['foo'] = bar
. Also note that Tidy3D` will raise aTypeError
ifattrs
contain objects that can not be serialized. One can check ifattrs
are serializable by callingobj.json()
.violations_by_category (Mapping[str, DRCViolation]) β Dictionary of DRC violations by category.
Attributes
A tuple of all DRC categories.
Whether the DRC is clean (no violations).
Counts violations by category.
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
- 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:
- 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.