Author: bugman Date: Sun Apr 13 22:58:51 2008 New Revision: 5659 URL: http://svn.gna.org/viewcvs/relax?rev=5659&view=rev Log: Some changes to the tests() function. This code has to be completely redone though. Modified: 1.3/generic_fns/model_selection.py Modified: 1.3/generic_fns/model_selection.py URL: http://svn.gna.org/viewcvs/relax/1.3/generic_fns/model_selection.py?rev=5659&r1=5658&r2=5659&view=diff ============================================================================== --- 1.3/generic_fns/model_selection.py (original) +++ 1.3/generic_fns/model_selection.py Sun Apr 13 22:58:51 2008 @@ -290,28 +290,26 @@ pipes.copy(best_model, modsel_pipe) -def tests(run): - """Function containing tests the given run.""" - - # Test if the run exists. - if not run in relax_data_store.run_names: - raise RelaxNoPipeError, run - - # Find the index of the run. - index = relax_data_store.run_names.index(run) - - # Test if the function type is the same as 'self.function_type' (skip the test if self.function_type is a hybrid). - #if self.function_type != 'hybrid' and relax_data_store.run_types[index] != self.function_type: - if relax_data_store.run_types[index] != self.function_type[run]: - raise RelaxError, "The runs supplied are not all of the same function type." +def tests(pipe): + """Numerous tests for the given data pipe.""" + + # Test if the data pipe exists. + if pipe not in relax_data_store.keys(): + raise RelaxNoPipeError, pipe + + # Switch to this pipe. + pipes.switch(pipe) + + # Alias the pipe. + cdp = relax_data_store[pipe] # Skip all tests if the model is a hybrid. - if relax_data_store.run_types[index] == 'hybrid': + if cdp.pipe_type == 'hybrid': return - # Test if sequence data is loaded. - if not relax_data_store.res.has_key(run): - raise RelaxNoSequenceError, run + # Test if sequence data exists. + if not exists_mol_res_spin_data(): + raise RelaxNoSequenceError # Sequence lengths. if len(relax_data_store.res[self.first_run]) != len(relax_data_store.res[run]):