Skip to content

Commit

Permalink
use get_val for getting values from case recorder for all places in t…
Browse files Browse the repository at this point in the history
…he dashboard code. Also never read variables that have _OVERRIDE in the name
  • Loading branch information
hschilling committed Sep 11, 2024
1 parent ed93aed commit 5d7c67b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions aviary/visualization/aircraft_3d_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,14 +298,15 @@ def get_variable_from_case(self, var_prom_name, units=None):
Value of the variable.
"""
try:
val = self._final_case[var_prom_name]
val = self._final_case.get_val(var_prom_name, units=units)
return float(val)
except KeyError as e:
pass

abs2prom = self._problem_metadata["abs2prom"]
for abs_name, prom_name in abs2prom["input"].items():
if prom_name == var_prom_name:
# the phrase "_OVERRIDE" in a variable indicates it is a calculated value that we are discarding
if prom_name == var_prom_name and '_OVERRIDE' not in abs_name:
val = self._final_case.get_val(abs_name, units=units)
return float(val)

Expand Down

0 comments on commit 5d7c67b

Please sign in to comment.