expressions ¤
Evaluate NetlistParse expression nodes with explicit, scoped name lookup.
Classes:
| Name | Description |
|---|---|
Scope | Lazy lexical parameter environment, with overrides and cycle detection. |
Functions:
| Name | Description |
|---|---|
evaluate | Interpret only supported CST operations; never execute source as Python. |
evaluate_source | Parse a scalar expression without the optional NetlistParse extension. |
parse_sine_waveform | Resolve SPICE-style SIN(offset amplitude frequency [delay damping phase]). |
Scope ¤
Scope(parent: Scope | None = None)
Lazy lexical parameter environment, with overrides and cycle detection.
Methods:
| Name | Description |
|---|---|
lookup | Resolve a parameter, evaluating its definition in the declaring scope. |
Source code in circulax/netlist_io/expressions.py
lookup ¤
Resolve a parameter, evaluating its definition in the declaring scope.
SPICE identifiers are case-insensitive, so a name is matched exactly first and falls back to a case-insensitive scan of this scope only.
Source code in circulax/netlist_io/expressions.py
evaluate ¤
Interpret only supported CST operations; never execute source as Python.
Source code in circulax/netlist_io/expressions.py
evaluate_source ¤
Parse a scalar expression without the optional NetlistParse extension.
dialect="spice" and "ngspice" read an uppercase M suffix as milli, as SPICE source cards do; other dialects read it as mega.
@tags circulax-simulation
Source code in circulax/netlist_io/expressions.py
parse_sine_waveform ¤
Resolve SPICE-style SIN(offset amplitude frequency [delay damping phase]).
Phase is supplied in degrees and returned in radians. Numeric arguments use the same safe expression/unit interpreter as model cards, read with SPICE suffix semantics by default (M is milli). Other waveform kinds are rejected so callers cannot silently substitute a DC source.
@tags circulax-simulation