Author: bugman Date: Thu Jul 24 08:44:17 2014 New Revision: 24689 URL: http://svn.gna.org/viewcvs/relax?rev=24689&view=rev Log: Modified the behaviour of the parameter object units() method. If the unit is set to the default of None, this method will now return an empty string instead of None. Modified: branches/zooming_grid_search/specific_analyses/parameter_object.py Modified: branches/zooming_grid_search/specific_analyses/parameter_object.py URL: http://svn.gna.org/viewcvs/relax/branches/zooming_grid_search/specific_analyses/parameter_object.py?rev=24689&r1=24688&r2=24689&view=diff ============================================================================== --- branches/zooming_grid_search/specific_analyses/parameter_object.py (original) +++ branches/zooming_grid_search/specific_analyses/parameter_object.py Thu Jul 24 08:44:17 2014 @@ -1174,7 +1174,7 @@ @param name: The name of the parameter. @type name: str - @return: The units string. + @return: The units string. If no unit is present, the empty string will be returned. @rtype: str """ @@ -1183,7 +1183,14 @@ # Function. if isinstance(self._units[name], FunctionType) or isinstance(self._units[name], MethodType): - return self._units[name]() - - # Return the value. - return self._units[name] + unit = self._units[name]() + + # The value. + unit = self._units[name] + + # Convert None to an empty string. + if unit == None: + unit = '' + + # Return the units. + return unit