Skip to content

Commit a1f9a4f

Browse files
committed
python formatting: autopep8 . --select E12,E101
1 parent eb89ba3 commit a1f9a4f

File tree

15 files changed

+931
-931
lines changed

15 files changed

+931
-931
lines changed

data/ft.py

Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -20,35 +20,35 @@
2020
filename = 'ft_data.out'
2121

2222
def create_data(data):
23-
vbe = data[0,1]-data[0,3]
24-
IC = data[0,5]
25-
ic = data[:,9] + 1j*data[:,10]
26-
ib = data[:,7] + 1j*data[:,8]
27-
beta = abs(ic / ib)
28-
f = data[:,0]
29-
betadc = beta[0]
30-
ft = None
31-
if betadc > 1:
32-
for i in range(1, len(beta)):
33-
if beta[i] < 1:
34-
# simple linear interpolation
35-
# should use log
36-
y1 = numpy.log(beta[i])
37-
y0 = numpy.log(beta[i-1])
38-
x1 = numpy.log(f[i])
39-
x0 = numpy.log(f[i-1])
40-
m = (y1-y0)/(x1-x0)
41-
x = x1 - y1/m
42-
ft = numpy.exp(x)
43-
break
44-
return (vbe, {
45-
'f' : f,
46-
'ib' : ib, #ac ib
47-
'ic' : ic, #ac ic
48-
'IC' : IC, #dc Ic
49-
'beta' : beta, #ac beta
50-
'ft' : ft,
51-
})
23+
vbe = data[0,1]-data[0,3]
24+
IC = data[0,5]
25+
ic = data[:,9] + 1j*data[:,10]
26+
ib = data[:,7] + 1j*data[:,8]
27+
beta = abs(ic / ib)
28+
f = data[:,0]
29+
betadc = beta[0]
30+
ft = None
31+
if betadc > 1:
32+
for i in range(1, len(beta)):
33+
if beta[i] < 1:
34+
# simple linear interpolation
35+
# should use log
36+
y1 = numpy.log(beta[i])
37+
y0 = numpy.log(beta[i-1])
38+
x1 = numpy.log(f[i])
39+
x0 = numpy.log(f[i-1])
40+
m = (y1-y0)/(x1-x0)
41+
x = x1 - y1/m
42+
ft = numpy.exp(x)
43+
break
44+
return (vbe, {
45+
'f' : f,
46+
'ib' : ib, #ac ib
47+
'ic' : ic, #ac ic
48+
'IC' : IC, #dc Ic
49+
'beta' : beta, #ac beta
50+
'ft' : ft,
51+
})
5252

5353
data = pylab.loadtxt(filename)
5454
#print len(data)
@@ -57,17 +57,17 @@ def create_data(data):
5757
imin = 0
5858
datasets = []
5959
for i in range(1,len(data)):
60-
f = data[i,0]
61-
if f == fmin:
62-
datasets.append(create_data(data[imin:i]))
63-
imin = i
60+
f = data[i,0]
61+
if f == fmin:
62+
datasets.append(create_data(data[imin:i]))
63+
imin = i
6464
datasets.append(create_data(data[imin:i]))
6565
#print datasets
6666
pylab.figure()
6767
for v, d in datasets:
68-
#print '%g %d' %(v, round(v*10))
69-
if abs(round(v*10.0) - v*10.0) < 1e-2:
70-
pylab.loglog(d['f'], d['beta'], label=str(v))
68+
#print '%g %d' %(v, round(v*10))
69+
if abs(round(v*10.0) - v*10.0) < 1e-2:
70+
pylab.loglog(d['f'], d['beta'], label=str(v))
7171
pylab.xlabel(r'$f$ (Hz)')
7272
pylab.ylabel(r'$|\beta\|$')
7373
pylab.legend(loc='upper right')
@@ -80,9 +80,9 @@ def create_data(data):
8080
ft = []
8181
pylab.ticklabel_format(style='sci', axis='y', scilimits=(0,0))
8282
for i in datasets:
83-
if i[1]['ft']:
84-
IC.append(i[1]['IC'])
85-
ft.append(i[1]['ft'])
83+
if i[1]['ft']:
84+
IC.append(i[1]['IC'])
85+
ft.append(i[1]['ft'])
8686
pylab.semilogx(IC, ft, '-+')
8787
pylab.xlabel(r"$I_c$ (A/cm)")
8888
pylab.ylabel(r"$f_T$ (Hz)")

data/ic_vce.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@
3333
)
3434

3535
for filename in files:
36-
data = pylab.loadtxt(filename)
37-
vce = data[:,1]-data[:,2]
38-
ic = data[:,4]
39-
pylab.plot(vce, ic)
36+
data = pylab.loadtxt(filename)
37+
vce = data[:,1]-data[:,2]
38+
ic = data[:,4]
39+
pylab.plot(vce, ic)
4040

4141
pylab.xlabel(r"$V_{ce}$ (V)")
4242
pylab.ylabel(r"$I_c$ (A/cm)")

simdir/bjt_common.py

Lines changed: 69 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -18,84 +18,84 @@
1818
import netdoping
1919

2020
def make_bias(contact):
21-
def mycall():
22-
print("BIAS %s %1.15g" % (contact, get_circuit_node_value(solution="dcop", node=GetContactBiasName(contact))))
23-
return mycall
21+
def mycall():
22+
print("BIAS %s %1.15g" % (contact, get_circuit_node_value(solution="dcop", node=GetContactBiasName(contact))))
23+
return mycall
2424

2525
def make_sweep(contact_names, bias_names):
26-
#cnames = ("base", "collector", "emitter")
27-
def mycall():
28-
v=[]
26+
#cnames = ("base", "collector", "emitter")
27+
def mycall():
28+
v=[]
29+
for c in contact_names:
30+
v.append("%1.15g" % get_circuit_node_value(solution="dcop", node=GetContactBiasName(c)))
31+
for b in bias_names:
32+
v.append("%1.15g" % -get_circuit_node_value(solution="dcop", node=b+".I"))
33+
print("CURVE: " + " ".join(v))
34+
h = []
2935
for c in contact_names:
30-
v.append("%1.15g" % get_circuit_node_value(solution="dcop", node=GetContactBiasName(c)))
31-
for b in bias_names:
32-
v.append("%1.15g" % -get_circuit_node_value(solution="dcop", node=b+".I"))
33-
print("CURVE: " + " ".join(v))
34-
h = []
35-
for c in contact_names:
36-
h.append("V(%s)" % c)
37-
for c in contact_names:
38-
h.append("I(%s)" % c)
39-
print("HEADER: " + " ".join(h))
40-
return mycall
36+
h.append("V(%s)" % c)
37+
for c in contact_names:
38+
h.append("I(%s)" % c)
39+
print("HEADER: " + " ".join(h))
40+
return mycall
4141

4242
def make_ac_callback(contact_names, bias_names, minf, maxf, ppd):
43-
cnames = ("base", "collector", "emitter")
44-
if (minf > maxf) or (minf <= 0.0) or (ppd <= 0):
45-
raise NameError("minf must be less than maxf and greater than zero. ppd must be greater than 0")
46-
ppde = pow(10, 1/ppd)
47-
f = minf
48-
freqs = [minf]
49-
while f < maxf:
50-
f *= ppde
51-
if f > maxf:
52-
f = maxf
53-
freqs.append(f)
54-
h = ["f"]
55-
for c in contact_names:
56-
h.append("V(%s)" % c)
57-
for c in contact_names:
58-
h.append("I(%s)" % c)
59-
for c in contact_names:
60-
h.append("IR(%s)" % c)
61-
h.append("II(%s)" % c)
62-
print("ACHEADER: " + " ".join(h))
63-
def ac_callback():
64-
# solve a few extra times for better ac sensitivity
65-
solve(type="dc", absolute_error=1e10, relative_error=1e-2, maximum_iterations=40)
66-
solve(type="dc", absolute_error=1e10, relative_error=1e-2, maximum_iterations=40)
67-
solve(type="dc", absolute_error=1e10, relative_error=1e-2, maximum_iterations=40)
68-
cinfo = []
43+
cnames = ("base", "collector", "emitter")
44+
if (minf > maxf) or (minf <= 0.0) or (ppd <= 0):
45+
raise NameError("minf must be less than maxf and greater than zero. ppd must be greater than 0")
46+
ppde = pow(10, 1/ppd)
47+
f = minf
48+
freqs = [minf]
49+
while f < maxf:
50+
f *= ppde
51+
if f > maxf:
52+
f = maxf
53+
freqs.append(f)
54+
h = ["f"]
55+
for c in contact_names:
56+
h.append("V(%s)" % c)
57+
for c in contact_names:
58+
h.append("I(%s)" % c)
6959
for c in contact_names:
70-
cinfo.append("%1.15g" % get_circuit_node_value(solution="dcop", node=GetContactBiasName(c)))
71-
for b in bias_names:
72-
cinfo.append("%1.15g" % -get_circuit_node_value(solution="dcop", node=b+".I"))
73-
for f in freqs:
74-
v = ["%1.15g" % f]
75-
v.extend(cinfo)
76-
solve(type="ac", frequency=f)
77-
for b in bias_names:
78-
v.append("%1.15g" % -get_circuit_node_value(solution="ssac_real", node=b+".I"))
79-
v.append("%1.15g" % -get_circuit_node_value(solution="ssac_imag", node=b+".I"))
80-
print("AC: " + " ".join(v))
81-
return ac_callback
60+
h.append("IR(%s)" % c)
61+
h.append("II(%s)" % c)
62+
print("ACHEADER: " + " ".join(h))
63+
def ac_callback():
64+
# solve a few extra times for better ac sensitivity
65+
solve(type="dc", absolute_error=1e10, relative_error=1e-2, maximum_iterations=40)
66+
solve(type="dc", absolute_error=1e10, relative_error=1e-2, maximum_iterations=40)
67+
solve(type="dc", absolute_error=1e10, relative_error=1e-2, maximum_iterations=40)
68+
cinfo = []
69+
for c in contact_names:
70+
cinfo.append("%1.15g" % get_circuit_node_value(solution="dcop", node=GetContactBiasName(c)))
71+
for b in bias_names:
72+
cinfo.append("%1.15g" % -get_circuit_node_value(solution="dcop", node=b+".I"))
73+
for f in freqs:
74+
v = ["%1.15g" % f]
75+
v.extend(cinfo)
76+
solve(type="ac", frequency=f)
77+
for b in bias_names:
78+
v.append("%1.15g" % -get_circuit_node_value(solution="ssac_real", node=b+".I"))
79+
v.append("%1.15g" % -get_circuit_node_value(solution="ssac_imag", node=b+".I"))
80+
print("AC: " + " ".join(v))
81+
return ac_callback
8282

8383
def run():
84-
device="bjt"
85-
region="bjt"
86-
load_devices(file="bjt_dd_0.msh")
87-
bjt_params.run(device, region)
88-
netdoping.set_params(device, region)
89-
SetSiliconParameters(device, region)
84+
device="bjt"
85+
region="bjt"
86+
load_devices(file="bjt_dd_0.msh")
87+
bjt_params.run(device, region)
88+
netdoping.set_params(device, region)
89+
SetSiliconParameters(device, region)
9090

91-
for c in ("base", "emitter", "collector"):
92-
#set_parameter(device=device, region=region, name=GetContactBiasName(c), value=0.0)
93-
CreateSiliconDriftDiffusionContact(device, region, c, "Jn", "Jp", True)
94-
# use first initial of each contact name
95-
circuit_element(name="V%s" % c[0], n1=GetContactBiasName(c), n2="0", value=0.0)
91+
for c in ("base", "emitter", "collector"):
92+
#set_parameter(device=device, region=region, name=GetContactBiasName(c), value=0.0)
93+
CreateSiliconDriftDiffusionContact(device, region, c, "Jn", "Jp", True)
94+
# use first initial of each contact name
95+
circuit_element(name="V%s" % c[0], n1=GetContactBiasName(c), n2="0", value=0.0)
9696

97-
solve(type="dc", absolute_error=1e6, relative_error=1e-1, maximum_iterations=40)
98-
solve(type="dc", absolute_error=1e6, relative_error=1e-1, maximum_iterations=40)
99-
solve(type="dc", absolute_error=1e6, relative_error=1e-1, maximum_iterations=40)
97+
solve(type="dc", absolute_error=1e6, relative_error=1e-1, maximum_iterations=40)
98+
solve(type="dc", absolute_error=1e6, relative_error=1e-1, maximum_iterations=40)
99+
solve(type="dc", absolute_error=1e6, relative_error=1e-1, maximum_iterations=40)
100100

101101

simdir/bjt_params.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
from devsim import *
1616

1717
def run(device, region):
18-
pass
18+
pass
1919
# set_parameter(device=device, region=region, name="BETAN", value=2.0)
2020
# set_parameter(device=device, region=region, name="BETAP", value=1.0)
2121
# set_parameter(device=device, region=region, name="VSATN0", value=2.4e7)

simdir/bjt_refine.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434

3535
import refinement
3636
refinement.run(device, region, outfile="bjt_bgmesh.pos", mincl=2.0e-6, maxcl=1e-4, pdiff=0.025)
37-
37+
3838
# this is is the devsim format
3939
write_devices (file="bjt_refine.tec", type="tecplot")
4040

simdir/bjt_restart.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
set_parameter(device=device, region=region, name="p1", value=1e10)
4242

4343
for c in ("base", "emitter", "collector"):
44-
set_parameter(device=device, region=region, name=GetContactBiasName(c), value=0.0)
44+
set_parameter(device=device, region=region, name=GetContactBiasName(c), value=0.0)
4545
solve(type="dc", absolute_error=1e6, relative_error=1e-1, maximum_iterations=40)
4646
write_devices (file="bjt_dd_1.msh", type="devsim")
4747

0 commit comments

Comments
 (0)