def main(): option='''1> Display individual component 2> Display component average 3> Display Standard Report 4> Sort by alternate column 5> Change Pass/Fail point 6> Exit''' while True: print(option) choice= input("Enter your choice (1-6):") if choice == "1": compute.individual_component() elif choice == "2": compute.Average_component() elif choice == "3": compute.report() elif choice == "4": compute.sorted_component() elif choice == "5": compute.change_grade() elif choice == "6": print("Good Bye",end="") exit(0)
def menu(): choice = input(""" -------------------Main Menu---------------------- 1> Display Individual Component 2> Display component Average 3> Display Standard Report 4> Sort by alternate column 5> change Pass/Fail Point 6> Exit -------------------------------------------------- Enter Choice: """) if choice == '1': cp.individual(students, max_grades) menu() elif choice == '2': choice3 = input("-> Select Component for Average(A1,A2,PR,T1,T2):") if choice3 == 'a1' or choice3 == 'A1': cp.average('a1') elif choice3 == 'a2' or choice3 == 'A2': cp.average('a2') elif choice3 == 'pr' or choice3 == 'PR': cp.average('project') elif choice3 == 't1' or choice3 == 'T1': cp.average('test1') elif choice3 == 't2' or choice3 == 'T2': cp.average('test2') else: print("incorrect choice") menu() elif choice == '3': print("-> Standard Report:") cp.report(students, max_grades, 1) menu() elif choice == '4': print("-> Standard Report:") cp.report(students, max_grades, 0) menu() elif choice == '5': point = input("-> Enter Fail Point (between 0 to 100):") cp.report(students, max_grades, point) menu() elif choice == '6': print("Good Bye") sys.exit() else: print("Incorrect Choice. Choose Between 1 to 6") menu()
# get the time variable to use in the future T = data_s[:, 0] # compute speed and acceleration (veloc_s, accel_s) = compute.velocity(data_s, win_size=WIN_VELOCITY_SIZE) (veloc_t, accel_t) = compute.velocity(data_t, win_size=WIN_VELOCITY_SIZE) # dchanges = compute.dir_changesX2(data, win_size=100) dchanges_s = compute.dir_changesX3(data_s, win_size=WIN_CHANGE_DIR_SIZE) dchanges_t = compute.dir_changesX3(data_t, win_size=WIN_CHANGE_DIR_SIZE) (fs, es, thy, thv, tha, thdc) = compute.decide3(T, data_s[:, 2], veloc_s, veloc_t, accel_s, accel_t, dchanges_s, THRES_V, THRES_Y, THRESHOLD_DC, THRESHOLD_A) intervals = compute.interval_list(fs, es, T) compute.subtitle(intervals, name_sub) bins = compute.report(fs, es, data_s, 0, name_rep, BIN_SIZE) bins_list[key] = bins if SHOW_3D: utils.plot3d(data_t[:, 1], data_t[:, 2], data_s[:, 2], fs, es, XLIMS, YLIMS, ZLIMS, fname=name_fig2, fdpi=FIG_DPI, style=FIG3D, style_normal=FIG3D_NORMAL, style_erratic=FIG3D_ERRATIC, style_freeze=FIG3D_FREEZE) plt.figure(1) plt.subplot(5, 1, 1) plt.plot(T, data_s[:, 1], 'b') # X plt.plot(T, -data_t[:, 1], 'g') # X plt.subplot(5, 1, 2) plt.plot(T, data_s[:, 2]) # Y plt.axhline(thy) plt.subplot(5, 1, 3)
# get the time variable to use in the future T = data[:, 0] # compute speed and acceleration (veloc, accel) = compute.velocity(data_smooth, win_size=125) #dchanges = compute.dir_changesX2(data, win_size=100) dchanges = compute.dir_changesX3(data, win_size=10) #(fs, es) = compute.decide(data, veloc, accel, dchanges) (fs, es) = compute.decide2(T, veloc, data[:, 2], accel, dchanges) intervals = compute.interval_list(fs, es, data, 0) compute.subtitle(intervals, name_sub) compute.report(fs, es, data, 0, name_rep) plt.figure(1) plt.subplot(5, 1, 1) plt.plot(T, data[:, 1]) # X plt.subplot(5, 1, 2) plt.plot(T, data[:, 2]) # Y plt.subplot(5, 1, 3) plt.plot(T, veloc, 'r') # veloc plt.axhline(0.1) THRES = 7.5 plt.subplot(5, 1, 4) plt.axhline(THRES)