OpenMDAO / Aviary

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

Command line verbosity option #300

Closed xjjiang closed 1 month ago

xjjiang commented 1 month ago

Summary

This is to fix issue #284. It is reported that the following command results in error:

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

This PR tries to fix this error.

Related Issues

Backwards incompatibilities

None

New Dependencies

None

xjjiang commented 1 month ago

@cmbenne3 Is this good enough?

cmbenne3 commented 1 month ago

@xjjiang - if I'm honest, I don't fully understand the python syntax of the change that you've made, but if it solves the issue then great!

xjjiang commented 1 month ago

@cmbenne3 , we don't want to hard code {0, 1, 2, 3}. Instead, we want to get them from Verbosity class. That was my motivation for the change. Let's see how others respond.

cmbenne3 commented 1 month ago

yes - I agree that we don't want to hardcode the verbosity options in case we change the class - good thinking!

jkirk5 commented 1 month ago

I tinkered around a little and couldn't find a quick solution other than the lambda function you made, which is hard to parse but I think I get the gist of what it does

crecine commented 1 month ago

I tinkered around a little and couldn't find a quick solution other than the lambda function you made, which is hard to parse but I think I get the gist of what it does

would you prefer: return [c.value for c in cls]

xjjiang commented 1 month ago

Done as suggested by Carl.