pingspice.ngspice.sourcery.Sourcer(object)
class documentation
Part of pingspice.ngspice.sourcery
(View In Hierarchy)
I handle netlist sourcing.
Method | __init__ | Undocumented |
Method | __str__ | Undocumented |
Method | shutdown | Call this to remove my temporary netlist file. |
Method | check | Call with True to indicate that a circuit has been
sourced. |
Method | read | Converts the supplied netlist text or contents of a netlist file into a list of lines, accessible via my lines attribute. |
Method | removeBetween | Removes netlist lines whose lowercase versions match the first text and the second text and all lines in between. |
Method | remove | Removes netlist lines that case-insensitively match text what. |
Method | controlSection | Extracts and yields in context a list of all lines in any existing
.control section of the netlist. |
Method | updateControlSection | Updates the .control section of the netlist, if any, with
the supplied dict of options. |
Method | make | Generates a temporary netlist file suitable for Ngspice to read with its 'source' command. |
Method | write | Writes a netlist file. |
Call with True
to indicate that a circuit has been
sourced.
Otherwise, raises an exception if no circuit has been sourced yet.
Converts the supplied netlist text or contents of a netlist file into a list of lines, accessible via my lines attribute.
Removes netlist lines whose lowercase versions match the first text and the second text and all lines in between.
def controlSection(self):
Extracts and yields in context a list of all lines in any existing
.control
section of the netlist.
The caller can update that list in context. Then, once the calling context ends, I use it to create a replacement section.
Updates the .control
section of the netlist, if any, with
the supplied dict of options.
Generates a temporary netlist file suitable for Ngspice to read with its 'source' command.
The sole arg may be a string containing the text of a (temporary) netlist file to be generated and sourced or the path of an existing netlist file.
A temporary netlist file will be generated in either case, and that is
what will be sourced. It will be removed after my shutdown
command gets called.
The temporary file is modified from the supplied netlist as needed to
implement the default OPTIONS
, possibly as overridden or
augmented with other NgSpice options that you specify via keywords to this
method call. Leading or trailing whitespace is stripped off of its
lines.
Returns the path of the temporary file with the final netlist text, whether it was supplied via a file or string.