Skip to content

Commit

Permalink
Merge pull request #428 from gdsfactory/fix_write_drc
Browse files Browse the repository at this point in the history
fix write_drc
  • Loading branch information
joamatab authored Jun 20, 2024
2 parents f9bd68d + 350de26 commit 30b0f6e
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions gplugins/klayout/drc/write_drc.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,8 +283,12 @@ def write_layer_definition(layers: dict[str, Layer]) -> list[str]:
layers: layer definitions can be dict, dataclass or pydantic BaseModel.
"""
layers = asdict(layers) if is_dataclass(layers) else layers
layers = dict(layers)
return [f"{key} = input({value[0]}, {value[1]})" for key, value in layers.items()]
out = []
for layer in layers:
layer_name = str(layer)
layer_tuple = tuple(layer)
out += [f"{layer_name} = input({layer_tuple[0]}, {layer_tuple[1]})"]
return out


def get_drc_script(
Expand Down Expand Up @@ -455,7 +459,6 @@ def write_drc_deck_macro(
]

layers = LAYER
layers["WG_PIN"] = (1, 10)
drc_check_deck = write_drc_deck_macro(rules=rules, layers=layers, mode="tiled")
script = get_drc_script(rules=rules, layers=layers, mode="tiled")
print(script)

0 comments on commit 30b0f6e

Please sign in to comment.