-
Notifications
You must be signed in to change notification settings - Fork 70
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
Mission Report #126
Mission Report #126
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.
Looks slick! Thank you. I added some minor questions.
aviary/interface/reports.py
Outdated
vals = prob.get_val(f"{traj}.{phase}.timeseries.{var_name}", | ||
units=units, | ||
indices=indices,) | ||
|
||
except KeyError: | ||
try: | ||
vals = prob.get_val(f"{traj}.{phase}.states:{var_name}", | ||
units=units, | ||
indices=indices,) | ||
except KeyError: | ||
try: | ||
vals = prob.get_val(f"{traj}.{phase}.timeseries.states:{var_name}", | ||
units=units, | ||
indices=indices,) | ||
except KeyError: | ||
try: | ||
vals = prob.get_val(f"{traj}.{phase}.{var_name}", | ||
units=units, | ||
indices=indices,) | ||
# 2DOF breguet range cruise uses time integration to track mass | ||
except TypeError: | ||
vals = prob.get_val(f"{traj}.{phase}.timeseries.time", | ||
units=units, | ||
indices=indices,) | ||
except KeyError: | ||
vals = None |
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.
Do all of these try/except blocks strictly need to be here? I'm thinking that most of the values we care about from the mission should be added to the timeseries (so they'd be accessible in the first try block).
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.
Good point. I did some experimenting and some of these aren't required. I've removed the unneeded try/except blocks
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.
One suggestion that may or may not be possible and a couple of minor comments
aviary/interface/reports.py
Outdated
try: | ||
vals = prob.get_val(f"{traj}.{phase}.timeseries.{var_name}", | ||
units=units, | ||
indices=indices,) | ||
|
||
except KeyError: | ||
try: | ||
vals = prob.get_val(f"{traj}.{phase}.states:{var_name}", | ||
units=units, | ||
indices=indices,) | ||
except KeyError: | ||
try: | ||
vals = prob.get_val(f"{traj}.{phase}.timeseries.states:{var_name}", | ||
units=units, | ||
indices=indices,) | ||
except KeyError: | ||
try: | ||
vals = prob.get_val(f"{traj}.{phase}.{var_name}", | ||
units=units, | ||
indices=indices,) | ||
# 2DOF breguet range cruise uses time integration to track mass | ||
except TypeError: | ||
vals = prob.get_val(f"{traj}.{phase}.timeseries.time", | ||
units=units, | ||
indices=indices,) | ||
except KeyError: | ||
vals = None |
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.
could this be changed to something like:
key_paths = [f"timeseries.{var_name}", f"states:{var_name}", f"timeseries.states:{var_name}", f"{var_name}", "timeseries.time"]
vals = None
for key_path in key_paths:
try:
vals = prob.get_val(f"{traj}.{phase}.{key_path}", units=units, indices=indices,)
return vals
except KeyError:
pass
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.
That will work for everything except catching the TypeError that only shows up for the timeseries.time check. I'll play around a little with this idea
fixed reports generating before optimization
updated docs to ignore new reports
Summary
Addition of mission summary report as well as minor reworks to subsystem reports
Related Issues
None
Backwards incompatibilities
None
New Dependencies
None