Author: bugman Date: Sun Oct 12 13:00:50 2008 New Revision: 7642 URL: http://svn.gna.org/viewcvs/relax?rev=7642&view=rev Log: Created the model_type() method to determine whether the model is local or global. Modified: 1.3/specific_fns/model_free/main.py 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=7642&r1=7641&r2=7642&view=diff ============================================================================== --- 1.3/specific_fns/model_free/main.py (original) +++ 1.3/specific_fns/model_free/main.py Sun Oct 12 13:00:50 2008 @@ -1689,7 +1689,7 @@ @param model_index: The model index. This is zero for the global models or equal to the global spin index (which covers the molecule, residue, and spin - indices). + indices). This originates from the model_loop(). @type model_index: int @return: The model description. @rtype: str @@ -1888,6 +1888,29 @@ # Return the data. return k, n, chi2 + + + def model_type(self, model_index): + """Return the type of the model, either being 'local' or 'global'. + + @param model_index: The model index. This is zero for the global models or equal to the + global spin index (which covers the molecule, residue, and spin + indices). This originates from the model_loop(). + @type model_index: int + @return: The model type, one of 'local' or 'global'. + @rtype: str + """ + + # Determine the model type. + model_type = self.determine_model_type() + + # Global models. + if model_type in ['all', 'diff']: + return 'global' + + # Local models. + else: + return 'local' def num_instances(self):