Author: bugman Date: Thu Jun 6 14:27:04 2013 New Revision: 19889 URL: http://svn.gna.org/viewcvs/relax?rev=19889&view=rev Log: Model selection in the dispersion auto-analysis is only performed if 2 or more models are present. Excluding the 'R2eff' model, if only 0 or 1 models are optimised, then model selection is skipped and a warning is given. This avoids tracebacks in the model_selection user function. Modified: branches/relax_disp/auto_analyses/relax_disp.py Modified: branches/relax_disp/auto_analyses/relax_disp.py URL: http://svn.gna.org/viewcvs/relax/branches/relax_disp/auto_analyses/relax_disp.py?rev=19889&r1=19888&r2=19889&view=diff ============================================================================== --- branches/relax_disp/auto_analyses/relax_disp.py (original) +++ branches/relax_disp/auto_analyses/relax_disp.py Thu Jun 6 14:27:04 2013 @@ -25,10 +25,12 @@ # Python module imports. from os import getcwd, sep import sys +from warnings import warn # relax module imports. from lib.list import unique_elements from lib.text.sectioning import title, subtitle +from lib.warnings import RelaxWarning from pipe_control.pipes import has_pipe from prompt.interpreter import Interpreter from specific_analyses.relax_disp.disp_data import loop_frq @@ -199,11 +201,14 @@ # Write out the results. self.write_results(path=self.results_dir+sep+model) - # Perform model selection. - self.interpreter.model_selection(method=self.modsel, modsel_pipe='final', pipes=model_pipes) - - # Write out the final results. - self.write_results(path=self.results_dir+sep+'final') + # Perform model selection, writing out the final results. + if len(model_pipes) >= 2: + self.interpreter.model_selection(method=self.modsel, modsel_pipe='final', pipes=model_pipes) + self.write_results(path=self.results_dir+sep+'final') + + # No model selection. + else: + warn(RelaxWarning("Model selection in the dispersion auto-analysis has been skipped as only %s models have been optimised." % len(model_pipes))) def write_results(self, path=None):