I maintain a DeferredQueue of one or more analyzers.

There are two different kinds of setup, for Ngspice simulations and for Python-only simulations.

I am constructing analyzers from a class provided in the first item of definition sequence (argument #4), I will construct an NgspiceRunner for each analyzer and then construct the analyzer with (1) a reference to the NgspiceRunner, (2) my setup ID, (3) my list of vector names, (4) my avList, and any additional arguments that have been included in the definition sequence. Then I will call its setup method with the circuit netlist string.

If I am just setting up an existing analyzer (which must be an instance of psim.Analyzer, I will call its setup method with (1) my setup ID, (2) my list of vector names, (3) my avList, and any additional arguments that have included in the definition sequence. In this case, whatever is in my netlist attribute is ignored because Python-only Analyzers don't use circuit files.

Construct me with:

ParameterscfgAn instance of Config containing Boolean runtime options.
IDMy integer setup ID.
avListA reference to a shared list of AV objects.
namesThe names of the vectors that my analyzers will be providing.
analyzerThe definition sequence for my analyzers, consisting of a subclass of sim.Analyzer followed by args for its constructor, or an instance of psim.Analyzer, followed by args for its setup method.
netlistText of the SPICE circuit file for my analyzers, if an analyzer object is not being supplied.
N_coresThe number of analyzers I spawn and handle.
Class Variable timeout The number of seconds an analyzer will wait for a response to its commands.
Method __init__ Setup(self, cfg, ID, avList, names, analyzer, netlist=None, N_cores=2)
Method __len__ Undocumented
Method __repr__ Undocumented
Method shutdown Shuts down all my analyzers.
Method isPythonAnalyzer Returns True if my analyzer(s) are Python-only, rather than Ngspice-based.
Method fireAnalyzer Shut down and dismiss the specified analyzer.
Method addAnalyzer Sets up an analyzer and adds it to my DeferredQueue.
Method populate Populates my DeferredQueue dq with N_analyzers, returning a Deferred that fires with my setup ID when all the analyzers have been set up, or with None if there was a problem.
Method isBloated Returns True if the Ngspice process for the specified analyzer is using too much RAM.
timeout =
The number of seconds an analyzer will wait for a response to its commands.
def __init__(self, cfg, ID, avList, names, analyzer, netlist=None, N_cores=2):

Setup(self, cfg, ID, avList, names, analyzer, netlist=None, N_cores=2)

def __len__(self):
Undocumented
def __repr__(self):
Undocumented
@defer.inlineCallbacks
def shutdown(self):

Shuts down all my analyzers.

Returns a Deferred that fires when they're all shut down. Repeated calls are disregarded.

def isPythonAnalyzer(self):

Returns True if my analyzer(s) are Python-only, rather than Ngspice-based.

def fireAnalyzer(self, analyzer):

Shut down and dismiss the specified analyzer.

@defer.inlineCallbacks
def addAnalyzer(self, noPut=False):

Sets up an analyzer and adds it to my DeferredQueue.

Declines to add an analyzer if I already have the number N that I was configured with, or if I'm not running anymore.

Returns a Deferred that fires with a reference to the analyzer, or None if no analyzer was added.

ParametersnoPutSet True and I won't put the new analyzer into my queue. Then you must do it instead.
def populate(self):

Populates my DeferredQueue dq with N_analyzers, returning a Deferred that fires with my setup ID when all the analyzers have been set up, or with None if there was a problem.

def isBloated(self, analyzer):

Returns True if the Ngspice process for the specified analyzer is using too much RAM.

"Too much" is defined as at least 300K and twice what it was using when it first launched.

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