From 2bbb409f1f30b052a160fdb98edd7c2b6603f4ce Mon Sep 17 00:00:00 2001 From: JokinSB <130602216+JokinSB@users.noreply.github.com> Date: Tue, 14 Oct 2025 11:44:51 +0200 Subject: [PATCH 1/3] Renamed file due to quotes on name giving problems in Windows. --- "docs/csv/\"BJT voltage amplifier\".csv" | 2 -- 1 file changed, 2 deletions(-) delete mode 100644 "docs/csv/\"BJT voltage amplifier\".csv" diff --git "a/docs/csv/\"BJT voltage amplifier\".csv" "b/docs/csv/\"BJT voltage amplifier\".csv" deleted file mode 100644 index 7d2b48d..0000000 --- "a/docs/csv/\"BJT voltage amplifier\".csv" +++ /dev/null @@ -1,2 +0,0 @@ - c2 V_c1 V_b1 V_e1 V_c2 V_e2 I_V2 - 4.29572571e+00 2.49185497e+00 1.76367933e+00 1.15679378e+00 4.29572571e+00 1.81259412e+00 -2.96938791e-03 From 26eb7581393c0cb6b8d12b4aed26975af61dae84 Mon Sep 17 00:00:00 2001 From: JokinSB <130602216+JokinSB@users.noreply.github.com> Date: Tue, 14 Oct 2025 11:49:01 +0200 Subject: [PATCH 2/3] Renamed file to avoid quotes on name. --- docs/csv/BJT voltage amplifier.csv | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 docs/csv/BJT voltage amplifier.csv diff --git a/docs/csv/BJT voltage amplifier.csv b/docs/csv/BJT voltage amplifier.csv new file mode 100644 index 0000000..7d2b48d --- /dev/null +++ b/docs/csv/BJT voltage amplifier.csv @@ -0,0 +1,2 @@ + c2 V_c1 V_b1 V_e1 V_c2 V_e2 I_V2 + 4.29572571e+00 2.49185497e+00 1.76367933e+00 1.15679378e+00 4.29572571e+00 1.81259412e+00 -2.96938791e-03 From 390004ccf17e6f09f2a7f1c2f9689d78344d50d8 Mon Sep 17 00:00:00 2001 From: JokinSB <130602216+JokinSB@users.noreply.github.com> Date: Tue, 14 Oct 2025 16:27:00 +0200 Subject: [PATCH 3/3] Removed isolated "return" statements at the end of functions and methods, as they are not needed. --- SLiCAP/SLiCAP.py | 7 ++++--- SLiCAP/SLiCAPgschem.py | 1 - SLiCAP/SLiCAPhtml.py | 5 +---- SLiCAP/SLiCAPinstruction.py | 39 ------------------------------------- SLiCAP/SLiCAPltspice.py | 1 - SLiCAP/SLiCAPmath.py | 1 - SLiCAP/SLiCAPplots.py | 5 ++--- SLiCAP/SLiCAPprotos.py | 4 ---- SLiCAP/SLiCAPyacc.py | 1 - 9 files changed, 7 insertions(+), 57 deletions(-) diff --git a/SLiCAP/SLiCAP.py b/SLiCAP/SLiCAP.py index 9ef92c3..47f8a0f 100644 --- a/SLiCAP/SLiCAP.py +++ b/SLiCAP/SLiCAP.py @@ -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. @@ -43,7 +44,7 @@ def Help(): >>> sl.Help() """ webbrowser.open_new(ini.doc_path + 'index.html') - return + def _copyNotOverwrite(src, dest): """ @@ -57,7 +58,7 @@ def _copyNotOverwrite(src, dest): """ if not os.path.exists(dest): copy2(src, dest) - return + def _makeDir(dirName): """ @@ -69,7 +70,7 @@ def _makeDir(dirName): if not os.path.exists(dirName): os.makedirs(dirName) - return + def initProject(name, notebook=False): """ diff --git a/SLiCAP/SLiCAPgschem.py b/SLiCAP/SLiCAPgschem.py index 539402b..079d8cc 100644 --- a/SLiCAP/SLiCAPgschem.py +++ b/SLiCAP/SLiCAPgschem.py @@ -61,4 +61,3 @@ def _gNetlist(fileName, cirTitle): + "manually!\n") else: print("Error: could not open: '{}'.".format(fileName)) - return \ No newline at end of file diff --git a/SLiCAP/SLiCAPhtml.py b/SLiCAP/SLiCAPhtml.py index d3ba154..749b1cb 100644 --- a/SLiCAP/SLiCAPhtml.py +++ b/SLiCAP/SLiCAPhtml.py @@ -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): """ @@ -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 ########################################################### @@ -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=''): """ @@ -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 != '': diff --git a/SLiCAP/SLiCAPinstruction.py b/SLiCAP/SLiCAPinstruction.py index 59f9e54..58b3289 100644 --- a/SLiCAP/SLiCAPinstruction.py +++ b/SLiCAP/SLiCAPinstruction.py @@ -487,7 +487,6 @@ def setSimType(self, simType): """ self.simType = simType self._checkSimType() - return def _checkSimType(self): """ @@ -546,7 +545,6 @@ def _checkGainType(self): else: print("Error: argument type must be type 'str'.") self.errors += 1 - return def setConvType(self, convType): """ @@ -574,7 +572,6 @@ def _checkConvType(self): self.errors += 1 else: self.convType = None - return def setPairExt(self, pairExt): """ @@ -586,7 +583,6 @@ def setPairExt(self, pairExt): """ if self.checkPairExt(pairExt) == 0: self.pairExt = pairExt - return def checkPairExt(self, pairExt): """ @@ -623,7 +619,6 @@ def setPairedCircuits(self, cirPairs): """ if self.checkPairedCircuits(cirPairs) == 0: self.pairedCircuits = cirPairs - return def checkPairedCircuits(self, circuitPairs): """ @@ -671,7 +666,6 @@ def setDataType(self, dataType): """ self.dataType = dataType self.checkDataType() - return def checkDataType(self): """ @@ -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): """ @@ -706,7 +699,6 @@ def stepOn(self): >>> my_instruction.stepOn() """ self.step = True - return def stepOff(self): """ @@ -722,7 +714,6 @@ def stepOff(self): >>> my_instruction.stepOff() """ self.step = False - return def setStepVar(self, stepVar): """ @@ -757,7 +748,6 @@ def setStepVar(self, stepVar): """ self.stepVar = stepVar self.checkStepVar() - return def checkStepVar(self): """ @@ -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): """ @@ -820,7 +809,6 @@ def setStepVars(self, stepVars): """ self.stepVars = stepVars self.checkStepVars() - return def checkStepVars(self): """ @@ -855,7 +843,6 @@ def checkStepVars(self): print("Error: argument should be a list.") errors += 1 self.errors += errors - return def setStepMethod(self, stepMethod): """ @@ -878,7 +865,6 @@ def setStepMethod(self, stepMethod): """ self.stepMethod = stepMethod self.checkStepMethod() - return def checkStepMethod(self): """ @@ -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): """ @@ -926,7 +911,6 @@ def setStepStart(self, stepStart): """ self.stepStart = stepStart self.checkStepStart() - return def checkStepStart(self): """ @@ -944,7 +928,6 @@ def checkStepStart(self): print("Error: cannot determine numeric value of stepStart.") else: self.stepStart = value - return def setStepStop(self, stepStop): """ @@ -970,7 +953,6 @@ def setStepStop(self, stepStop): """ self.stepStop = stepStop self.checkStepStop() - return def checkStepStop(self): """ @@ -988,7 +970,6 @@ def checkStepStop(self): print("Error: cannot determine numeric value of stepStop.") else: self.stepStop = value - return def setStepNum(self, stepNum): """ @@ -1014,7 +995,6 @@ def setStepNum(self, stepNum): """ self.stepNum = stepNum self.checkStepNum() - return def checkStepNum(self): """ @@ -1035,7 +1015,6 @@ def checkStepNum(self): else: self.errors += 1 print("Error: step number type must be 'int'.") - return def setStepList(self, stepList): """ @@ -1064,7 +1043,6 @@ def setStepList(self, stepList): """ self.stepList = stepList self.checkStepList() - return def checkStepList(self): """ @@ -1089,7 +1067,6 @@ def checkStepList(self): else: self.errors += 1 print("Error: expected a list type for 'stepValues'.") - return def setStepArray(self, stepArray): """ @@ -1118,7 +1095,6 @@ def setStepArray(self, stepArray): """ self.stepArray = stepArray self.checkStepArray() - return def checkStepArray(self): """ @@ -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): @@ -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): """ @@ -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): """ @@ -1288,7 +1261,6 @@ def setDetector(self, detector): """ self.detector = detector self.checkDetector() - return def checkDetector(self): """ @@ -1359,7 +1331,6 @@ def checkDetector(self): else: self.errors += 1 print("Error: missing detector definition.") - return def setLGref(self, lgRef): """ @@ -1389,7 +1360,6 @@ def setLGref(self, lgRef): self.checkLGref() else: print("Error in loop gain reference specification.") - return def checkLGref(self): """ @@ -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): """ @@ -1430,7 +1399,6 @@ def delPar(self, parName): >>> my_instr.circuit.delPar('R') """ self.circuit.delPar(parName) - return def defPar(self, parName, parValue): """ @@ -1456,7 +1424,6 @@ def defPar(self, parName, parValue): """ self.circuit.defPar(str(parName), parValue) - return def defPars(self, parDict): """ @@ -1482,7 +1449,6 @@ def defPars(self, parDict): """ # define multiple parameters. self.circuit.defPars(parDict) - return def getParValue(self, parName): """ @@ -1658,7 +1624,6 @@ def setCircuit(self, fileName): >>> my_instr.setCircuit('my_circuit.cir') """ self.circuit = _checkCircuit(fileName) - return def checkCircuit(self): """ @@ -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): """ @@ -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): """ @@ -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): """ @@ -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): """ diff --git a/SLiCAP/SLiCAPltspice.py b/SLiCAP/SLiCAPltspice.py index c43a4b6..8736b6f 100644 --- a/SLiCAP/SLiCAPltspice.py +++ b/SLiCAP/SLiCAPltspice.py @@ -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 diff --git a/SLiCAP/SLiCAPmath.py b/SLiCAP/SLiCAPmath.py index d9ddd80..d0329d0 100644 --- a/SLiCAP/SLiCAPmath.py +++ b/SLiCAP/SLiCAPmath.py @@ -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 = {} diff --git a/SLiCAP/SLiCAPplots.py b/SLiCAP/SLiCAPplots.py index 997963e..54473b3 100644 --- a/SLiCAP/SLiCAPplots.py +++ b/SLiCAP/SLiCAPplots.py @@ -200,7 +200,6 @@ def __init__(self, title): """ Scale factor (*str*) for the y-scale; e.g. M for 1E6. Defaults to ''. """ - return def makeTraceDict(self): """ @@ -391,7 +390,7 @@ def plot(self): plt.show() self.updateTracedict() plt.close(fig) - return + return True def defaultsPlot(): """ @@ -426,7 +425,7 @@ def defaultsPlot(): t.set_fontsize(ini.plot_fontsize) except: pass - return + def plotSweep(fileName, title, results, sweepStart, sweepStop, sweepNum, sweepVar = 'auto', sweepScale = '', xVar = 'auto', xScale = '', diff --git a/SLiCAP/SLiCAPprotos.py b/SLiCAP/SLiCAPprotos.py index 46bd8fb..4e6eedc 100644 --- a/SLiCAP/SLiCAPprotos.py +++ b/SLiCAP/SLiCAPprotos.py @@ -200,7 +200,6 @@ def delPar(self, parName): if parName in self.parUnits.keys(): self.parUnits.pop(Symbol(str(parName)), None) self.updateParams() - return def defPar(self, parName, parValue, units = None): """ @@ -238,7 +237,6 @@ def defPar(self, parName, parValue, units = None): else: self.parUnits[parName] = '' self.updateParams() - return def defPars(self, parDict): """ @@ -278,7 +276,6 @@ def defPars(self, parDict): else: print("Error: expected a dict type argument.") self.updateParams() - return def getParValue(self, parNames, substitute=True, numeric=False): """ @@ -377,7 +374,6 @@ def updateParams(self): if par != ini.laplace and par != ini.hz and par not in list(self.parDefs.keys()): undefined.append(par) self.params = undefined - return def getElementValue(self, elementID, param='value', substitute=True, numeric=False): """ diff --git a/SLiCAP/SLiCAPyacc.py b/SLiCAP/SLiCAPyacc.py index 4379a6d..c2355ee 100644 --- a/SLiCAP/SLiCAPyacc.py +++ b/SLiCAP/SLiCAPyacc.py @@ -275,7 +275,6 @@ def _parseNetlist(netlist, name, cirType): _addErrors(name, cirType, errors) if name != 'main': print("Error: something wring with circuit hierachy, probably missing '.ends'. in a subcircuit definition.") - return def _createCircuit(name, cirType): newCircuit = circuit()