utils.py#
- aviary.interface.utils.round_it(x, sig=None)[source]
Round a float to a specified significance. If the number is equal to zero, “0” will be returned, regardless of the number of significant digits specified If the number is NaN, directly returns it (stays NaN).
- Parameters:
x (str or float) – the float that needs to be rounded.
sig (int) – the number of significant digits to include (If this is unspecified, the number will be rounded to two decimal places).
- Returns:
The rounded number, or provided string if not convertible to float, or original
number if it is NaN
- 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.