Author: bugman Date: Thu Jan 19 09:48:54 2012 New Revision: 15186 URL: http://svn.gna.org/viewcvs/relax?rev=15186&view=rev Log: Converted the NOE specific analysis to use the new SPIN_PARAM list API structure. Modified: branches/spec_api/sample_scripts/noe.py branches/spec_api/specific_fns/noe/__init__.py branches/spec_api/specific_fns/noe/main.py branches/spec_api/test_suite/system_tests/scripts/noe.py Modified: branches/spec_api/sample_scripts/noe.py URL: http://svn.gna.org/viewcvs/relax/branches/spec_api/sample_scripts/noe.py?rev=15186&r1=15185&r2=15186&view=diff ============================================================================== --- branches/spec_api/sample_scripts/noe.py (original) +++ branches/spec_api/sample_scripts/noe.py Thu Jan 19 09:48:54 2012 @@ -1,6 +1,6 @@ ############################################################################### # # -# Copyright (C) 2004-2008 Edward d'Auvergne # +# Copyright (C) 2004-2012 Edward d'Auvergne # # # # This file is part of the program relax. # # # @@ -59,8 +59,8 @@ value.write(param='noe', file='noe.out', force=True) # Create grace files. -grace.write(y_data_type='ref_ave', file='ref.agr', force=True) -grace.write(y_data_type='sat_ave', file='sat.agr', force=True) +grace.write(y_data_type='ref', file='ref.agr', force=True) +grace.write(y_data_type='sat', file='sat.agr', force=True) grace.write(y_data_type='noe', file='noe.agr', force=True) # View the grace files. Modified: branches/spec_api/specific_fns/noe/__init__.py URL: http://svn.gna.org/viewcvs/relax/branches/spec_api/specific_fns/noe/__init__.py?rev=15186&r1=15185&r2=15186&view=diff ============================================================================== --- branches/spec_api/specific_fns/noe/__init__.py (original) +++ branches/spec_api/specific_fns/noe/__init__.py Thu Jan 19 09:48:54 2012 @@ -42,4 +42,12 @@ # Place methods into the API. self.return_conversion_factor = self._return_no_conversion_factor + self.return_data_desc = self._return_data_desc_spin + self.return_data_name = self._return_data_name_spin + self.return_grace_string = self._return_grace_string_spin self.return_value = self._return_value_general + + # Set up the spin parameters. + self.SPIN_PARAMS.add('ref', desc='The reference peak intensity', grace_string='Reference intensity') + self.SPIN_PARAMS.add('sat', desc='The saturated peak intensity', grace_string='Saturated intensity') + self.SPIN_PARAMS.add('noe', desc='The NOE', grace_string='\\qNOE\\Q') Modified: branches/spec_api/specific_fns/noe/main.py URL: http://svn.gna.org/viewcvs/relax/branches/spec_api/specific_fns/noe/main.py?rev=15186&r1=15185&r2=15186&view=diff ============================================================================== --- branches/spec_api/specific_fns/noe/main.py (original) +++ branches/spec_api/specific_fns/noe/main.py Thu Jan 19 09:48:54 2012 @@ -30,6 +30,7 @@ from generic_fns.mol_res_spin import exists_mol_res_spin_data, spin_loop from relax_errors import RelaxArgNotInListError, RelaxError, RelaxNoSequenceError from relax_warnings import RelaxDeselectWarning +from specific_fns.api_common import API_common class Noe_main: @@ -231,95 +232,20 @@ spin.select = False - def return_data_desc(self, name, spin=None): - """Return a description of the spin specific object. - - @param name: The name of the spin specific object. - @type name: str - @param spin: The spin container. - @type spin: SpinContainer instance - @return: The object description, or None. - @rtype: str or None - """ - - # Model-free specific objects. - if name == 'select': - return 'The spin selection flag' - if name == 'fixed': - return 'The fixed flag' - if name == 'ref': - return 'The reference peak intensity' - if name == 'sat': - return 'The saturated peak intensity' - if name == 'noe': - return 'The NOE' - - return_data_name_doc = ["NOE calculation data type string matching patterns", """ - ____________________________________________________________________________________________ - | | | | - | Data type | Object name | Patterns | - |________________________|______________|__________________________________________________| - | | | | - | Reference intensity | 'ref' | '^[Rr]ef$' or '[Rr]ef[ -_][Ii]nt' | - | | | | - | Saturated intensity | 'sat' | '^[Ss]at$' or '[Ss]at[ -_][Ii]nt' | - | | | | - | NOE | 'noe' | '^[Nn][Oo][Ee]$' | - |________________________|______________|__________________________________________________| + _________________________________________ + | | | + | Data type | Object name | + |________________________|______________| + | | | + | Reference intensity | 'ref' | + | | | + | Saturated intensity | 'sat' | + | | | + | NOE | 'noe' | + |________________________|______________| """] - - def return_data_name(self, param): - """Return a unique identifying string for the steady-state NOE parameter. - - @param param: The steady-state NOE parameter. - @type param: str - @return: The unique parameter identifying string. - @rtype: str - """ - - # Reference intensity. - if match('^[Rr]ef$', param) or match('[Rr]ef[ -_][Ii]nt', param): - return 'ref' - - # Saturated intensity. - if match('^[Ss]at$', param) or match('[Ss]at[ -_][Ii]nt', param): - return 'sat' - - # NOE. - if match('^[Nn][Oo][Ee]$', param): - return 'noe' - - - def return_grace_string(self, param): - """Return the Grace string representation of the parameter. - - This is used for axis labelling. - - @param param: The specific analysis parameter. - @type param: str - @return: The Grace string representation of the parameter. - @rtype: str - """ - - # Get the object name. - object_name = self.return_data_name(param) - - # Reference intensity. - if object_name == 'ref': - return 'Reference intensity' - - # Saturated intensity. - if object_name == 'sat': - return 'Saturated intensity' - - # NOE. - if object_name == 'noe': - return '\\qNOE\\Q' - - # Return the parameter as the Grace string. - return param def return_units(self, param): Modified: branches/spec_api/test_suite/system_tests/scripts/noe.py URL: http://svn.gna.org/viewcvs/relax/branches/spec_api/test_suite/system_tests/scripts/noe.py?rev=15186&r1=15185&r2=15186&view=diff ============================================================================== --- branches/spec_api/test_suite/system_tests/scripts/noe.py (original) +++ branches/spec_api/test_suite/system_tests/scripts/noe.py Thu Jan 19 09:48:54 2012 @@ -44,8 +44,8 @@ value.write(param='noe', file='devnull', force=True) # Create grace files. -grace.write(y_data_type='ref_ave', file='devnull', force=True) -grace.write(y_data_type='sat_ave', file='devnull', force=True) +grace.write(y_data_type='ref', file='devnull', force=True) +grace.write(y_data_type='sat', file='devnull', force=True) grace.write(y_data_type='noe', file='devnull', force=True) # Write the results.