-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Edited plotting file to cater for all the optimizers. Added a main fu… #158
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for opening this PR! Looking good, I was initially confused by the choice of a large try...except
block but I see you are gracefully exiting at the end, makes sense.
I will shortly push a commit to fix the black and flake8 errors. @hajdik it looks like an ESP test is failing, can you check what is going on?
- Removed try..except block for simple os.path.isfile check - Removed rcParams and parser lines from inside of main - Changed args.opt to hist.getMetadata()['optimizer'] - Removed code duplication of plotting
I'm pretty sure the failure is just because we're running SNOPT tests and this is a PR submitted by an external contributor without access to that optimizer (hence this PR...ironically). May want to add skiptest or something similar to what we do with pyOptSparse tests. |
You were right, the ESP test was missing the |
|
||
if __name__ == "__main__": | ||
# plt.rcParams["text.usetex"] = True # Comment out if latex installation is not present | ||
plt.rcParams["font.family"] = "serif" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I generally prefer having all plt
commands before any function definition, at the module level. Not blocking this PR though, since this is probably personal preference.
Purpose
Update the plotting file for optimization history to cater for all the optimizers in the current version
Description
Expected time until merged
The PR is not urgent as, but a week should be enough for review and merging.
Type of change
What types of change is it?
Select the appropriate type(s) that describe this PR
Testing
run the code:
python plot_optHist.py --histFile output/opt.hst --outputDir output/ --opt "SNOPT"
try changing the --opt argument to either "SLSQP" or "IPOPT"
Checklist
flake8
andblack
to make sure the Python code adheres to PEP-8 and is consistently formattedfprettify
or C/C++ code withclang-format
as applicable