Author: bugman Date: Tue Jul 26 21:59:34 2011 New Revision: 13907 URL: http://svn.gna.org/viewcvs/relax?rev=13907&view=rev Log: Merged revisions 13904-13906 via svnmerge from svn+ssh://bugman@xxxxxxxxxxx/svn/relax/1.3 ........ r13904 | bugman | 2011-07-26 21:40:15 +0200 (Tue, 26 Jul 2011) | 5 lines Added the data_type() method to the specific functions API. This will be used to determine the type that a given parameter from data_names() should be. ........ r13905 | bugman | 2011-07-26 21:52:58 +0200 (Tue, 26 Jul 2011) | 3 lines Modified the specific functions API method data_type() so that Python type objects should be returned. ........ r13906 | bugman | 2011-07-26 21:55:53 +0200 (Tue, 26 Jul 2011) | 3 lines Implemented the model-free version of the data_type() API method. ........ Modified: branches/gui_testing/ (props changed) branches/gui_testing/specific_fns/api_base.py branches/gui_testing/specific_fns/model_free/main.py Propchange: branches/gui_testing/ ------------------------------------------------------------------------------ --- svnmerge-integrated (original) +++ svnmerge-integrated Tue Jul 26 21:59:34 2011 @@ -1,1 +1,1 @@ -/1.3:1-13857 +/1.3:1-13906 Modified: branches/gui_testing/specific_fns/api_base.py URL: http://svn.gna.org/viewcvs/relax/branches/gui_testing/specific_fns/api_base.py?rev=13907&r1=13906&r2=13907&view=diff ============================================================================== --- branches/gui_testing/specific_fns/api_base.py (original) +++ branches/gui_testing/specific_fns/api_base.py Tue Jul 26 21:59:34 2011 @@ -143,6 +143,19 @@ @type sim_names: bool @return: The list of object names. @rtype: list of str + """ + + # Not implemented. + raise RelaxImplementError + + + def data_type(self, param=None): + """Return the type of data that the parameter should be. + + @keyword param: The parameter name. + @type param: list of str + @return: The type of the parameter. I.e. the special Python type objects of int, float, str, bool, [str], {bool}, etc. + @rtype: any type """ # Not implemented. Modified: branches/gui_testing/specific_fns/model_free/main.py URL: http://svn.gna.org/viewcvs/relax/branches/gui_testing/specific_fns/model_free/main.py?rev=13907&r1=13906&r2=13907&view=diff ============================================================================== --- branches/gui_testing/specific_fns/model_free/main.py (original) +++ branches/gui_testing/specific_fns/model_free/main.py Tue Jul 26 21:59:34 2011 @@ -1343,6 +1343,50 @@ # Return the names. return names + + + def data_type(self, param=None): + """Return the type of data, as a string, that the parameter should be. + + @keyword param: The parameter name. + @type param: list of str + @return: The type of the parameter, as a string. I.e. 'int', 'float', 'str', 'bool', 'list of str', 'dict of bool', etc. + @rtype: str + """ + + # A dictionary of all the types. + types = { + 'select': bool, + 'fixed': bool, + 'proton_type': str, + 'heteronuc_type': str, + 'attached_proton': str, + 'nucleus': str, + 'model': str, + 'equation': str, + 'params': [str], + 'xh_vect': [float], + 's2': float, + 's2f': float, + 's2s': float, + 'local_tm': float, + 'te': float, + 'tf': float, + 'ts': float, + 'rex': float, + 'r': float, + 'csa': float, + 'chi2': float, + 'iter': int, + 'f_count': int, + 'g_count': int, + 'h_count': int, + 'warning': str + } + + # Return the type, if in the list. + if types.has_key(param): + return types[param] default_value_doc = ["Model-free default values", """