Author: bugman Date: Wed May 23 21:35:52 2012 New Revision: 16425 URL: http://svn.gna.org/viewcvs/relax?rev=16425&view=rev Log: Bug fix for all of the specific analysis code. The SPIN_PARAM and GLOBAL_PARAM structures are now initialised within the __init__() methods rather than being class variables. This bug was only uncovered by the auto-generated user functions. The problem with them being class variables of the base class is that the objects are then the same for all specific analyses. Modified: branches/uf_redesign/specific_fns/api_base.py branches/uf_redesign/specific_fns/consistency_tests.py branches/uf_redesign/specific_fns/frame_order.py branches/uf_redesign/specific_fns/jw_mapping.py branches/uf_redesign/specific_fns/model_free/__init__.py branches/uf_redesign/specific_fns/n_state_model.py branches/uf_redesign/specific_fns/noe/__init__.py branches/uf_redesign/specific_fns/relax_fit.py Modified: branches/uf_redesign/specific_fns/api_base.py URL: http://svn.gna.org/viewcvs/relax/branches/uf_redesign/specific_fns/api_base.py?rev=16425&r1=16424&r2=16425&view=diff ============================================================================== --- branches/uf_redesign/specific_fns/api_base.py (original) +++ branches/uf_redesign/specific_fns/api_base.py Wed May 23 21:35:52 2012 @@ -29,33 +29,36 @@ from specific_fns.api_objects import Param_list -class API_base: +class API_base(object): """Base class defining the specific_fns API. All the methods here are prototype methods. To identify that the method is not available for certain analysis types, if called a RelaxImplementError is raised if called. """ - # Class variables. - SPIN_PARAMS = Param_list() - GLOBAL_PARAMS = Param_list() - - # Add some spin specific objects. - SPIN_PARAMS.add('select', desc='The spin selection flag') - SPIN_PARAMS.add('fixed', desc='The fixed flag') - SPIN_PARAMS.add('chi2', desc='Chi-squared value') - SPIN_PARAMS.add('iter', desc='Optimisation iterations') - SPIN_PARAMS.add('f_count', desc='Number of function calls') - SPIN_PARAMS.add('g_count', desc='Number of gradient calls') - SPIN_PARAMS.add('h_count', desc='Number of Hessian calls') - SPIN_PARAMS.add('warning', desc='Optimisation warning') - - # Add some global objects. - GLOBAL_PARAMS.add('chi2', desc='Chi-squared value') - GLOBAL_PARAMS.add('iter', desc='Optimisation iterations') - GLOBAL_PARAMS.add('f_count', desc='Number of function calls') - GLOBAL_PARAMS.add('g_count', desc='Number of gradient calls') - GLOBAL_PARAMS.add('h_count', desc='Number of Hessian calls') - GLOBAL_PARAMS.add('warning', desc='Optimisation warning') + def __init__(self): + """Set up the specific objects.""" + + # Class variables. + self.SPIN_PARAMS = Param_list() + self.GLOBAL_PARAMS = Param_list() + + # Add some spin specific objects. + self.SPIN_PARAMS.add('select', desc='The spin selection flag') + self.SPIN_PARAMS.add('fixed', desc='The fixed flag') + self.SPIN_PARAMS.add('chi2', desc='Chi-squared value') + self.SPIN_PARAMS.add('iter', desc='Optimisation iterations') + self.SPIN_PARAMS.add('f_count', desc='Number of function calls') + self.SPIN_PARAMS.add('g_count', desc='Number of gradient calls') + self.SPIN_PARAMS.add('h_count', desc='Number of Hessian calls') + self.SPIN_PARAMS.add('warning', desc='Optimisation warning') + + # Add some global objects. + self.GLOBAL_PARAMS.add('chi2', desc='Chi-squared value') + self.GLOBAL_PARAMS.add('iter', desc='Optimisation iterations') + self.GLOBAL_PARAMS.add('f_count', desc='Number of function calls') + self.GLOBAL_PARAMS.add('g_count', desc='Number of gradient calls') + self.GLOBAL_PARAMS.add('h_count', desc='Number of Hessian calls') + self.GLOBAL_PARAMS.add('warning', desc='Optimisation warning') def back_calc_ri(self, spin_index=None, ri_id=None, ri_type=None, frq=None): Modified: branches/uf_redesign/specific_fns/consistency_tests.py URL: http://svn.gna.org/viewcvs/relax/branches/uf_redesign/specific_fns/consistency_tests.py?rev=16425&r1=16424&r2=16425&view=diff ============================================================================== --- branches/uf_redesign/specific_fns/consistency_tests.py (original) +++ branches/uf_redesign/specific_fns/consistency_tests.py Wed May 23 21:35:52 2012 @@ -41,6 +41,9 @@ def __init__(self): """Initialise the class by placing API_common methods into the API.""" + + # Execute the base class __init__ method. + super(Consistency_tests, self).__init__() # Place methods into the API. self.base_data_loop = self._base_data_loop_spin Modified: branches/uf_redesign/specific_fns/frame_order.py URL: http://svn.gna.org/viewcvs/relax/branches/uf_redesign/specific_fns/frame_order.py?rev=16425&r1=16424&r2=16425&view=diff ============================================================================== --- branches/uf_redesign/specific_fns/frame_order.py (original) +++ branches/uf_redesign/specific_fns/frame_order.py Wed May 23 21:35:52 2012 @@ -55,6 +55,9 @@ def __init__(self): """Initialise the class by placing API_common methods into the API.""" + + # Execute the base class __init__ method. + super(Frame_order, self).__init__() # Place methods into the API. self.eliminate = self._eliminate_false Modified: branches/uf_redesign/specific_fns/jw_mapping.py URL: http://svn.gna.org/viewcvs/relax/branches/uf_redesign/specific_fns/jw_mapping.py?rev=16425&r1=16424&r2=16425&view=diff ============================================================================== --- branches/uf_redesign/specific_fns/jw_mapping.py (original) +++ branches/uf_redesign/specific_fns/jw_mapping.py Wed May 23 21:35:52 2012 @@ -40,6 +40,9 @@ def __init__(self): """Initialise the class by placing API_common methods into the API.""" + + # Execute the base class __init__ method. + super(Jw_mapping, self).__init__() # Place methods into the API. self.base_data_loop = self._base_data_loop_spin Modified: branches/uf_redesign/specific_fns/model_free/__init__.py URL: http://svn.gna.org/viewcvs/relax/branches/uf_redesign/specific_fns/model_free/__init__.py?rev=16425&r1=16424&r2=16425&view=diff ============================================================================== --- branches/uf_redesign/specific_fns/model_free/__init__.py (original) +++ branches/uf_redesign/specific_fns/model_free/__init__.py Wed May 23 21:35:52 2012 @@ -54,6 +54,9 @@ def __init__(self): """Initialise the class by placing API_common methods into the API.""" + # Execute the base class __init__ method. + super(Model_free, self).__init__() + # Place methods into the API. self.base_data_loop = self._base_data_loop_spin self.return_error = self._return_error_relax_data Modified: branches/uf_redesign/specific_fns/n_state_model.py URL: http://svn.gna.org/viewcvs/relax/branches/uf_redesign/specific_fns/n_state_model.py?rev=16425&r1=16424&r2=16425&view=diff ============================================================================== --- branches/uf_redesign/specific_fns/n_state_model.py (original) +++ branches/uf_redesign/specific_fns/n_state_model.py Wed May 23 21:35:52 2012 @@ -59,6 +59,9 @@ def __init__(self): """Initialise the class by placing API_common methods into the API.""" + + # Execute the base class __init__ method. + super(N_state_model, self).__init__() # Place methods into the API. self.default_value = self._default_value_spin Modified: branches/uf_redesign/specific_fns/noe/__init__.py URL: http://svn.gna.org/viewcvs/relax/branches/uf_redesign/specific_fns/noe/__init__.py?rev=16425&r1=16424&r2=16425&view=diff ============================================================================== --- branches/uf_redesign/specific_fns/noe/__init__.py (original) +++ branches/uf_redesign/specific_fns/noe/__init__.py Wed May 23 21:35:52 2012 @@ -1,6 +1,6 @@ ############################################################################### # # -# Copyright (C) 2007-2010 Edward d'Auvergne # +# Copyright (C) 2007-2012 Edward d'Auvergne # # # # This file is part of the program relax. # # # @@ -40,6 +40,9 @@ def __init__(self): """Initialise the class by placing API_common methods into the API.""" + # Execute the base class __init__ method. + super(Noe, self).__init__() + # Place methods into the API. self.return_conversion_factor = self._return_no_conversion_factor self.return_data_desc = self._return_data_desc_spin Modified: branches/uf_redesign/specific_fns/relax_fit.py URL: http://svn.gna.org/viewcvs/relax/branches/uf_redesign/specific_fns/relax_fit.py?rev=16425&r1=16424&r2=16425&view=diff ============================================================================== --- branches/uf_redesign/specific_fns/relax_fit.py (original) +++ branches/uf_redesign/specific_fns/relax_fit.py Wed May 23 21:35:52 2012 @@ -50,6 +50,9 @@ def __init__(self): """Initialise the class by placing API_common methods into the API.""" + + # Execute the base class __init__ method. + super(Relax_fit, self).__init__() # Place methods into the API. self.base_data_loop = self._base_data_loop_spin