MCPcopy Index your code
hub / github.com/SLiCAP/SLiCAP_python / param_lines

Method param_lines

SLiCAP/schematic/parameter_item.py:197–215  ·  view source on GitHub ↗

Return SPICE .param lines for netlist export. Names in ``exclude`` (e.g. parameters passed in through a ``.subckt`` line) are skipped: the passed value supersedes any internal definition.

(self, exclude=None)

Source from the content-addressed store, hash-verified

195 )
196
197 def param_lines(self, exclude=None) -> list:
198 """Return SPICE .param lines for netlist export.
199
200 Names in ``exclude`` (e.g. parameters passed in through a ``.subckt``
201 line) are skipped: the passed value supersedes any internal definition.
202 """
203 exclude = exclude or set()
204 rows = []
205 for name, value in self.params:
206 clean_name = name.strip().strip("{}")
207 if clean_name in exclude:
208 continue
209 v = value.strip()
210 if not (v.startswith("{") and v.endswith("}")):
211 v = "{" + v + "}"
212 rows.append(f"+ {clean_name}={v}")
213 if not rows:
214 return []
215 return [".param"] + rows

Callers 2

build_netlistFunction · 0.80
build_subcircuitFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected