From 350de26b6afd32c9d0f46ea3643a68ac8b9216d7 Mon Sep 17 00:00:00 2001 From: Joaquin Matres <4514346+joamatab@users.noreply.github.com> Date: Thu, 20 Jun 2024 14:55:31 +0200 Subject: [PATCH] fix write_drc --- gplugins/klayout/drc/write_drc.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/gplugins/klayout/drc/write_drc.py b/gplugins/klayout/drc/write_drc.py index d1d59a55..7fd3eb3c 100644 --- a/gplugins/klayout/drc/write_drc.py +++ b/gplugins/klayout/drc/write_drc.py @@ -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( @@ -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)