utils.py

utils.py#

aviary.interface.utils.find_variable_in_problem(var_name, problem, metadata)[source]

Find the value and units of a variable in an AviaryProblem. Priority is to directly find the value via problem.get_val(), followed by searching in problem.aviary_inputs.

Parameters:
  • var_name (str) – The name of the variable to find.

  • problem (AviaryProblem) – The AviaryProblem to search for var_name in.

  • metadata (dict) – The dictionary that contains the metadata of the data with desired units. Used to get default units if unit information cannot be found.

aviary.interface.utils.set_warning_format(verbosity)[source]
aviary.interface.utils.write_markdown_variable_table(open_file, problem, outputs, metadata)[source]

Writes a table of the provided variable names in outputs. Converts units to defaults from metadata if available.

Parameters:
  • open_file (Path) – The output file to be written to. This file should have been opened for writing.

  • problem (dict) – The dictionary that contains the data.

  • outputs (list) – The list of keywords that will go to outputs file.

  • metadata (dict) – The dictionary that contains the metadata of the data with desired units.