From b21d704dfed65dc198daa7b1485e1aafc0f08681 Mon Sep 17 00:00:00 2001 From: jkirk5 Date: Thu, 26 Dec 2024 15:53:57 -0500 Subject: [PATCH] more verbosity fixes for tests --- aviary/interface/test/test_linkage_logic.py | 8 ++++---- .../flops_based/test/test_tabular_aero_group.py | 2 +- aviary/subsystems/mass/gasp_based/test/test_fixed.py | 6 +++--- aviary/utils/preprocessors.py | 10 +++------- 4 files changed, 11 insertions(+), 15 deletions(-) diff --git a/aviary/interface/test/test_linkage_logic.py b/aviary/interface/test/test_linkage_logic.py index 1c414d34b..fd45b4d2d 100644 --- a/aviary/interface/test/test_linkage_logic.py +++ b/aviary/interface/test/test_linkage_logic.py @@ -181,7 +181,7 @@ def get_linkage_string(phase_1, var, phase_2): if __name__ == '__main__': - # unittest.main() - test = AircraftMissionTestSuite() - test.setUp() - test.test_linkages() + unittest.main() + # test = AircraftMissionTestSuite() + # test.setUp() + # test.test_linkages() diff --git a/aviary/subsystems/aerodynamics/flops_based/test/test_tabular_aero_group.py b/aviary/subsystems/aerodynamics/flops_based/test/test_tabular_aero_group.py index 456b23524..2bc808c6d 100644 --- a/aviary/subsystems/aerodynamics/flops_based/test/test_tabular_aero_group.py +++ b/aviary/subsystems/aerodynamics/flops_based/test/test_tabular_aero_group.py @@ -95,7 +95,7 @@ def test_parameters(self): local_phase_info.pop('climb') local_phase_info.pop('descent') - prob = AviaryProblem() + prob = AviaryProblem(verbosity=0) prob.load_inputs( "subsystems/aerodynamics/flops_based/test/data/high_wing_single_aisle.csv", diff --git a/aviary/subsystems/mass/gasp_based/test/test_fixed.py b/aviary/subsystems/mass/gasp_based/test/test_fixed.py index 3e95d849c..57e0f8afb 100644 --- a/aviary/subsystems/mass/gasp_based/test/test_fixed.py +++ b/aviary/subsystems/mass/gasp_based/test/test_fixed.py @@ -1683,7 +1683,7 @@ def test_case1(self): if __name__ == "__main__": - # unittest.main() + unittest.main() # test = GearTestCaseMultiengine() - test = EngineTestCaseMultiEngine() - test.test_case_1() + # test = EngineTestCaseMultiEngine() + # test.test_case_1() diff --git a/aviary/utils/preprocessors.py b/aviary/utils/preprocessors.py index 05d6c1245..0b5afe3f2 100644 --- a/aviary/utils/preprocessors.py +++ b/aviary/utils/preprocessors.py @@ -35,10 +35,6 @@ def preprocess_options(aviary_options: AviaryValues, **kwargs): verbosity = _MetaData[Settings.VERBOSITY]['default_value'] aviary_options.set_val(Settings.VERBOSITY, verbosity) - if Settings.VERBOSITY not in aviary_options: - verbosity = _MetaData[Settings.VERBOSITY]['default_value'] - aviary_options.set_val(Settings.VERBOSITY, verbosity) - preprocess_crewpayload(aviary_options, verbosity) preprocess_propulsion(aviary_options, engine_models, verbosity) @@ -136,11 +132,11 @@ def preprocess_crewpayload(aviary_options: AviaryValues, verbosity=None): aviary_options.get_val(Aircraft.CrewPayload.NUM_TOURIST_CLASS)) # user has not supplied detailed information on design but has supplied summary information on passengers elif num_pax != 0 and design_num_pax == 0: - if verbosity >= 2: + if verbosity >= Verbosity.VERBOSE: print("User has specified as-flown NUM_PASSENGERS but not how many passengers the aircraft was designed for in Design.NUM_PASSENGERS. Assuming they are equal.") aviary_options.set_val(Aircraft.CrewPayload.Design.NUM_PASSENGERS, num_pax) elif design_passenger_count != 0 and num_pax == 0 and passenger_count == 0: - if verbosity >= 1: + if verbosity >= Verbosity.BRIEF: print("User has specified Design.NUM_* passenger values but CrewPyaload.NUM_* has been left blank or set to zero.") print( "Assuming they are equal to maintain backwards compatibility with GASP and FLOPS output files.") @@ -155,7 +151,7 @@ def preprocess_crewpayload(aviary_options: AviaryValues, verbosity=None): aviary_options.get_val(Aircraft.CrewPayload.Design.NUM_TOURIST_CLASS)) # user has not supplied detailed information on design but has supplied summary information on passengers elif design_num_pax != 0 and num_pax == 0: - if verbosity >= 1: + if verbosity >= Verbosity.BRIEF: print("User has specified Design.NUM_PASSENGERS but CrewPayload.NUM_PASSENGERS has been left blank or set to zero.") print( "Assuming they are equal to maintain backwards compatibility with GASP and FLOPS output files.")