OpenMDAO / Aviary

NASA's aircraft analysis, design, and optimization tool
https://openmdao.github.io/Aviary/
Other
134 stars 59 forks source link

Command line verbosity option error for fortran_to_aviary #284

Closed cmbenne3 closed 4 months ago

cmbenne3 commented 4 months ago

Description

Unable to select different verbosity options using the aviary command line interface when running the fortran_to_aviary function. The documentation (and help command) suggests that you can parse an optional integer to change the verbosity -v {0,1,2,3}, but when attempting to do this it results in an error.

Example

aviary fortran_to_aviary -o aviary_input.csv -l FLOPS -v 3 --force "Flops_Input_example"

returns following error:

usage: aviary fortran_to_aviary [-h] [-o OUT_FILE] -l {FLOPS,GASP} [-d DEFAULTS_DECK] [--force] [-v {0,1,2,3}] input_deck aviary fortran_to_aviary: error: argument -v/--verbosity: invalid Verbosity value: '3'

Aviary Version

0.9.4-dev

Relevant environment information

Either the documentation or acceptable options list needs updating with the correct way to input verbosity, or the function _setup_F2A_parser() needs modification:

Suggested modification change:

parser.add_argument( "-v", "--verbosity", type=Verbosity, choices=list(Verbosity), default=1, help="Set level of print statements", )

to:

parser.add_argument( "-v", "--verbosity", type=int, choices={0,1,2,3}, default=1, help="Set level of print statements", )

On testing this seems to work, but there is probably a better way to do this.