MCPcopy Index your code
hub / github.com/SLiCAP/SLiCAP_python / _delDCvarSources

Function _delDCvarSources

SLiCAP/SLiCAPexecute.py:737–758  ·  view source on GitHub ↗

Deletes the dcVar sources from instr.circuit, added by executing this instruction with dataType: 'dcvar'. :param instr: SLiCAP instruction object that holds instruction data. :type instr: SLiCAPinstruction.instruction :return: instr of the execution of the instruction. :rt

(instr)

Source from the content-addressed store, hash-verified

735 return instr
736
737def _delDCvarSources(instr):
738 """
739 Deletes the dcVar sources from instr.circuit, added by executing this
740 instruction with dataType: 'dcvar'.
741
742 :param instr: SLiCAP instruction object that holds instruction data.
743 :type instr: SLiCAPinstruction.instruction
744
745 :return: instr of the execution of the instruction.
746 :rtype: SLiCAPinstruction.instruction
747 """
748 names = []
749 prefixes = ['I_dcvar_', 'G_dcvar_', 'V_dcvar_']
750 for refDes in instr.circuit.elements.keys():
751 if len(refDes) > 8:
752 prefix = refDes[0:8]
753 if prefix in prefixes:
754 names.append(refDes)
755 for name in names:
756 del instr.circuit.elements[name]
757 instr.circuit = _updateCirData(instr.circuit)
758 return instr
759
760def _addResNoiseSources(instr):
761 """

Callers 1

_doDCvarFunction · 0.85

Calls 1

_updateCirDataFunction · 0.90

Tested by

no test coverage detected