def _load_solarcal_par_str(solarcal_par_str): """Load a SolarCalParameter from a string. Args: solarcal_par_str: A string of a SolarCalParameter to be loaded. """ if solarcal_par_str is not None and solarcal_par_str != '' \ and solarcal_par_str != 'None': return SolarCalParameter.from_string(solarcal_par_str)
def test_solarcal_parameter_to_from_str(): """Test the to/from string methods of the SolarCalParameter object.""" posture = 'seated' sharp = 180 absorptivity = 0.8 emissivity = 0.97 solarcal_par = SolarCalParameter(posture=posture, sharp=sharp, body_absorptivity=absorptivity, body_emissivity=emissivity) new_solarcal_par = SolarCalParameter.from_string(str(solarcal_par)) assert new_solarcal_par.posture == posture assert new_solarcal_par.sharp == sharp assert new_solarcal_par.body_azimuth is None assert new_solarcal_par.body_absorptivity == absorptivity assert new_solarcal_par.body_emissivity == emissivity