change print_info and save_info to info_print and info_save ere

Commit
9780f7eabdce984692994250b8a179cff1dc135c
Author
Marius Peter <blendoit@gmail.com>
Author date
Committer
Marius Peter <blendoit@gmail.com>
Committer date
Changed files
creator.py
index fd09e2cd..a468c2d9 100644..100644
@@ -69,7 +69,7 @@
69 69 def __str__(self):
70 70 return type(self).__name__
71 71
72 Removed: def print_info(self, round):
72 Added: def info_print(self, round):
73 73 '''
74 74 Print all the component's coordinates to the terminal.
75 75
@@ -91,7 +91,7 @@
91 91 print('z_l the lower z-coordinates:\n', np.around(self.z_l, round))
92 92 return None
93 93
94 Removed: def save_info(self, save_dir_path, number):
94 Added: def info_save(self, save_dir_path, number):
95 95 '''
96 96 Save all the object's coordinates (must be full path).
97 97 '''
@@ -100,7 +100,7 @@
100 100 full_path = os.path.join(save_dir_path, file_name)
101 101 try:
102 102 with open(full_path, 'w') as sys.stdout:
103 Removed: self.print_info(6)
103 Added: self.info_print(6)
104 104 # This line required to reset behavior of sys.stdout
105 105 sys.stdout = sys.__stdout__
106 106 print('Successfully wrote to file {}'.format(full_path))
@@ -218,8 +218,8 @@
218 218 def add_mass(self, mass):
219 219 self.mass = mass
220 220
221 Removed: def print_info(self, round):
222 Removed: super().print_info(round)
221 Added: def info_print(self, round):
222 Added: super().info_print(round)
223 223 print('x_c the camber x-coordinates:\n', np.around(self.x_u, round))
224 224 print('z_c the camber z-coordinates:\n', np.around(self.x_u, round))
225 225 return None
@@ -408,8 +408,8 @@
408 408 self.mass = len(self.x_u) * mass + len(self.x_l) * mass
409 409 return None
410 410
411 Removed: def print_info(self, round):
412 Removed: super().print_info(round)
411 Added: def info_print(self, round):
412 Added: super().info_print(round)
413 413 print('Stringer Area:\n', np.around(self.area, round))
414 414 return None
415 415
evaluator.py
index c21ca2e0..9a541206 100644..100644
@@ -53,7 +53,7 @@
53 53 # Drag
54 54 self.drag = []
55 55
56 Removed: def print_info(self, round):
56 Added: def info_print(self, round):
57 57 '''
58 58 Print all the component's evaluated data to the terminal.
59 59
@@ -78,14 +78,14 @@
78 78 print('Drag:\n', np.around(self.drag, round))
79 79 return None
80 80
81 Removed: def save_info(self, save_dir_path, number):
81 Added: def info_save(self, save_dir_path, number):
82 82 '''Save all the object's coordinates (must be full path).'''
83 83
84 84 file_name = 'airfoil_{}_eval.txt'.format(number)
85 85 full_path = os.path.join(save_dir_path, file_name)
86 86 try:
87 87 with open(full_path, 'w') as sys.stdout:
88 Removed: self.print_info(6)
88 Added: self.info_print(6)
89 89 # This line required to reset behavior of sys.stdout
90 90 sys.stdout = sys.__stdout__
91 91 print('Successfully wrote to file {}'.format(full_path))
main.py
index 8805f11c..a59fcff5 100644..100644
@@ -58,8 +58,8 @@
58 58 # Define NACA airfoil coordinates and mass
59 59 af.add_naca(NACA_NUM)
60 60 af.add_mass(AIRFOIL_MASS)
61 Removed: # af.print_info(2)
62 Removed: # af.save_info(SAVE_PATH, _)
61 Added: # af.info_print(2)
62 Added: # af.info_save(SAVE_PATH, _)
63 63
64 64 # Create spar instance
65 65 af.spar = creator.Spar()
@@ -67,8 +67,8 @@
67 67 af.spar.add_coord(af.coord, 0.15)
68 68 af.spar.add_coord(af.coord, 0.55)
69 69 af.spar.add_mass(SPAR_MASS)
70 Removed: # af.spar.print_info(2)
71 Removed: # af.spar.save_info(SAVE_PATH, _)
70 Added: # af.spar.info_print(2)
71 Added: # af.spar.info_save(SAVE_PATH, _)
72 72
73 73 # Create stringer instance
74 74 af.stringer = creator.Stringer()
@@ -76,8 +76,8 @@
76 76 af.stringer.add_coord(af.coord, af.spar.coord, 4, 7, 5, 6)
77 77 af.stringer.add_area(STRINGER_AREA)
78 78 af.stringer.add_mass(STRINGER_MASS)
79 Removed: # af.stringer.print_info(2)
80 Removed: # af.stringer.save_info(SAVE_PATH, _)
79 Added: # af.stringer.info_print(2)
80 Added: # af.stringer.info_save(SAVE_PATH, _)
81 81
82 82 # Plot components with matplotlib
83 83 # af.plot()
@@ -86,8 +86,8 @@
86 86 eval = evaluator.Airfoil(af)
87 87 # The analysis is performed in the evaluator.py module.
88 88 eval.analysis()
89 Removed: eval.print_info(2)
90 Removed: # eval.save_info(SAVE_PATH, _)
89 Added: eval.info_print(2)
90 Added: # eval.info_save(SAVE_PATH, _)
91 91 # eval.plot()
92 92
93 93 # Print final execution time