Author: bugman Date: Tue Jul 17 09:42:05 2012 New Revision: 17264 URL: http://svn.gna.org/viewcvs/relax?rev=17264&view=rev Log: Eliminated the analysis specific API _set_param_values() base method. This is now in two parts, the _set_param_values_global() and _set_param_values_spin() methods. The frame order analysis in the trunk had switched to _set_param_values_global(), and now this branch does the same thing. Not sure why this change did not come across. Modified: branches/frame_order_testing/specific_fns/api_common.py branches/frame_order_testing/specific_fns/frame_order.py Modified: branches/frame_order_testing/specific_fns/api_common.py URL: http://svn.gna.org/viewcvs/relax/branches/frame_order_testing/specific_fns/api_common.py?rev=17264&r1=17263&r2=17264&view=diff ============================================================================== --- branches/frame_order_testing/specific_fns/api_common.py (original) +++ branches/frame_order_testing/specific_fns/api_common.py Tue Jul 17 09:42:05 2012 @@ -384,8 +384,8 @@ inc = inc + 1 - def _set_param_values(self, param=None, value=None, spin_id=None, force=True): - """Set the global and spin parameter values in the top layer of the data pipe. + def _set_param_values_global(self, param=None, value=None, spin_id=None, force=True): + """Set the global parameter values in the top layer of the data pipe. @keyword param: The parameter name list. @type param: list of str @@ -410,52 +410,6 @@ if not obj_name: raise RelaxError("The parameter '%s' is not valid for this data pipe type." % param[i]) - # Global parameter. - if self.GLOBAL_PARAMS.contains(param[i]): - # Is the parameter already set. - if not force and hasattr(cdp, obj_name) and getattr(cdp, obj_name) != None: - raise RelaxError("The parameter '%s' already exists, set the force flag to True to overwrite." % param[i]) - - # Set the parameter. - setattr(cdp, obj_name, value[i]) - - # Spin parameter. - elif self.SPIN_PARAMS.contains(param[i]): - for spin in spin_loop(spin_id): - # Skip deselected spins. - if not spin.select: - continue - - # Set the parameter. - setattr(spin, param[i], value[i]) - - - def _set_param_values_global(self, param=None, value=None, spin_id=None, force=True): - """Set the global parameter values in the top layer of the data pipe. - - @keyword param: The parameter name list. - @type param: list of str - @keyword value: The parameter value list. - @type value: list - @keyword spin_id: The spin identification string (unused). - @type spin_id: None - @keyword force: A flag which if True will cause current values to be overwritten. If False, a RelaxError will raised if the parameter value is already set. - @type force: bool - """ - - # Checks. - arg_check.is_str_list(param, 'parameter name') - arg_check.is_list(value, 'parameter value') - - # Loop over the parameters. - for i in range(len(param)): - # Get the object's name. - obj_name = self.return_data_name(param[i]) - - # Is the parameter is valid? - if not obj_name: - raise RelaxError("The parameter '%s' is not valid for this data pipe type." % param[i]) - # Is the parameter already set. if not force and hasattr(cdp, obj_name) and getattr(cdp, obj_name) != None: raise RelaxError("The parameter '%s' already exists, set the force flag to True to overwrite." % param[i]) Modified: branches/frame_order_testing/specific_fns/frame_order.py URL: http://svn.gna.org/viewcvs/relax/branches/frame_order_testing/specific_fns/frame_order.py?rev=17264&r1=17263&r2=17264&view=diff ============================================================================== --- branches/frame_order_testing/specific_fns/frame_order.py (original) +++ branches/frame_order_testing/specific_fns/frame_order.py Tue Jul 17 09:42:05 2012 @@ -65,7 +65,7 @@ self.eliminate = self._eliminate_false self.overfit_deselect = self._overfit_deselect_dummy self.return_conversion_factor = self._return_no_conversion_factor - self.set_param_values = self._set_param_values + self.set_param_values = self._set_param_values_global # Set up the global parameters. self.PARAMS.add('ave_pos_alpha', scope='global', units='rad', desc='The average position alpha Euler angle', py_type=float, set='params', err=True, sim=True)