From 6946f206a17c5155fc4e517d72c5674fb8cd759b Mon Sep 17 00:00:00 2001 From: Marius Peter Date: Fri, 21 Jun 2019 19:40:57 -0700 Subject: better print_info() file titles --- creator.py | 9 ++++++--- evaluator.py | 9 ++++++--- main.py | 12 +++++------- 3 files changed, 17 insertions(+), 13 deletions(-) diff --git a/creator.py b/creator.py index 1a4ddb7..fd09e2c 100644 --- a/creator.py +++ b/creator.py @@ -75,13 +75,16 @@ class Coordinates: This function's output is piped to the 'save_coord' function below. ''' - print(20 * '-') - print(' CREATOR DATA ') + name = ' CREATOR DATA ' + num_of_dashes = len(name) + + print(num_of_dashes * '-') + print(name) print('Component:', str(self)) print('Chord length:', self.chord) print('Semi-span:', self.semi_span) print('Mass:', self.mass) - print(20 * '-') + print(num_of_dashes * '-') print('x_u the upper x-coordinates:\n', np.around(self.x_u, round)) print('z_u the upper z-coordinates:\n', np.around(self.z_u, round)) print('x_l the lower x-coordinates:\n', np.around(self.x_l, round)) diff --git a/evaluator.py b/evaluator.py index 01647a6..c21ca2e 100644 --- a/evaluator.py +++ b/evaluator.py @@ -60,14 +60,17 @@ class Airfoil: This function's output is piped to the 'save_data' function below. ''' - print(22 * '-') - print(' EVALUATOR DATA ') + name = ' CREATOR DATA ' + num_of_dashes = len(name) + + print(num_of_dashes * '-') + print(name) print('Evaluating:', self.airfoil) print('Chord length:', self.chord) print('Semi-span:', self.semi_span) print('Total airfoil mass:', self.mass_total) print('Centroid location:', np.around(self.centroid, round + 1)) - print(22 * '-') + print(num_of_dashes * '-') print('Rectangular lift:\n', np.around(self.lift_rectangular, round)) print('Elliptical lift:\n', np.around(self.lift_elliptical, round)) print('Combined lift:\n', np.around(self.lift, round)) diff --git a/main.py b/main.py index 2cf4a2e..8805f11 100644 --- a/main.py +++ b/main.py @@ -59,6 +59,7 @@ def main(): af.add_naca(NACA_NUM) af.add_mass(AIRFOIL_MASS) # af.print_info(2) + # af.save_info(SAVE_PATH, _) # Create spar instance af.spar = creator.Spar() @@ -67,6 +68,7 @@ def main(): af.spar.add_coord(af.coord, 0.55) af.spar.add_mass(SPAR_MASS) # af.spar.print_info(2) + # af.spar.save_info(SAVE_PATH, _) # Create stringer instance af.stringer = creator.Stringer() @@ -75,22 +77,18 @@ def main(): af.stringer.add_area(STRINGER_AREA) af.stringer.add_mass(STRINGER_MASS) # af.stringer.print_info(2) + # af.stringer.save_info(SAVE_PATH, _) # Plot components with matplotlib # af.plot() - # Save component info - # af.save_info(SAVE_PATH, _) - # af.spar.save_info(SAVE_PATH, _) - # af.stringer.save_info(SAVE_PATH, _) - # evaluator.Evaluator instance contains airfoil analysis results. eval = evaluator.Airfoil(af) # The analysis is performed in the evaluator.py module. eval.analysis() eval.print_info(2) - eval.save_info(SAVE_PATH, _) - eval.plot() + # eval.save_info(SAVE_PATH, _) + # eval.plot() # Print final execution time print("--- %s seconds ---" % (time.time() - start_time)) -- cgit v1.2.3