Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions SLiCAP/SLiCAP.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
np.set_printoptions(edgeitems=30, linewidth=1000,
formatter=dict(float=lambda x: "%11.4e" % x))


def Help():
"""
Opens the SLiCAP HTML documentation in the default browser.
Expand All @@ -43,7 +44,7 @@ def Help():
>>> sl.Help()
"""
webbrowser.open_new(ini.doc_path + 'index.html')
return


def _copyNotOverwrite(src, dest):
"""
Expand All @@ -57,7 +58,7 @@ def _copyNotOverwrite(src, dest):
"""
if not os.path.exists(dest):
copy2(src, dest)
return


def _makeDir(dirName):
"""
Expand All @@ -69,7 +70,7 @@ def _makeDir(dirName):

if not os.path.exists(dirName):
os.makedirs(dirName)
return


def initProject(name, notebook=False):
"""
Expand Down
1 change: 0 additions & 1 deletion SLiCAP/SLiCAPgschem.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,3 @@ def _gNetlist(fileName, cirTitle):
+ "manually!\n")
else:
print("Error: could not open: '{}'.".format(fileName))
return
5 changes: 1 addition & 4 deletions SLiCAP/SLiCAPhtml.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ def _startHTML(projectName):
_writeFile(ini.html_path + ini.html_index, html)
ini.html_page = ini.html_index
ini.html_pages.append(ini.html_page)
return

def _HTMLhead(pageTitle):
"""
Expand Down Expand Up @@ -174,7 +173,6 @@ def _writeFile(fileName, txt):
# with next import of SLiCAP in the same project; it is only reset with
# initProject()
ini._update_project_config()
return

### User Functions ###########################################################

Expand Down Expand Up @@ -225,7 +223,6 @@ def htmlPage(pageTitle, index = False, label = ''):
# Make this page the active HTML page
ini.html_page = fileName
ini.html_pages.append(fileName)
return

def head2html(headText, label=''):
"""
Expand Down Expand Up @@ -571,7 +568,7 @@ def eqn2html(arg1, arg2, units='', label='', labelText=''):
:rtype: str
"""
if arg1 == None or arg2 == None:
return
return ''
arg1 = sp.sympify(str(arg1))
arg2 = sp.sympify(str(arg2))
if units != '':
Expand Down
39 changes: 0 additions & 39 deletions SLiCAP/SLiCAPinstruction.py
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,6 @@ def setSimType(self, simType):
"""
self.simType = simType
self._checkSimType()
return

def _checkSimType(self):
"""
Expand Down Expand Up @@ -546,7 +545,6 @@ def _checkGainType(self):
else:
print("Error: argument type must be type 'str'.")
self.errors += 1
return

def setConvType(self, convType):
"""
Expand Down Expand Up @@ -574,7 +572,6 @@ def _checkConvType(self):
self.errors += 1
else:
self.convType = None
return

def setPairExt(self, pairExt):
"""
Expand All @@ -586,7 +583,6 @@ def setPairExt(self, pairExt):
"""
if self.checkPairExt(pairExt) == 0:
self.pairExt = pairExt
return

def checkPairExt(self, pairExt):
"""
Expand Down Expand Up @@ -623,7 +619,6 @@ def setPairedCircuits(self, cirPairs):
"""
if self.checkPairedCircuits(cirPairs) == 0:
self.pairedCircuits = cirPairs
return

def checkPairedCircuits(self, circuitPairs):
"""
Expand Down Expand Up @@ -671,7 +666,6 @@ def setDataType(self, dataType):
"""
self.dataType = dataType
self.checkDataType()
return

def checkDataType(self):
"""
Expand All @@ -690,7 +684,6 @@ def checkDataType(self):
print("Error: missing data type specification.")
else:
print("Error: data type must be type 'str' or 'None'.")
return

def stepOn(self):
"""
Expand All @@ -706,7 +699,6 @@ def stepOn(self):
>>> my_instruction.stepOn()
"""
self.step = True
return

def stepOff(self):
"""
Expand All @@ -722,7 +714,6 @@ def stepOff(self):
>>> my_instruction.stepOff()
"""
self.step = False
return

def setStepVar(self, stepVar):
"""
Expand Down Expand Up @@ -757,7 +748,6 @@ def setStepVar(self, stepVar):
"""
self.stepVar = stepVar
self.checkStepVar()
return

def checkStepVar(self):
"""
Expand All @@ -777,7 +767,6 @@ def checkStepVar(self):
print("Error: argument type must be 'str' or 'sympy.Symbol'.")
if self.stepVar not in list(self.circuit.parDefs.keys()) and self.stepVar not in self.circuit.params:
print("Warning: unknown step parameter '{0}'.".format(self.stepVar))
return

def setStepVars(self, stepVars):
"""
Expand Down Expand Up @@ -820,7 +809,6 @@ def setStepVars(self, stepVars):
"""
self.stepVars = stepVars
self.checkStepVars()
return

def checkStepVars(self):
"""
Expand Down Expand Up @@ -855,7 +843,6 @@ def checkStepVars(self):
print("Error: argument should be a list.")
errors += 1
self.errors += errors
return

def setStepMethod(self, stepMethod):
"""
Expand All @@ -878,7 +865,6 @@ def setStepMethod(self, stepMethod):
"""
self.stepMethod = stepMethod
self.checkStepMethod()
return

def checkStepMethod(self):
"""
Expand All @@ -899,7 +885,6 @@ def checkStepMethod(self):
print("Error: unknown step method '{0}',".format(self.stepMethod))
else:
self.stepMethod == self.stepMethod.lower()
return

def setStepStart(self, stepStart):
"""
Expand All @@ -926,7 +911,6 @@ def setStepStart(self, stepStart):
"""
self.stepStart = stepStart
self.checkStepStart()
return

def checkStepStart(self):
"""
Expand All @@ -944,7 +928,6 @@ def checkStepStart(self):
print("Error: cannot determine numeric value of stepStart.")
else:
self.stepStart = value
return

def setStepStop(self, stepStop):
"""
Expand All @@ -970,7 +953,6 @@ def setStepStop(self, stepStop):
"""
self.stepStop = stepStop
self.checkStepStop()
return

def checkStepStop(self):
"""
Expand All @@ -988,7 +970,6 @@ def checkStepStop(self):
print("Error: cannot determine numeric value of stepStop.")
else:
self.stepStop = value
return

def setStepNum(self, stepNum):
"""
Expand All @@ -1014,7 +995,6 @@ def setStepNum(self, stepNum):
"""
self.stepNum = stepNum
self.checkStepNum()
return

def checkStepNum(self):
"""
Expand All @@ -1035,7 +1015,6 @@ def checkStepNum(self):
else:
self.errors += 1
print("Error: step number type must be 'int'.")
return

def setStepList(self, stepList):
"""
Expand Down Expand Up @@ -1064,7 +1043,6 @@ def setStepList(self, stepList):
"""
self.stepList = stepList
self.checkStepList()
return

def checkStepList(self):
"""
Expand All @@ -1089,7 +1067,6 @@ def checkStepList(self):
else:
self.errors += 1
print("Error: expected a list type for 'stepValues'.")
return

def setStepArray(self, stepArray):
"""
Expand Down Expand Up @@ -1118,7 +1095,6 @@ def setStepArray(self, stepArray):
"""
self.stepArray = stepArray
self.checkStepArray()
return

def checkStepArray(self):
"""
Expand Down Expand Up @@ -1153,7 +1129,6 @@ def checkStepArray(self):
print("Error: cannot determine numeric value of stepArray[{0}, {1}].".format(i, j))
else:
self.stepArray[i][j] = value
return


def setSource(self, source):
Expand Down Expand Up @@ -1199,7 +1174,6 @@ def setSource(self, source):
else:
print("Error in loop gain reference specification.")
self.checkSource(need = False)
return

def checkSource(self, need = True):
"""
Expand Down Expand Up @@ -1241,7 +1215,6 @@ def checkSource(self, need = True):
print("Error: two sources must be of the same type.")
if self.srcUnits == 'I':
self.srcUnits = 'A'
return

def setDetector(self, detector):
"""
Expand Down Expand Up @@ -1288,7 +1261,6 @@ def setDetector(self, detector):
"""
self.detector = detector
self.checkDetector()
return

def checkDetector(self):
"""
Expand Down Expand Up @@ -1359,7 +1331,6 @@ def checkDetector(self):
else:
self.errors += 1
print("Error: missing detector definition.")
return

def setLGref(self, lgRef):
"""
Expand Down Expand Up @@ -1389,7 +1360,6 @@ def setLGref(self, lgRef):
self.checkLGref()
else:
print("Error in loop gain reference specification.")
return

def checkLGref(self):
"""
Expand All @@ -1405,7 +1375,6 @@ def checkLGref(self):
if lgRef != None and lgRef not in self.circuit.controlled:
self.errors += 1
print("Error: unkown loop gain reference: '{0}'.".format(self.lgRef))
return

def delPar(self, parName):
"""
Expand All @@ -1430,7 +1399,6 @@ def delPar(self, parName):
>>> my_instr.circuit.delPar('R')
"""
self.circuit.delPar(parName)
return

def defPar(self, parName, parValue):
"""
Expand All @@ -1456,7 +1424,6 @@ def defPar(self, parName, parValue):

"""
self.circuit.defPar(str(parName), parValue)
return

def defPars(self, parDict):
"""
Expand All @@ -1482,7 +1449,6 @@ def defPars(self, parDict):
"""
# define multiple parameters.
self.circuit.defPars(parDict)
return

def getParValue(self, parName):
"""
Expand Down Expand Up @@ -1658,7 +1624,6 @@ def setCircuit(self, fileName):
>>> my_instr.setCircuit('my_circuit.cir')
"""
self.circuit = _checkCircuit(fileName)
return

def checkCircuit(self):
"""
Expand All @@ -1675,7 +1640,6 @@ def checkCircuit(self):
elif type(self.circuit) != type(circuit()):
self.errors += 1
print("Error: not SLiCAP a circuit object for this instruction.")
return

def _checkNumeric(self):
"""
Expand All @@ -1688,7 +1652,6 @@ def _checkNumeric(self):
if not self.numeric:
self.errors += 1
print("Error: dataType '{0}' not available for simType: '{1}'.".format(self.dataType, self.simType))
return

def checkStep(self):
"""
Expand Down Expand Up @@ -1740,7 +1703,6 @@ def checkStep(self):
tmpLst = self.stepArray[i]
tmpLst = [sp.Rational(item) for item in tmpLst]
self.stepDict[self.stepVars[i]] = tmpLst
return

def check(self):
"""
Expand Down Expand Up @@ -1871,7 +1833,6 @@ def check(self):
self.stepDict = {} # Clear the dictionary with step data
self.checkStep()
self.references = [ref for ref in self.circuit.references]
return

def execute(self):
"""
Expand Down
1 change: 0 additions & 1 deletion SLiCAP/SLiCAPltspice.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,3 @@ def _LTspiceNetlist(fileName, cirTitle):
+ " manually!\n")
except FileNotFoundError:
print("\nError: could not open: '{}'.\nUnable to create netlist with LTspice.".format(baseFileName + '.net'))
return
1 change: 0 additions & 1 deletion SLiCAP/SLiCAPmath.py
Original file line number Diff line number Diff line change
Expand Up @@ -1838,7 +1838,6 @@ def listPZ(pzResult):
else:
print('\nlistPZ() does not support parameter stepping.')
print('\n')
return

def _integrate_all_coeffs(poly, x, x_lower, x_upper, doit=True):
results = {}
Expand Down
Loading