Author: bugman Date: Wed Jan 18 16:43:54 2012 New Revision: 15174 URL: http://svn.gna.org/viewcvs/relax?rev=15174&view=rev Log: Created the Param_list.get_units() method for returning the units corresponding to the parameter. Modified: branches/spec_api/specific_fns/api_objects.py Modified: branches/spec_api/specific_fns/api_objects.py URL: http://svn.gna.org/viewcvs/relax/branches/spec_api/specific_fns/api_objects.py?rev=15174&r1=15173&r2=15174&view=diff ============================================================================== --- branches/spec_api/specific_fns/api_objects.py (original) +++ branches/spec_api/specific_fns/api_objects.py Wed Jan 18 16:43:54 2012 @@ -106,3 +106,20 @@ # Return the value. return self.grace_string[name] + + + def get_units(self, name): + """Return the units string for the parameter. + + @param name: The name of the parameter. + @type name: str + @return: The units string. + @rtype: str + """ + + # Check. + if name not in self.names: + raise RelaxError("The parameter '%s' does not exist." % name) + + # Return the value. + return self.units[name]