Aviary icon indicating copy to clipboard operation
Aviary copied to clipboard

Command line verbosity option error for fortran_to_aviary

Open cmbenne3 opened this issue 1 year ago • 0 comments

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.

cmbenne3 avatar May 17 '24 21:05 cmbenne3