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.
def __init__(self):
Undocumented
def __str__(self):
Undocumented
def shutdown(self):

Call this to remove my temporary netlist file.

def check(self, *args):

Call with True to indicate that a circuit has been sourced.

Otherwise, raises an exception if no circuit has been sourced yet.

def read(self, netlistFileOrText):

Converts the supplied netlist text or contents of a netlist file into a list of lines, accessible via my lines attribute.

def removeBetween(self, first, last):

Removes netlist lines whose lowercase versions match the first text and the second text and all lines in between.

def remove(self, what):

Removes netlist lines that case-insensitively match text what.

@contextmanager
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.

def updateControlSection(self, options):

Updates the .control section of the netlist, if any, with the supplied dict of options.

def make(self, netlistFileOrText, **kw):

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.

def write(self, filePath, *args, **kw):

Writes a netlist file.

Provide any additional options as keywords and any raw lines for the .control section with a list in an additional arg.

API Documentation for pingspice, generated by pydoctor at 2021-09-18 08:41:11.