def process_parameters(self, initial_settings, _saved_settings=None): """ Process information to properly set the initial settings """ if initial_settings.R_value_used: R_str = "R" else: R_str = "" num_binding_sites = initial_settings.num_binding_sites.get() solutes, charges = self.get_settings(initial_settings) print 'making script with num binding sties= ', num_binding_sites QR_str = "single Q" + R_str # make the script for the Eyring rate model print 'mpmath used = ', initial_settings.mpmath_used if initial_settings.mpmath_used: math_package = 'mpmath' else: math_package = 'numpy' print 'math package: ', math_package _eyring_rate_script = script_maker.make_template(math_package, num_binding_sites, solutes, charges, QR_str) with open("eyring_rate_script.py", "w") as _file: _file.write(_eyring_rate_script) _file.close() reload(eyring_rate_script) self.set_parameters(solutes, initial_settings.charges, initial_settings.num_binding_sites.get(), _saved_settings)
'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,