Skip to content
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

Incorrect values when saving and loading json files for off-design #606

Open
kaushikponnapalli opened this issue Nov 15, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@kaushikponnapalli
Copy link
Contributor

Description

Currently we save the results of a sizing run to a json file using aviary_inputs for the names and values of the data. This is a problem since these values are stored as an option at the time the problem is instantiated and do not get updated after the optimization is finished.
Additionally, there are many unnecessary values being dumped into the json file that are not relevant to the problem at hand (eg: blended wing variables for a non-blended wing aircraft)

Example

In save_sizing_to_json() in methods_for_level2.py, the lines
for data in self.aviary_inputs:
(name, (value, units)) = data
type_value = type(value)

are the source of the issue, changing them to
for data in self.aviary_inputs:
(name, (_, units)) = data
try:
value = self.get_val(name, units=units)
except KeyError:
(_, (value, _)) = data

Appears to solve the issue but is a hacky-fix that doesn't address the issue of bloat

Aviary Version

0.9.4-dev

Relevant environment information

No response

@kaushikponnapalli kaushikponnapalli added the bug Something isn't working label Nov 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant