pingspice.analysis.evaluate.IV_Manager(object)
class documentation
Part of pingspice.analysis.evaluate
(View In Hierarchy)
I manage info about the independent vectors for a given setup.
Construct me with a sequence indieFlags of bools indicating whether each column in the 2-D goals array for that setup is for an independent vector.
My kInterp attribute is very important: It is set to an integer
column index (which may be zero) of a non-enumerable independent vector
if you can use interpolation-based SSE calculation based on my
setup's 2-D goals array and my indieFlags. (It's set to
None
otherwise.)
That special vector, if it exists, is used as the x-axis argument for
Numpy's interp
function. The ErrorTabulator.closenessToIndepInterpolated
method uses that instead of looking for the closest independent-vector
points as ErrorTabulator.closenessToIndep
does or (worse yet) looking for the closest overall points as ErrorTabulator.closenessToAll
does.
Using Numpy's interp
function is very efficient, but only
possible if there is exactly one independent variable (not including
independent vectors that contain a limited set of enumerated values) and if
the values for that independent variable are in ascending order. That seems
like a lot of conditions, but it usually should be the case.
Regarding enumerated values: If there are multiple independent vectors
but all except one have goal points that are in a limited set of enumerated
values (e.g., all integers between 5 and 10), then
closenessToIndepInterpolated can still be used. It will run Numpy's
interp
function on the sole non-enumerated independent vector
with the values of the other independent vector(s) set to each enumerated
value in turn. That's still more efficient than using
closenessToIndep, and more desirable because the vast majority of
simulated points for dual DC sweeps can often be simply ignored.
Note: Due to combinatorial explosion and lack of use case, only 1 enumerable indep vector is currently supported in combination with a non-enumerable vector. (Some of the code structure is here for using two of them.)
Instance Variable | kInterp | The integer column index of a single continuous (non-enumerable)
independent vector with monotonically ascending values, or
None if there is not one and only one such vector. |
Instance Variable | kcList | A list of column indices of continuous (non-enumerable) independent vectors. |
Instance Variable | keList | A list of column indices of enumerable independent vectors. |
Instance Variable | uvList | A list of 1-D arrays of the unique values for each enumerable independent vector. |
Method | __init__ | IV_Manager(indieFlags) |
Method | __nonzero__ | I evaluate as True if my setup has any independent vectors.
(Almost always the case.) |
Method | __iter__ | I iterate over the column indices of all of my setup's independent vectors. |
Method | dependerator | Yields the column index of each dependent vector. Sort of the opposite
of iterating over me directly with __iter__ . |
Method | enumerableator | Yields the column index of each enumerable independent vector, a subset
of what you get from iterating over me directly with __iter__ ,
or possibly no iterations at all. |
Method | clear | Undocumented |
Method | noEnumerables | Undocumented |
Method | subseterator | For each unique value of the enumerable independent vector at the specified column index kCol, yields indices of matching values at a specified column index of a supplied array. |
Method | setup | To set me up, call this with a 2-D array of goal points X. |
Method | _monotonic | Returns True if vector Z is monotonically increasing
for all its values. |
Method | _canInterpolate | Returns True if kCol points to a column vector of
X that you can use as the x-axis for a call to Numpy
interp . |
Method | _interpolatableEIV | If one of my EIVs can be considered a CIV on which interpolation can be
done, returns its records index. Otherwise, returns None . |
None
if there is not one and only one such vector.
I evaluate as True
if my setup has any independent vectors.
(Almost always the case.)
Yields the column index of each dependent vector. Sort of the opposite
of iterating over me directly with __iter__
.
Yields the column index of each enumerable independent vector, a subset
of what you get from iterating over me directly with __iter__
,
or possibly no iterations at all.
Note: Only at most one enumerable independent vector is currently supported, so this will only iterate once or not at all.
For each unique value of the enumerable independent vector at the specified column index kCol, yields indices of matching values at a specified column index of a supplied array.
Provide at least one pair of arguments after kCol: (1) the column index of the supplied array and (2) the array itself. Argument pairs may be added for additional arrays. The yielded outputs are lists of one or more subset arrays, one for each argument pair.
Each subset array contains the row indices of a subset of the array where the values of the vector at the column index exactly equal the unique value. For a 1-D Numpy array, its column index must equal zero.
Returns True
if kCol points to a column vector of
X that you can use as the x-axis for a call to Numpy
interp
.
If one of my EIVs can be considered a CIV on which interpolation can be
done, returns its records index. Otherwise, returns None
.
Looks through my EIVs, starting with the one with the most unique values, for one whose subsets at each value of the other enumerable(s) are all monotonically increasing.
To set me up, call this with a 2-D array of goal points X.
For each independent vector, processes its column of the goals array X. If the vector is enumerable, adds its column index and unique values to my keList and uvList, respectively. Otherwise, adds the index to my kcList and maybe sets kInterp to it.
A vector is considered enumerable when it has no more than maxUniqueVals unique values and there are at least two of each unique value.
Sets my kInterp attribute to the column index of a independent
vector in X if (1) it is not an enumerable independent vector, (2)
each subset of its values is monotonically increasing for unique values of
all EIVs in X, or monotonically increasing across its entire range
if there are no EIVs, and (3) it is the only non-enumerable (continuous)
vector in X. Otherwise, kInterp remains None
,
indicating that interpolation cannot be used.