I keep track of pending alterations.

Instance Variable a A list containing the (dev, param, expr) of pending alter commands. If there is no parameter, param is None.
Instance Variable m A dict of lists of 2-tuples, keyed by dev, each list containing the (param, expr) of pending altermod commands.
Method __init__ Undocumented
Method wait "Returns" a Deferred that fires when all my pending alterations are done. At that point, both my ordered dicts a and m will be clear.
Method alter Builds and returns a list of tokens for an Ngspice alter command, adding the command to my a list.
Method altermod Builds and returns a list of tokens for an Ngspice altermod command, adding the command to my m list.
Method _setOrAppend Undocumented
a =
A list containing the (dev, param, expr) of pending alter commands. If there is no parameter, param is None.
m =
A dict of lists of 2-tuples, keyed by dev, each list containing the (param, expr) of pending altermod commands.
def __init__(self, r):
Undocumented
@defer.inlineCallbacks
def wait(self):

"Returns" a Deferred that fires when all my pending alterations are done. At that point, both my ordered dicts a and m will be clear.

The Deferred fires with None if the values were all implemented, or with a Result object in error state if there was a problem.

def _setOrAppend(self, container, dev, param, expr):
Undocumented
def alter(self, dev, *args):

Builds and returns a list of tokens for an Ngspice alter command, adding the command to my a list.

Some example calls:

   r.alter('r1', 1.0)
   r.alter('v1', 'dc', 11.9)
   r.alter('@v1[DC]', 11.9)
   r.alter('@v1[PULSE]', [0, 11.9, 0, 1e-6])

Note that lines 2 and 3 above are equivalent. (Parameter names are forced to lowercase.) AV_ListHolder.alterations uses the latter form.

def altermod(self, dev, param, expr):

Builds and returns a list of tokens for an Ngspice altermod command, adding the command to my m list.

Note that the first device using the model is specified rather than the model itself.

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