Author: bugman Date: Fri Jan 25 15:57:32 2008 New Revision: 4889 URL: http://svn.gna.org/viewcvs/relax?rev=4889&view=rev Log: Merged revisions 4886-4888 via svnmerge from svn+ssh://bugman@xxxxxxxxxxx/svn/relax/1.3 ........ r4886 | bugman | 2008-01-25 14:13:57 +0100 (Fri, 25 Jan 2008) | 9 lines Bug fix for the generic_fns.value.set() function. The differentiation between a spin specific parameter and a global parameter was not working for specific analyses with no spin specific parameters. The return_data_name() function was being used to differentiate, which makes no sense. So instead the is_spin_param() function has been introduced to allow the specific code to answer the question explicitly. Note that this will temporarily break many things. ........ r4887 | bugman | 2008-01-25 15:31:19 +0100 (Fri, 25 Jan 2008) | 5 lines Implemented the is_spin_param() base class method. This function always returns true. ........ r4888 | bugman | 2008-01-25 15:56:06 +0100 (Fri, 25 Jan 2008) | 3 lines Implemented the model-free specific is_spin_param() method. ........ Modified: branches/N_state_model/ (props changed) branches/N_state_model/generic_fns/value.py branches/N_state_model/specific_fns/__init__.py branches/N_state_model/specific_fns/base_class.py branches/N_state_model/specific_fns/model_free/model_free.py Propchange: branches/N_state_model/ ------------------------------------------------------------------------------ Binary property 'svnmerge-integrated' - no diff available. Modified: branches/N_state_model/generic_fns/value.py URL: http://svn.gna.org/viewcvs/relax/branches/N_state_model/generic_fns/value.py?rev=4889&r1=4888&r2=4889&view=diff ============================================================================== --- branches/N_state_model/generic_fns/value.py (original) +++ branches/N_state_model/generic_fns/value.py Fri Jan 25 15:57:32 2008 @@ -50,7 +50,7 @@ """ # Specific functions. - return_data_name = get_specific_fn('return_data_name', relax_data_store[relax_data_store.current_pipe].pipe_type) + is_spin_param = get_specific_fn('is_spin_param', relax_data_store[relax_data_store.current_pipe].pipe_type) # Initialise. spin_params = [] @@ -61,7 +61,7 @@ # Single parameter. if type(param) == str: # Spin specific parameter. - if return_data_name(param): + if is_spin_param(param): params = spin_params values = spin_values @@ -92,7 +92,7 @@ # Loop over all parameters. for i in xrange(len(param)): # Spin specific parameter. - if return_data_name(param[i]): + if is_spin_param(param[i]): params = spin_params values = spin_values Modified: branches/N_state_model/specific_fns/__init__.py URL: http://svn.gna.org/viewcvs/relax/branches/N_state_model/specific_fns/__init__.py?rev=4889&r1=4888&r2=4889&view=diff ============================================================================== --- branches/N_state_model/specific_fns/__init__.py (original) +++ branches/N_state_model/specific_fns/__init__.py Fri Jan 25 15:57:32 2008 @@ -106,6 +106,10 @@ if eqi == 'init_sim_values': function = inst.sim_init_values + # Spin specific parameter determining function. + if eqi == 'is_spin_param': + function = inst.is_spin_param + # Map bounds function. if eqi == 'map_bounds': function = inst.map_bounds Modified: branches/N_state_model/specific_fns/base_class.py URL: http://svn.gna.org/viewcvs/relax/branches/N_state_model/specific_fns/base_class.py?rev=4889&r1=4888&r2=4889&view=diff ============================================================================== --- branches/N_state_model/specific_fns/base_class.py (original) +++ branches/N_state_model/specific_fns/base_class.py Fri Jan 25 15:57:32 2008 @@ -66,6 +66,22 @@ # No errors found. return False + + + def is_spin_param(self, name): + """Determine whether the given parameter is spin specific. + + This base class method always returns true, hence all parameters will be considered + residents of a SpinContainer object unless this method is overwritten. + + @param name: The name of the parameter. + @type name: str + @return: True + @rtype: bool + """ + + # Return the default of True. + return True def num_instances(self): Modified: branches/N_state_model/specific_fns/model_free/model_free.py URL: http://svn.gna.org/viewcvs/relax/branches/N_state_model/specific_fns/model_free/model_free.py?rev=4889&r1=4888&r2=4889&view=diff ============================================================================== --- branches/N_state_model/specific_fns/model_free/model_free.py (original) +++ branches/N_state_model/specific_fns/model_free/model_free.py Fri Jan 25 15:57:32 2008 @@ -1074,6 +1074,27 @@ # Return the parameter names. return self.param_vector + + + def is_spin_param(self, name): + """Determine whether the given parameter is spin specific. + + Unless a diffusion parameter is encountered, this method will return true. + + @param name: The name of the parameter. + @type name: str + @return: If the parameter is a diffusion parameter, False I returned. Otherwise True + is returned. + @rtype: bool + """ + + # Catch a diffusion parameter. + if diffusion_tensor.return_data_name(name): + return False + + # All the rest: + else: + return True def linear_constraints(self, index=None):