MCPcopy Create free account
hub / github.com/SLiCAP/SLiCAP_python / _updateElementParams

Function _updateElementParams

SLiCAP/SLiCAPyacc.py:982–1062  ·  view source on GitHub ↗

After expansion of the elements, the element parameters can be: 'value' 'noise' 'dc' 'dcvar' 'dcvarlot' 'noisetemp' 'noiseflow' The values of these parameters are symbolic expressions. The atoms of these expressions are parameters. The update procedure is as

(newElement, parentParams, prototypeParams, parentRefDes)

Source from the content-addressed store, hash-verified

980 return newElement
981
982def _updateElementParams(newElement, parentParams, prototypeParams, parentRefDes):
983 """
984 After expansion of the elements, the element parameters can be:
985 'value'
986 'noise'
987 'dc'
988 'dcvar'
989 'dcvarlot'
990 'noisetemp'
991 'noiseflow'
992
993 The values of these parameters are symbolic expressions. The atoms of these
994 expressions are parameters. The update procedure is as follows:
995
996
997 #. If the parameter is a parameter of the parent circuit, then it needs to
998 obtain the value given with the parent circuit.
999 #. Else if the parameter is a parameter of the prototype circuit, then it
1000 needs to obtain the value given with the prototype circuit
1001 #. Else if the parameter is defined in a user library (in USERPARAMS), then
1002 the definition from this library needs to be added to the parameter
1003 definitions of the parent circuit.
1004 #. Else if the parameter is defined in a system library (in SLiCAPPARAMS),
1005 then the definition from this library needs to be added to the parameter
1006 definitions of the parent circuit.
1007 #. Else: the parameter name will receive the postfix: _<parentRefDes)>.
1008
1009
1010 :param newElement: Element of the subciorcuit that needs to be connected to
1011 the parent circuit.
1012 :type newElement: SLiCAPprotos.element
1013
1014 :param parentParams: Dictionary with key-value pairs of parameters of the
1015 parent element:
1016
1017 - key *str*: name of the parameter
1018 - value: *SympyExpression*: value or expression of
1019 this parameter
1020
1021 :param prototypeParams: Dictionary with key-value pairs of parameters of
1022 the prototype circuit:
1023
1024 - key *str*: name of the parameter
1025 - value: *SympyExpression*: value or expression of
1026 this parameter
1027
1028 :param parentRrefDes: Reference designator of the parent element
1029 :type parentRefDes: str
1030
1031 :return: newElement with updated node list
1032 :rtype: SLiCAPprotos.element
1033 """
1034 parNames = list(newElement.params.keys())
1035 params = []
1036 substDict = {}
1037 newParDefs = {}
1038 for parName in parNames:
1039 params += list(newElement.params[parName].atoms(sp.Symbol))

Callers 1

_doExpandFunction · 0.85

Calls 1

fullSubsFunction · 0.90

Tested by

no test coverage detected