Esempio n. 1
0
def test_adaptive_parameter_to_from_str():
    """Test the AdaptiveParameter to/from str methods."""
    adaptive_par = AdaptiveParameter(False)
    adaptive_par.set_neutral_offset_from_comfort_class(1)

    new_ad_comf = AdaptiveParameter.from_string(str(adaptive_par))
    assert new_ad_comf.to_dict() == adaptive_par.to_dict()
Esempio n. 2
0
def _load_adaptive_par_str(comfort_par_str):
    """Load a AdaptiveParameter from a string.

    Args:
        comfort_par_str: A string of a AdaptiveParameter to be loaded.
    """
    if comfort_par_str is not None and comfort_par_str != '' \
            and comfort_par_str != 'None':
        return AdaptiveParameter.from_string(comfort_par_str)