I provide node-related convenience methods for subclasses. The following instance variables are for the Elements object, not me:

Instance Variable shunts A dict of current sensing V elements with the pairs of nodes they connect.
Class Variable debug A Bag that gets set True for all instances to log info about each setup call.
Class Method autoName Undocumented
Method setupResults Undocumented
Method fill Undocumented
Method nodeCheck Call with the circuit building tool f and a sequence of nodes provided to this Include or Subcircuit.
Method setup Included or subcircuit setup. You'll usually override this in a subclass.
Method rawNetlist Get lines of a raw netlist from a search hierarchy of possible sources.
Method shunt Call to insert a current-measuring shunt and add an entry to my Elements baton's dict of shunts.
Method raw See Elements.raw.
Method iNode See Elements.iNode.
Method ground See Elements.ground.
Method sca See Elements.sca.
Method sca6 See Elements.sca6.
Class Method _libDir Undocumented
Method _strippedLines Undocumented
Method _call_setup Calls my setup method (almost always your override of that method, actually) and processes any return value.
shunts =
A dict of current sensing V elements with the pairs of nodes they connect.
debug =
A Bag that gets set True for all instances to log info about each setup call.
@classmethod
def autoName(cls, key):
Undocumented
@classmethod
def _libDir(cls):
Undocumented
@property
def setupResults(self):
Undocumented
@property
def fill(self):
Undocumented
def _strippedLines(self, lines):
Undocumented
@contextmanager
def nodeCheck(self, f, nodes, nest=False):

Call with the circuit building tool f and a sequence of nodes provided to this Include or Subcircuit.

ParametersnestSet True to consider nodes added to be inside a nested layer, thus not adding nodes to any active sets from outer layers.
def _call_setup(self, f, *args):

Calls my setup method (almost always your override of that method, actually) and processes any return value.

If the return value is a dict, its contents are used to update a setupResults dict that is specific to one instance of me.

def setup(self, f):

Included or subcircuit setup. You'll usually override this in a subclass.

Unless you provide a netlist via the netlist attribute (for a block of text) or the netlistLines attribute (for a list of lines), override this to define your own method for constructing a subcircuit or included circuit lines, using the Elements object provided as f.

Why use f? Because it's short and a conveniently typed letter on the keyboard.

def rawNetlist(self, circuitFile=None):

Get lines of a raw netlist from a search hierarchy of possible sources.

Returns lines of a raw netlist from an Ngspice circuitFile specified in this method call, an Ngspice circuit File specified in my circuitFile attribute if present, my rawLines attribute if specified, or my subclass's docstring, in that order of precedence. Failing everything, returns an empty list.

Don't worry about indentation; all that is stripped out in any case because there is no such thing in SPICE format.

def shunt(self, node, nextNode=None, name=None):

Call to insert a current-measuring shunt and add an entry to my Elements baton's dict of shunts.

def raw(self, *args, **kw):
def iNode(self, *args, **kw):
def ground(self, *args, **kw):
def sca(self, *args, **kw):
def sca6(self, *args, **kw):
API Documentation for pingspice, generated by pydoctor at 2021-09-18 08:41:11.