def doMain2(self): mmain = main.ClassMain() mmain.doMain() big = BigHead2.ClassBigHead2() big.doBigHead2() aff = Affix2.ClassAffix2() aff.doAffix2() # subprocess.Popen("del output_result.txt",shell=True) # subprocess.Popen("crf_test.exe -m model118x outputAffix.txt >> output_result.txt",shell=True) #注意:Popen是并行的,不会阻塞父进程,call是阻塞式的,父进程会等待子进程完成任务才继续 subprocess.call("del datas\\output_result.txt",shell=True) subprocess.call("crfpp\\crf_test.exe -m crfpp\\model118x datas\\outputAffix.txt >> datas\\output_result.txt",shell=True) #format oformat = OutputFormat.ClassOutputFormat() result = oformat.doFormat() return result
outfile.close() inParams = InputParameters.InputParameters() InputFormat.get_input(filename, inParams) DerivedValues.derived_values(inParams, inParams.F_vect_1, inParams.x_1, inParams.x_2) InputConstraints.input_constraints(inParams, pi) F_vect_AC = Calculations.func_F_vect_AC(inParams) outfile = open("log.txt", "a") print("var 'F_vect_AC' assigned ", end="", file=outfile) print(F_vect_AC, end="", file=outfile) print(" in module Control", file=outfile) outfile.close() F_vect_BC = Calculations.func_F_vect_BC(inParams) outfile = open("log.txt", "a") print("var 'F_vect_BC' assigned ", end="", file=outfile) print(F_vect_BC, end="", file=outfile) print(" in module Control", file=outfile) outfile.close() F_vect_AD = Calculations.func_F_vect_AD(inParams, F_vect_AC) outfile = open("log.txt", "a") print("var 'F_vect_AD' assigned ", end="", file=outfile) print(F_vect_AD, end="", file=outfile) print(" in module Control", file=outfile) outfile.close() F_vect_BD = Calculations.func_F_vect_BD(inParams, F_vect_BC) outfile = open("log.txt", "a") print("var 'F_vect_BD' assigned ", end="", file=outfile) print(F_vect_BD, end="", file=outfile) print(" in module Control", file=outfile) outfile.close() OutputFormat.write_output(inParams, F_vect_AC, F_vect_AD, F_vect_BC, F_vect_BD)
## \file Control.py # \author Thulasi Jegatheesan # \brief Controls the flow of the program import sys import InputParameters import OutputFormat filename = sys.argv[1] A_C, C_W, h_C, T_init, t_final, L, T_C, t_step, rho_W, D, A_tol, R_tol, T_W, E_W = InputParameters.get_input( filename) InputParameters.input_constraints(A_C, C_W, h_C, T_init, t_final, L, T_C, t_step, rho_W, D, T_W, E_W) OutputFormat.write_output(T_W, E_W)
## \file Control.py # \author Samuel J. Crawford, Brooks MacLachlan, and W. Spencer Smith # \brief Controls the flow of the program import sys import Calculations import InputParameters import OutputFormat filename = sys.argv[1] g_vect = 9.8 epsilon = 2.0e-2 inParams = InputParameters.InputParameters(filename) t_flight = Calculations.func_t_flight(inParams, g_vect) p_land = Calculations.func_p_land(inParams, g_vect) d_offset = Calculations.func_d_offset(inParams, p_land) s = Calculations.func_s(inParams, epsilon, d_offset) OutputFormat.write_output(s, d_offset)
cov = coverage.Coverage() cov.start() filename = sys.argv[1] f = open(filename, "r") # read input (F_1, X_1, X_2, theta_1, theta_2) = InputParameters.get_input(f) f.close() inParams = (F_1, X_1, X_2, theta_1, theta_2) calledfunc = "Control" # do the calculationsif inputs are valid if (InputConstraints.input_constraints(inParams, calledfunc)): (F_Ax, F_Ay, F_By) = InputParameters.derived_values(F_1, X_1, X_2) F_AC = Calculations.func_F_AC(F_Ay, theta_1) F_AD = Calculations.func_F_AD(F_AC, theta_1) F_BC = Calculations.func_F_BC(F_By, theta_2) F_BD = Calculations.func_F_BD(F_BC, theta_2) F_CD = Calculations.func_F_CD(F_1) OutputFormat.write_output(F_AC, F_AD, F_BC, F_BD, F_CD) cov.stop() cov.save() # generate coverage report cov.html_report() # end timer end = time.time() print("execution time = ", end - start)
import Calculations import OutputFormat import ReadTable filename = sys.argv[1] inparams = InputParameters.InputParameters() InputFormat.get_input(filename, inparams) DerivedValues.derived_params(inparams) InputConstraints.check_constraints(inparams) w_array = ReadTable.read_z_array("TSD.txt") data_sd = ReadTable.read_x_array("TSD.txt") data_q = ReadTable.read_y_array("TSD.txt") j_array = ReadTable.read_z_array("SDF.txt") data_asprat = ReadTable.read_x_array("SDF.txt") data_qstar = ReadTable.read_y_array("SDF.txt") q = Interpolation.interpY(data_sd, data_q, w_array, inparams.sd, inparams.wtnt) q_hat = Calculations.calc_q_hat(q, inparams) j_tol = Calculations.calc_j_tol(inparams) j = Interpolation.interpZ(data_asprat, data_qstar, j_array, inparams.asprat, q_hat) q_hat_tol = Interpolation.interpY(data_asprat, data_qstar, j_array, inparams.asprat, j_tol) pb = Calculations.calc_pb(j, inparams) nfl = Calculations.calc_nfl(q_hat_tol, inparams) lr = Calculations.calc_lr(nfl, inparams) is_safe1 = Calculations.calc_is_safe1(pb, inparams) is_safe2 = Calculations.calc_is_safe2(lr, q) OutputFormat.display_output("outputfile.txt", q, j, q_hat_tol, pb, lr, nfl, is_safe1, is_safe2, inparams) print("Main has been executed and the results have been written to 'outputfile.txt'.");
for my_datetime in result_datetime_list: for my_forecast_group_name in forecast_group_name_list: for my_model_name in model_name_list: for my_test_name in test_name_list: test_result = TestResult.TestResult() test_result.forecast_group_name = my_forecast_group_name test_result.status = ResultStatus.INITIAL test_result.softwareVersion = __version__ test_result.test_name = my_test_name test_result.model_name = my_model_name test_result.resultDateTime = my_datetime test_result.processingDateTime = "%4d-%02d-%02d" % ( curdate.year, curdate.month, curdate.day) test_result = ResultFinder.get_result_data( test_result, config, my_model_name, my_test_name, my_datetime) fg_results.append(test_result) # # One or more reports can be generated about this format group using # configuration items in the forecast_group_report.cfg file # for report in report_name_list: OutputFormat.report(report, fg_results, report_start_datetime, report_end_datetime, model_names, test_names) # # Exit Success # sys.exit(True)
from __future__ import print_function import sys import math import InputParameters import DerivedValues import InputConstraints import InputFormat import OutputFormat import Calculations inputfile = sys.argv[1] inParams = InputParameters.InputParameters() InputFormat.func_get_input(inputfile, inParams) DerivedValues.derived_values(inParams) InputConstraints.input_constraints(inParams) J_tol = Calculations.func_J_tol(inParams) q = Calculations.func_q(inParams) q_hat = Calculations.func_q_hat(inParams, q) q_hat_tol = Calculations.func_q_hat_tol(inParams, J_tol) J = Calculations.func_J(inParams, q_hat) NFL = Calculations.func_NFL(inParams, q_hat_tol) B = Calculations.func_B(inParams, J) LR = Calculations.func_LR(inParams, NFL) is_safeLR = Calculations.func_is_safeLR(LR, q) P_b = Calculations.func_P_b(B) is_safePb = Calculations.func_is_safePb(inParams, P_b) OutputFormat.write_output(is_safePb, is_safeLR, P_b)
outfile = open("log.txt", "a") print("var 'B' assigned to ", end='', file=outfile) print(B, end='', file=outfile) print(" in module Control", file=outfile) outfile.close() LR = Calculations.func_LR(inParams, NFL) outfile = open("log.txt", "a") print("var 'LR' assigned to ", end='', file=outfile) print(LR, end='', file=outfile) print(" in module Control", file=outfile) outfile.close() is_safeLR = Calculations.func_is_safeLR(LR, q) outfile = open("log.txt", "a") print("var 'is_safeLR' assigned to ", end='', file=outfile) print(is_safeLR, end='', file=outfile) print(" in module Control", file=outfile) outfile.close() P_b = Calculations.func_P_b(B) outfile = open("log.txt", "a") print("var 'P_b' assigned to ", end='', file=outfile) print(P_b, end='', file=outfile) print(" in module Control", file=outfile) outfile.close() is_safePb = Calculations.func_is_safePb(inParams, P_b) outfile = open("log.txt", "a") print("var 'is_safePb' assigned to ", end='', file=outfile) print(is_safePb, end='', file=outfile) print(" in module Control", file=outfile) outfile.close() OutputFormat.write_output(is_safePb, is_safeLR, P_b)
outfile = open("log.txt", "a") print("var 'B' assigned ", end="", file=outfile) print(B, end="", file=outfile) print(" in module Control", file=outfile) outfile.close() LR = Calculations.func_LR(inParams, NFL) outfile = open("log.txt", "a") print("var 'LR' assigned ", end="", file=outfile) print(LR, end="", file=outfile) print(" in module Control", file=outfile) outfile.close() isSafeLR = Calculations.func_isSafeLR(LR, q) outfile = open("log.txt", "a") print("var 'isSafeLR' assigned ", end="", file=outfile) print(isSafeLR, end="", file=outfile) print(" in module Control", file=outfile) outfile.close() P_b = Calculations.func_P_b(B) outfile = open("log.txt", "a") print("var 'P_b' assigned ", end="", file=outfile) print(P_b, end="", file=outfile) print(" in module Control", file=outfile) outfile.close() isSafePb = Calculations.func_isSafePb(inParams, P_b) outfile = open("log.txt", "a") print("var 'isSafePb' assigned ", end="", file=outfile) print(isSafePb, end="", file=outfile) print(" in module Control", file=outfile) outfile.close() OutputFormat.write_output(isSafePb, isSafeLR, P_b, J)
import sys import Calculations import InputConstraints import InputFormat import InputParameters import OutputFormat filename = sys.argv[1] outfile = open("log.txt", "a") print("var 'filename' assigned ", end="", file=outfile) print(filename, end="", file=outfile) print(" in module Control", file=outfile) outfile.close() inParams = InputParameters.InputParameters() InputFormat.get_input(filename, inParams) InputConstraints.input_constraints(inParams) k = Calculations.func_k(inParams) outfile = open("log.txt", "a") print("var 'k' assigned ", end="", file=outfile) print(k, end="", file=outfile) print(" in module Control", file=outfile) outfile.close() N_p = Calculations.func_N_p(inParams, k) outfile = open("log.txt", "a") print("var 'N_p' assigned ", end="", file=outfile) print(N_p, end="", file=outfile) print(" in module Control", file=outfile) outfile.close() OutputFormat.write_output(k, N_p)
## \file Control.py # \author Thulasi Jegatheesan # \brief Controls the flow of the program import sys import Calculations import InputParameters import OutputFormat filename = sys.argv[1] A_C, C_W, h_C, T_init, t_final, L, T_C, t_step, rho_W, D, A_tol, R_tol, E_W = InputParameters.get_input( filename) V_tank = InputParameters.derived_values(D, L) InputParameters.input_constraints(A_C, C_W, h_C, T_init, t_final, L, T_C, t_step, rho_W, D, E_W) V_W = Calculations.func_V_W(V_tank) m_W = Calculations.func_m_W(rho_W, V_W) tau_W = Calculations.func_tau_W(C_W, h_C, A_C, m_W) T_W = Calculations.func_T_W(T_C, t_final, T_init, A_tol, R_tol, t_step, tau_W) OutputFormat.write_output(E_W, T_W)
from __future__ import print_function import sys import math import InputParameters import InputConstraints import InputFormat import OutputFormat import Calculations inputfile = sys.argv[1] inParams = InputParameters.InputParameters() InputFormat.func_get_input(inputfile, inParams) InputConstraints.input_constraints(inParams) p_land = Calculations.func_p_land(inParams) offset = Calculations.func_offset(inParams, p_land) message = Calculations.func_message(inParams, offset) OutputFormat.write_output(message, offset)
import ReadTable filename = sys.argv[1] inparams = InputParameters.InputParameters() InputFormat.get_input(filename, inparams) DerivedValues.derived_params(inparams) InputConstraints.check_constraints(inparams) w_array = ReadTable.read_z_array("TSD.txt") data_sd = ReadTable.read_x_array("TSD.txt") data_q = ReadTable.read_y_array("TSD.txt") j_array = ReadTable.read_z_array("SDF.txt") data_asprat = ReadTable.read_x_array("SDF.txt") data_qstar = ReadTable.read_y_array("SDF.txt") q = Interpolation.interpY(data_sd, data_q, w_array, inparams.sd, inparams.wtnt) q_hat = Calculations.calc_q_hat(q, inparams) j_tol = Calculations.calc_j_tol(inparams) j = Interpolation.interpZ(data_asprat, data_qstar, j_array, inparams.asprat, q_hat) q_hat_tol = Interpolation.interpY(data_asprat, data_qstar, j_array, inparams.asprat, j_tol) pb = Calculations.calc_pb(j, inparams) nfl = Calculations.calc_nfl(q_hat_tol, inparams) lr = Calculations.calc_lr(nfl, inparams) is_safe1 = Calculations.calc_is_safe1(pb, inparams) is_safe2 = Calculations.calc_is_safe2(lr, q) OutputFormat.display_output("outputfile.txt", q, j, q_hat_tol, pb, lr, nfl, is_safe1, is_safe2, inparams) print( "Main has been executed and the results have been written to 'outputfile.txt'." )
## \file Control.py # \author Naveen Ganesh Muralidharan # \brief Controls the flow of the program import sys import Calculations import InputParameters import OutputFormat filename = sys.argv[1] r_t, K_d, K_p, t_step, t_sim = InputParameters.get_input(filename) InputParameters.input_constraints(r_t, K_d, K_p, t_step, t_sim) y_t = Calculations.func_y_t(K_d, K_p, r_t, t_sim, t_step) OutputFormat.write_output(y_t)
from __future__ import print_function import sys import math import InputParameters import InputConstraints import InputFormat import OutputFormat import Calculations inputfile = sys.argv[1] inParams = InputParameters.InputParameters() InputFormat.func_get_input(inputfile, inParams) InputConstraints.input_constraints(inParams) d = Calculations.func_d(inParams) short = Calculations.func_short(inParams, d) offset = Calculations.func_offset(inParams, d) hit = Calculations.func_hit(inParams, offset) OutputFormat.write_output(hit, short, offset)