Source code for fairyfly_therm.lib.conditions
"""Establish the default conditions within the fairyfly_therm library."""
from ._loadconditions import _conditions
# establish variables for the default materials used across the library
exterior = _conditions['Generic Exterior']
interior = _conditions['Generic Interior']
adiabatic = _conditions['Adiabatic']
# make lists of condition names to look up items in the library
CONDITIONS = tuple(_conditions.keys())
[docs]
def condition_by_name(condition_name):
"""Get a solid condition from the library given the condition name.
Args:
condition_name: A text string for the display_name of the condition.
"""
try: # first check the default data
return _conditions[condition_name]
except KeyError:
raise ValueError(
'"{}" was not found in the solid condition library.'.format(condition_name))