-
Notifications
You must be signed in to change notification settings - Fork 0
/
full_test_caller.py
59 lines (51 loc) · 2.43 KB
/
full_test_caller.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
__author__ = 'Kyle Vitautas Lopin'
import template_maker as tm
import shelve
import importlib
import test_script
ions = ['Na', 'Ca', 'Mg', 'Fe', 'Ba', 'Cd']
charges = [1, 2, 2, 2, 2, 2]
voltages = range(-200, 220, 20)
ion_conc = {'Nai': 0.1, 'Nae': 0.000001,
'Cai': 0.000001, 'Cae': 0.1,
'Mgi': 0.1, 'Mge': 0.000001,
'Fei': 0.000001, 'Fee': 0.1,
'Bai': 0.1, 'Bae': 0.000001,
'Cdi': 0.000001, 'Cde': 0.1}
energy_barriers = {'GNa': [8, -12, 8, -12, 8, -12, 8, -12, 8, -12, 8, -12, 8],
'GCa': [8, -12, 8, -12, 8, -12, 8, -12, 8, -12, 8, -12, 8],
'GMg': [8, -12, 8, -12, 8, -12, 8, -12, 8, -12, 8, -12, 8],
'GFe': [8, -12, 8, -12, 8, -12, 8, -12, 8, -12, 8, -12, 8],
'GBa': [8, -12, 8, -12, 8, -12, 8, -12, 8, -12, 8, -12, 8],
'GCd': [8, -12, 8, -12, 8, -12, 8, -12, 8, -12, 8, -12, 8]}
Qs = 30*[5]
Rs = 30*[0.5]
total_results_eig = []
total_results_svd = []
for num_binding_sites in range(1, 5):
for num_ions in range(1, 5):
print 'num barriers: ', num_binding_sites
print 'num ions: ', num_ions
# make the script make an eyring rate model and save it to test_script.py
eyring_rate_script = tm.make_template('numpy', num_binding_sites, ions[:num_ions], charges, 'full QR')
with open("test_script.py", "w") as file:
file.write(eyring_rate_script)
file.close()
# make a list of the electrical distances to update the energy_barriers dict with
distance_buffer = 2 * (num_binding_sites + 1)
distance = []
for i in range(1, distance_buffer):
distance.append(float(i)/distance_buffer)
energy_barriers['distance'] = distance
# call the erying rate model script made earlier
results_eig, results_svd = test_script.eyring_rate_algo(voltages,
ion_conc,
energy_barriers,
num_binding_sites, Qs, Rs)
print 'humm'
total_results_eig.append(results_eig)
total_results_svd.append(results_svd)
total_results_shelf = shelve.open("Full_Results")
total_results_shelf["total results eig"] = total_results_eig
total_results_shelf["total resutls svd"] = total_results_svd
total_results_shelf.close()