def _load_pmv_par_str(comfort_par_str): """Load a PMVParameter from a string. Args: comfort_par_str: A string of a PMVParameter to be loaded. """ if comfort_par_str is not None and comfort_par_str != '' \ and comfort_par_str != 'None': return PMVParameter.from_string(comfort_par_str)
def test_pmv_parameter_to_from_str(): """Test PMVParameter.""" ppd_comfort_thresh = 20 humid_ratio_up = 0.012 humid_ratio_low = 0.004 still_air_thresh = 0.2 pmv_comf = PMVParameter( ppd_comfort_thresh, humid_ratio_up, humid_ratio_low, still_air_thresh) new_pmv_comf = PMVParameter.from_string(str(pmv_comf)) assert new_pmv_comf.ppd_comfort_thresh == ppd_comfort_thresh assert new_pmv_comf.humid_ratio_upper == humid_ratio_up assert new_pmv_comf.humid_ratio_lower == humid_ratio_low assert new_pmv_comf.still_air_threshold == still_air_thresh