pingspice.analysis.vectors.VectorsBase(object)
class documentation
Part of pingspice.analysis.vectors
(View In Hierarchy)
Known subclasses: pingspice.analysis.vectors.Vectors_File, pingspice.analysis.vectors.Vectors_Ngspice, pingspice.analysis.vectors.Vectors_Python, pingspice.test.analysis.test_plot.VectorsTestable
I am an abstract base class for Vectors
that provides a
convenient common interface for accessing both Python-only and Ngspice
simulation results.
Vectors (1-D Numpy arrays) can be accessed as my attributes, so long as their names don't include characters like "-" or "(" that are forbidden to Python variables, or as mapping-style elements.
Method | nm 0 | Property: My NameManager ,
newly constructed if I did't have one yet. |
Method | nm 1 | Undocumented |
Method | nm | Undocumented |
Method | __contains__ | Dict-like access to my values: Whether name is included. |
Method | __len__ | Dict-like access to my values: The number of vectors and perhaps
+1 for a None entry. |
Method | __iter__ | Dict-like access to my values: Iterates over vector names plus
perhaps None for a psim.Analyzer
instance. |
Method | __getitem__ | Dict-like access to my values, with scaling done from unity
except for a None item, which is an SSE from a psim.Analyzer
instance. |
Method | __setitem__ | Replace the existing numpy vector specified by name with another. |
Method | __getattr__ | A value can be accessed as an attribute if it has an attribute-friendly name. |
Method | avg | Returns the time-weighted average value of my vector name, given my time vector. |
Method | error | Call this with something to tell me that I've had an error, or with nothing to find out if I've had an error. |
Method | setValue | Sets entry cname in my values dict to x, or to its absolute value if cname is an absolute value vector. |
Method | array | Returns my data as a 2-D Numpy array, with each of my values
(except a None entry) appearing as a column vector. |
Method | save | Saves my current contents to a .npz file at the specified
filePath, with any home directory symbol ("~")
expanded. |
Method | copy | Undocumented |
Method | trimmedCopy | Returns a copy of me, trimmed to omit values from TIME < tMin and from TIME > tMax. |
Dict-like access to my values: The number of vectors and perhaps
+1 for a None
entry.
Dict-like access to my values: Iterates over vector names plus
perhaps None
for a psim.Analyzer
instance.
Dict-like access to my values, with scaling done from unity
except for a None item, which is an SSE from a psim.Analyzer
instance.
Replace the existing numpy vector specified by name with another.
This is only for modifying my existing contents; raises an exception if you try to set a new vector with this mechanism.
A value can be accessed as an attribute if it has an attribute-friendly name.
Returns the time-weighted average value of my vector name, given my time vector.
Call this with something to tell me that I've had an error, or with nothing to find out if I've had an error.
The "something" to call with can be an informative string or a
twisted.python.failure.Failure
object.
Sets entry cname in my values dict to x, or to its absolute value if cname is an absolute value vector.
Make sure cname is either None
or a canonical name.
Set it to None
to record the SSE from a psim.Analyzer
whose Python callable returns an SSE instead of computing and returning the
values of one or more non-independent vectors.
Returns my data as a 2-D Numpy array, with each of my values
(except a None
entry) appearing as a column vector.
The columns are in the same order as the vector names were added, as
indicated by the list returned from calling NameManager.cnameList
.
If I have no values, None
is returned, followed by an empty
list if includeNames is set True
.
Parameters | includeNames | Set True to have the canonical name list included. The result
will then be a 2-tuple, with the array and then the names list. |
Saves my current contents to a .npz
file at the specified
filePath, with any home directory symbol ("~")
expanded.