Author: bugman Date: Wed Nov 12 21:18:03 2008 New Revision: 7980 URL: http://svn.gna.org/viewcvs/relax?rev=7980&view=rev Log: Partial fix for bug #12591 (https://gna.org/bugs/index.php?12591). This was reported by Chris Brosey (chris dot a dot brosey att vanderbilt dot edu). If no model is ever selected in the model_selection.select() function, then relax no longer fails. The failure is however caused by another problem elsewhere within relax, so this fix is not complete. Modified: 1.3/generic_fns/model_selection.py 1.3/test_suite/system_tests/scripts/bugs_12582_12591.py Modified: 1.3/generic_fns/model_selection.py URL: http://svn.gna.org/viewcvs/relax/1.3/generic_fns/model_selection.py?rev=7980&r1=7979&r2=7980&view=diff ============================================================================== --- 1.3/generic_fns/model_selection.py (original) +++ 1.3/generic_fns/model_selection.py Wed Nov 12 21:18:03 2008 @@ -150,6 +150,7 @@ duplicate_data = {} model_statistics = {} skip_function = {} + modsel_pipe_exists = False # Cross validation setup. if type(pipes[0]) == list: @@ -283,16 +284,25 @@ best_model = pipe best_crit = crit - # Print out of selected model. - print "The model from the data pipe " + `best_model` + " has been selected." - # Duplicate the data from the 'best_model' to the model selection data pipe. if best_model != None: + # Print out of selected model. + print "The model from the data pipe " + `best_model` + " has been selected." + # Switch to the selected data pipe. switch(best_model) # Duplicate. duplicate_data[best_model](best_model, modsel_pipe, model_info, verbose=False) + # Model selection pipe now exists. + modsel_pipe_exists = True + + # No model selected. + else: + # Print out of selected model. + print "No model has been selected." + # Switch to the model selection pipe. - switch(modsel_pipe) + if modsel_pipe_exists: + switch(modsel_pipe) Modified: 1.3/test_suite/system_tests/scripts/bugs_12582_12591.py URL: http://svn.gna.org/viewcvs/relax/1.3/test_suite/system_tests/scripts/bugs_12582_12591.py?rev=7980&r1=7979&r2=7980&view=diff ============================================================================== --- 1.3/test_suite/system_tests/scripts/bugs_12582_12591.py (original) +++ 1.3/test_suite/system_tests/scripts/bugs_12582_12591.py Wed Nov 12 21:18:03 2008 @@ -14,7 +14,6 @@ # Loop over the models. for name in ['tm0', 'tm1']: - # Setup. pipe.create(pipe_name=name, pipe_type='mf') sequence.read(file='noe.500.out', dir=path, mol_name_col=None, res_num_col=0, res_name_col=1, spin_num_col=None, spin_name_col=None, sep=None) @@ -35,5 +34,6 @@ results.write(file='devnull', force=True, compress_type=1) # Model selection. +sequence.display() eliminate(function=None, args=None) model_selection(method='AIC', modsel_pipe='aic', pipes=['tm0', 'tm1'])