Skip to content

Commit

Permalink
Merge pull request #528 from gdsfactory/fix-variant-for-non-x-spice
Browse files Browse the repository at this point in the history
Fix X SPICE element parsing for Calibre-style model names
  • Loading branch information
nikosavola authored Jan 1, 2025
2 parents baa94b7 + 52ef00c commit 2c5706c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion gplugins/klayout/netlist_spice_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@ def wants_subcircuit(self, name: str):
@override
def parse_element(self, s: str, element: str) -> kdb.ParseElementData:
# Allow Calibre-style model name given as `$[model_name]` by removing the brackets
s = re.sub(r"\$\[([^\]]+)\]", r"\1", s)
# This is used for resistors and capacitors
if element != "X":
s = re.sub(r"\$\[([^\]]+)\]", r"\1", s)

x_value, y_value = None, None
if "$" in s:
Expand Down

0 comments on commit 2c5706c

Please sign in to comment.