Author: bugman Date: Fri Apr 11 09:51:09 2014 New Revision: 22710 URL: http://svn.gna.org/viewcvs/relax?rev=22710&view=rev Log: Shifted the minimisation Grace strings and units into the parameter list object. The return_grace_string() and return_units() functions of the pipe_control.minimise module have been deleted and their contents shifted into the specific analysis parameter list object. Modified: trunk/lib/software/grace.py trunk/pipe_control/grace.py trunk/pipe_control/minimise.py trunk/specific_analyses/parameter_object.py Modified: trunk/lib/software/grace.py URL: http://svn.gna.org/viewcvs/relax/trunk/lib/software/grace.py?rev=22710&r1=22709&r2=22710&view=diff ============================================================================== --- trunk/lib/software/grace.py (original) +++ trunk/lib/software/grace.py Fri Apr 11 09:51:09 2014 @@ -366,15 +366,6 @@ # The specific analysis API object. api = return_api() - # Specific value and error, conversion factor, and units returning functions. - return_units = api.return_units - return_grace_string = api.return_grace_string - - # Test if the axis data type is a minimisation statistic. - if data_type[i] and data_type[i] != 'spin' and pipe_control.minimise.return_data_name(data_type[i]): - return_units = pipe_control.minimise.return_units - return_grace_string = pipe_control.minimise.return_grace_string - # Some axis default values for spin data. if data_type[i] == 'spin': # Residue only data. @@ -407,10 +398,10 @@ data_type_i = data_type_i[:-3] # Get the units. - units = return_units(data_type_i) + units = api.return_units(data_type_i) # Set the label. - axis_labels[gi][i] = return_grace_string(data_type_i) + axis_labels[gi][i] = api.return_grace_string(data_type_i) # Add units. if units: Modified: trunk/pipe_control/grace.py URL: http://svn.gna.org/viewcvs/relax/trunk/pipe_control/grace.py?rev=22710&r1=22709&r2=22710&view=diff ============================================================================== --- trunk/pipe_control/grace.py (original) +++ trunk/pipe_control/grace.py Fri Apr 11 09:51:09 2014 @@ -68,11 +68,6 @@ # The specific analysis API object. api = return_api() - - # Test if the axis data type is a minimisation statistic. - if data_type[i] and data_type[i] != 'res_num' and pipe_control.minimise.return_data_name(data_type[i]): - return_units = pipe_control.minimise.return_units - return_grace_string = pipe_control.minimise.return_grace_string # Some axis default values for spin data. if data_type[i] == 'res_num': Modified: trunk/pipe_control/minimise.py URL: http://svn.gna.org/viewcvs/relax/trunk/pipe_control/minimise.py?rev=22710&r1=22709&r2=22710&view=diff ============================================================================== --- trunk/pipe_control/minimise.py (original) +++ trunk/pipe_control/minimise.py Fri Apr 11 09:51:09 2014 @@ -372,54 +372,6 @@ return 'h_count' -def return_grace_string(stat_type): - """Function for returning the Grace string representing the data type for axis labelling. - - @param stat_type: The name of the statistic to return the Grace string for. - @type stat_type: str - @return: The Grace string. - @rtype: str - """ - - # Get the object name. - object_name = return_data_name(stat_type) - - # Chi-squared. - if object_name == 'chi2': - grace_string = '\\xc\\S2' - - # Iteration count. - elif object_name == 'iter': - grace_string = 'Iteration count' - - # Function call count. - elif object_name == 'f_count': - grace_string = 'Function call count' - - # Gradient call count. - elif object_name == 'g_count': - grace_string = 'Gradient call count' - - # Hessian call count. - elif object_name == 'h_count': - grace_string = 'Hessian call count' - - # Return the Grace string. - return grace_string - - -def return_units(stat_type): - """Dummy function which returns None as the stats have no units. - - @param stat_type: The name of the statistic. This is unused! - @type stat_type: str - @return: Nothing. - @rtype: None - """ - - return None - - def return_value(spin=None, stat_type=None, sim=None): """Function for returning the minimisation statistic corresponding to 'stat_type'. Modified: trunk/specific_analyses/parameter_object.py URL: http://svn.gna.org/viewcvs/relax/trunk/specific_analyses/parameter_object.py?rev=22710&r1=22709&r2=22710&view=diff ============================================================================== --- trunk/specific_analyses/parameter_object.py (original) +++ trunk/specific_analyses/parameter_object.py Fri Apr 11 09:51:09 2014 @@ -193,11 +193,11 @@ scope = 'spin' # The minimisation parameters. - self._add('chi2', scope=scope, desc='Chi-squared value', py_type=float, set='min', err=False, sim=True) - self._add('iter', scope=scope, desc='Optimisation iterations', py_type=int, set='min', err=False, sim=True) - self._add('f_count', scope=scope, desc='Number of function calls', py_type=int, set='min', err=False, sim=True) - self._add('g_count', scope=scope, desc='Number of gradient calls', py_type=int, set='min', err=False, sim=True) - self._add('h_count', scope=scope, desc='Number of Hessian calls', py_type=int, set='min', err=False, sim=True) + self._add('chi2', scope=scope, desc='Chi-squared value', py_type=float, set='min', grace_string='\\xc\\S2', err=False, sim=True) + self._add('iter', scope=scope, desc='Optimisation iterations', py_type=int, set='min', grace_string='Iteration count', err=False, sim=True) + self._add('f_count', scope=scope, desc='Number of function calls', py_type=int, set='min', grace_string='Function call count', err=False, sim=True) + self._add('g_count', scope=scope, desc='Number of gradient calls', py_type=int, set='min', grace_string='Gradient call count', err=False, sim=True) + self._add('h_count', scope=scope, desc='Number of Hessian calls', py_type=int, set='min', grace_string='Hessian call count', err=False, sim=True) self._add('warning', scope=scope, desc='Optimisation warning', py_type=str, set='min', err=False, sim=True)