feat(tidy3d): FXC-4413-get-cell-name-from-violation-marker-in-klayout-plugin #3054
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Greptile Overview
Greptile Summary
This PR adds cell-level tracking to KLayout DRC violation markers, enabling users to identify which design cells contain DRC violations.
Key changes:
DRCMarkerbase class withcellfield that all marker types (EdgeMarker,EdgePairMarker,MultiPolygonMarker) now inherit fromviolated_cellsandviolations_by_cellproperties to bothDRCViolationandDRCResultsfor cell-based analysisviolations_from_fileto extract cell information from the<cell>elementThe implementation maintains backward compatibility since
DRCMarkerwas previously only a type alias (not exported) and is now a base class. All existing marker type functionality is preserved.Confidence Score: 5/5
DRCMarkerbase class pattern is clean and the cell extraction from XML is properly validated with error handling.Important Files Changed
File Analysis
DRCMarkerbase class withcellfield, helper properties for cell-based grouping (violated_cells,violations_by_cell) on bothDRCViolationandDRCResults, and cell extraction from XML parsing.parse_violation_valuecalls to includecellparameter, and enhanced test helpers to support cell names.DRCResultsandDRCViolation.Sequence Diagram
sequenceDiagram participant User participant DRCResults participant DRCViolation participant DRCMarker participant XMLParser as violations_from_file User->>DRCResults: load(resultsfile) DRCResults->>XMLParser: violations_from_file(resultsfile) XMLParser->>XMLParser: Parse XML categories loop For each item XMLParser->>XMLParser: Extract category, cell, value XMLParser->>DRCMarker: parse_violation_value(value, cell) DRCMarker-->>XMLParser: EdgeMarker/EdgePairMarker/MultiPolygonMarker end XMLParser-->>DRCResults: dict[str, DRCViolation] DRCResults-->>User: DRCResults instance User->>DRCResults: violations_by_cell DRCResults->>DRCViolation: violations_by_cell (for each category) DRCViolation->>DRCMarker: marker.cell (for each marker) DRCViolation-->>DRCResults: dict[str, DRCViolation] DRCResults-->>User: dict[str, list[DRCViolation]]