OpenAeroStruct icon indicating copy to clipboard operation
OpenAeroStruct copied to clipboard

Make plot_wing callable from the file directly and document this

Open johnjasa opened this issue 6 years ago • 3 comments

Make it easier for users to call plot_wing from the file directly instead of from the command line

johnjasa avatar Mar 06 '19 16:03 johnjasa

I failed in getting this to work, I tried;

added from openaerostruct.utils.plot_wing import Display Display("aero.db") to my OAS_run_script

and got an error on import sqlitedict. This is not in the anaconda repository, but I found it at https://pypi.org/project/sqlitedict/ I installed it by opening a anaconda environment terminal and did a $pip install -U sqlitedict

running the OAS_run_script did produce the aero.db and opened a window, but failed on showing anything, claiming it was not a valid database.

marcovanderbijl avatar Apr 19 '19 15:04 marcovanderbijl

This should work for you:

from openaerostruct.utils.plot_wing import disp_plot

args = [[], []]
args[1] = 'aero.db'
disp_plot(args=args)

Make sure you're trying to view an optimization case, not an analysis case.

Edited: changed code to reflect your suggestion.

johnjasa avatar Apr 19 '19 15:04 johnjasa

yes! success! thanks a bunch! if someone tries to replicate, this is the complete solution: add

from openaerostruct.utils.plot_wing import disp_plot args = [[], []] args[1] = 'aero.db' disp_plot(args=args)

to your optimization case OAS_run_file as I am only today started to try to use OAS I used this to get the https://mdolab.github.io/OpenAeroStruct/aero_walkthrough.html completely working.

marcovanderbijl avatar Apr 19 '19 17:04 marcovanderbijl