Author: bugman Date: Sun Jun 22 23:07:16 2008 New Revision: 6449 URL: http://svn.gna.org/viewcvs/relax?rev=6449&view=rev Log: Shifted the spin specific object name and descriptions into the specific code. Modified: 1.3/data/mol_res_spin.py 1.3/generic_fns/relax_data.py 1.3/specific_fns/model_free/main.py Modified: 1.3/data/mol_res_spin.py URL: http://svn.gna.org/viewcvs/relax/1.3/data/mol_res_spin.py?rev=6449&r1=6448&r2=6449&view=diff ============================================================================== --- 1.3/data/mol_res_spin.py (original) +++ 1.3/data/mol_res_spin.py Sun Jun 22 23:07:16 2008 @@ -28,10 +28,11 @@ from re import match # relax module imports. +import data from prototype import Prototype from relax_errors import RelaxError from relax_xml import fill_object_contents - +import specific_fns # The spin system data. @@ -191,44 +192,21 @@ @type element: XML element object """ - # The SpinContainer objects ordered and with description for the XML output. - object_info = [ - ['select', 'The spin selection flag'], - ['fixed', 'The fixed flag'], - ['proton_type', 'The proton spin type'], - ['heteronuc_type', 'The heteronucleus spin type'], - ['attached_proton', None], - ['nucleus', None], - ['model', 'The model'], - ['equation', 'The model equation'], - ['params', 'The model parameters'], - ['s2', 'S2, the model-free generalised order parameter (S2 = S2f.S2s)'], - ['s2f', 'S2f, the faster motion model-free generalised order parameter'], - ['s2s', 'S2s, the slower motion model-free generalised order parameter'], - ['local_tm', 'The spin specific global correlation time (ns)'], - ['te', 'Single motion effective internal correlation time (ps)'], - ['tf', 'Faster motion effective internal correlation time (ps)'], - ['ts', 'Slower motion effective internal correlation time (ps)'], - ['rex', 'Chemical exchange relaxation'], - ['r', 'Bond length'], - ['csa', 'Chemical shift anisotropy'], - ['chi2', 'Chi-squared value'], - ['iter', 'Optimisation iterations'], - ['f_count', 'Number of function calls'], - ['g_count', 'Number of gradient calls'], - ['h_count', 'Number of Hessian calls'], - ['warning', 'Optimisation warning'], - ['xh_vect', 'XH bond vector'], - ['num_frq', 'Number of spectrometer frequencies'], - ['frq', 'Frequencies'], - ['frq_labels', 'Frequency labels'], - ['num_ri', 'Number of relaxation data sets'], - ['ri_labels', 'Relaxation data set labels'], - ['remap_table', 'Table mapping frequencies to relaxation data'], - ['noe_r1_table', 'Table mapping the NOE to the corresponding R1'], - ['relax_data', 'The relaxation data'], - ['relax_error', 'The relaxation data errors'] - ] + # The relax data store. + ds = data.Relax_data_store() + + # Get the specific functions. + data_names = specific_fns.setup.get_specific_fn('data_names', ds[ds.current_pipe].pipe_type, raise_error=False) + return_data_desc = specific_fns.setup.get_specific_fn('return_data_desc', ds[ds.current_pipe].pipe_type, raise_error=False) + + # Get the object names and loop over them to get their descriptions. + object_info = [] + for name in data_names(): + # Get the description. + desc = return_data_desc(name) + + # Append the two. + object_info.append([name, desc]) # Loop over the spins. for i in xrange(len(self)): Modified: 1.3/generic_fns/relax_data.py URL: http://svn.gna.org/viewcvs/relax/1.3/generic_fns/relax_data.py?rev=6449&r1=6448&r2=6449&view=diff ============================================================================== --- 1.3/generic_fns/relax_data.py (original) +++ 1.3/generic_fns/relax_data.py Sun Jun 22 23:07:16 2008 @@ -631,6 +631,33 @@ update_data_structures_spin(spin, ri_label, frq_label, frq, value, error) +def return_data_desc(name): + """Return a description of the spin specific object. + + @param name: The name of the spin specific object. + @type name: str + """ + + if name == 'num_frq': + return 'Number of spectrometer frequencies' + if name == 'frq': + return 'Frequencies' + if name == 'frq_labels': + return 'Frequency labels' + if name == 'num_ri': + return 'Number of relaxation data sets' + if name == 'ri_labels': + return 'Relaxation data set labels' + if name == 'remap_table': + return 'Table mapping frequencies to relaxation data' + if name == 'noe_r1_table': + return 'Table mapping the NOE to the corresponding R1' + if name == 'relax_data': + return 'The relaxation data' + if name == 'relax_error': + return 'The relaxation data errors' + + def return_value(i, data_type): """Function for returning the value and error corresponding to 'data_type'.""" Modified: 1.3/specific_fns/model_free/main.py URL: http://svn.gna.org/viewcvs/relax/1.3/specific_fns/model_free/main.py?rev=6449&r1=6448&r2=6449&view=diff ============================================================================== --- 1.3/specific_fns/model_free/main.py (original) +++ 1.3/specific_fns/model_free/main.py Sun Jun 22 23:07:16 2008 @@ -1840,6 +1840,71 @@ return 1.0 + def return_data_desc(self, name): + """Return a description of the spin specific object. + + @param name: The name of the spin specific object. + @type name: str + """ + + # Model-free specific objects. + if name == 'select': + return 'The spin selection flag' + if name == 'fixed': + return 'The fixed flag' + if name == 'proton_type': + return 'The proton spin type' + if name == 'heteronuc_type': + return 'The heteronucleus spin type' + if name == 'attached_proton': + return None + if name == 'nucleus': + return None + if name == 'model': + return 'The model' + if name == 'equation': + return 'The model equation' + if name == 'params': + return 'The model parameters' + if name == 's2': + return 'S2, the model-free generalised order parameter (S2 = S2f.S2s)' + if name == 's2f': + return 'S2f, the faster motion model-free generalised order parameter' + if name == 's2s': + return 'S2s, the slower motion model-free generalised order parameter' + if name == 'local_tm': + return 'The spin specific global correlation time (ns)' + if name == 'te': + return 'Single motion effective internal correlation time (ps)' + if name == 'tf': + return 'Faster motion effective internal correlation time (ps)' + if name == 'ts': + return 'Slower motion effective internal correlation time (ps)' + if name == 'rex': + return 'Chemical exchange relaxation' + if name == 'r': + return 'Bond length' + if name == 'csa': + return 'Chemical shift anisotropy' + if name == 'chi2': + return 'Chi-squared value' + if name == 'iter': + return 'Optimisation iterations' + if name == 'f_count': + return 'Number of function calls' + if name == 'g_count': + return 'Number of gradient calls' + if name == 'h_count': + return 'Number of Hessian calls' + if name == 'warning': + return 'Optimisation warning' + if name == 'xh_vect': + return 'XH bond vector' + + # Ok, try the relaxation data specific objects. + return relax_data.return_data_desc(name) + + def return_data_name(self, name): """ Model-free data type string matching patterns