Skip to content

Commit

Permalink
more verbosity fixes for tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jkirk5 committed Dec 26, 2024
1 parent c3e49af commit b21d704
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 15 deletions.
8 changes: 4 additions & 4 deletions aviary/interface/test/test_linkage_logic.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
6 changes: 3 additions & 3 deletions aviary/subsystems/mass/gasp_based/test/test_fixed.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
10 changes: 3 additions & 7 deletions aviary/utils/preprocessors.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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.")
Expand All @@ -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.")
Expand Down

0 comments on commit b21d704

Please sign in to comment.