Author: bugman Date: Wed Nov 12 21:50:36 2008 New Revision: 7984 URL: http://svn.gna.org/viewcvs/relax?rev=7984&view=rev Log: Merged revisions 7969-7983 via svnmerge from svn+ssh://bugman@xxxxxxxxxxx/svn/relax/1.3 ........ r7971 | bugman | 2008-11-10 23:17:17 +0100 (Mon, 10 Nov 2008) | 6 lines Added a missing RelaxError import. This was discovered when trying to replicate bug #12582 (https://gna.org/bugs/index.php?12582) reported by Chris Brosey (chris dot a dot brosey att vanderbilt dot edu). ........ r7972 | bugman | 2008-11-10 23:31:18 +0100 (Mon, 10 Nov 2008) | 3 lines Added a system test for replicating bug #12582. ........ r7973 | bugman | 2008-11-10 23:36:36 +0100 (Mon, 10 Nov 2008) | 9 lines Fix for bug #12582 (https://gna.org/bugs/index.php?12582). This was reported by Chris Brosey (chris dot a dot brosey att vanderbilt dot edu). The problem was that the frq_labels data structure in the SpinContainer was sometimes set to [] rather than the data structure being missing. Now the structure is being tested if it is either None or [] before being accessed in the model-free return_units() method. ........ r7975 | bugman | 2008-11-12 15:57:25 +0100 (Wed, 12 Nov 2008) | 3 lines Converted some ints to bools. ........ r7976 | bugman | 2008-11-12 20:57:14 +0100 (Wed, 12 Nov 2008) | 3 lines Modified the system test to additionally catch bug #12591 (https://gna.org/bugs/index.php?12591). ........ r7977 | bugman | 2008-11-12 20:59:05 +0100 (Wed, 12 Nov 2008) | 3 lines Renamed the system test script. ........ r7978 | bugman | 2008-11-12 20:59:27 +0100 (Wed, 12 Nov 2008) | 3 lines Deleted the old system test script. ........ r7979 | bugman | 2008-11-12 21:00:37 +0100 (Wed, 12 Nov 2008) | 3 lines Fixes for the system test script rename of the previous commits. ........ r7980 | bugman | 2008-11-12 21:18:03 +0100 (Wed, 12 Nov 2008) | 9 lines 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. ........ r7981 | bugman | 2008-11-12 21:21:39 +0100 (Wed, 12 Nov 2008) | 9 lines Final fix for bug #12591 (https://gna.org/bugs/index.php?12591). This bug was reported by Chris Brosey (chris dot a dot brosey att vanderbilt dot edu). The problem was that the global_index counter in the model-free model_loop() method was supposed to be incremented at the start of the loop. The deselected spin skipping code was located before this though, causing the counter to not be incremented! ........ r7982 | bugman | 2008-11-12 21:35:26 +0100 (Wed, 12 Nov 2008) | 5 lines Created a very simple system test to catch bug #12588 (https://gna.org/bugs/index.php?12588). This bug was reported by Tyler Reddy (treddy at dal dot ca). ........ r7983 | bugman | 2008-11-12 21:49:03 +0100 (Wed, 12 Nov 2008) | 8 lines Fix for bug #12588 (https://gna.org/bugs/index.php?12588). This bug was reported by Tyler Reddy (treddy at dal dot ca). The problem was that the results.read() user function was not handling the directory name being part of the file name argument. This can now be handled. ........ Added: branches/spectral_errors/test_suite/system_tests/scripts/bugs_12582_12591.py - copied unchanged from r7983, 1.3/test_suite/system_tests/scripts/bugs_12582_12591.py Modified: branches/spectral_errors/ (props changed) branches/spectral_errors/generic_fns/model_selection.py branches/spectral_errors/generic_fns/pipes.py branches/spectral_errors/generic_fns/results.py branches/spectral_errors/generic_fns/sequence.py branches/spectral_errors/specific_fns/model_free/main.py branches/spectral_errors/test_suite/system_tests/model_free.py branches/spectral_errors/test_suite/system_tests/structure.py Propchange: branches/spectral_errors/ ------------------------------------------------------------------------------ --- svnmerge-integrated (original) +++ svnmerge-integrated Wed Nov 12 21:50:36 2008 @@ -1,1 +1,1 @@ -/1.3:1-7968 +/1.3:1-7983 Modified: branches/spectral_errors/generic_fns/model_selection.py URL: http://svn.gna.org/viewcvs/relax/branches/spectral_errors/generic_fns/model_selection.py?rev=7984&r1=7983&r2=7984&view=diff ============================================================================== --- branches/spectral_errors/generic_fns/model_selection.py (original) +++ branches/spectral_errors/generic_fns/model_selection.py Wed Nov 12 21:50:36 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: branches/spectral_errors/generic_fns/pipes.py URL: http://svn.gna.org/viewcvs/relax/branches/spectral_errors/generic_fns/pipes.py?rev=7984&r1=7983&r2=7984&view=diff ============================================================================== --- branches/spectral_errors/generic_fns/pipes.py (original) +++ branches/spectral_errors/generic_fns/pipes.py Wed Nov 12 21:50:36 2008 @@ -29,11 +29,11 @@ from relax_errors import RelaxError, RelaxNoPipeError, RelaxPipeError # Relaxation curve fitting modules compilation test. -C_module_exp_fn = 1 +C_module_exp_fn = True try: from maths_fns.relax_fit import func except ImportError: - C_module_exp_fn = 0 + C_module_exp_fn = False def copy(pipe_from=None, pipe_to=None): Modified: branches/spectral_errors/generic_fns/results.py URL: http://svn.gna.org/viewcvs/relax/branches/spectral_errors/generic_fns/results.py?rev=7984&r1=7983&r2=7984&view=diff ============================================================================== --- branches/spectral_errors/generic_fns/results.py (original) +++ branches/spectral_errors/generic_fns/results.py Wed Nov 12 21:50:36 2008 @@ -24,6 +24,7 @@ """Module for reading/writing/displaying the results in a data pipe.""" # Python module imports. +from os.path import dirname from re import search from string import split import sys @@ -88,14 +89,14 @@ file_path = get_file_path(file_name=file, dir=directory) # Open the file. - file = open_read_file(file_name=file, dir=directory) + file = open_read_file(file_name=file_path) # Determine the format of the file. format = determine_format(file) # XML results. if format == 'xml': - read_function = ds.from_xml(file, dir=directory) + read_function = ds.from_xml(file, dir=dirname(file_path)) # Columnar results. elif format == 'columnar': Modified: branches/spectral_errors/generic_fns/sequence.py URL: http://svn.gna.org/viewcvs/relax/branches/spectral_errors/generic_fns/sequence.py?rev=7984&r1=7983&r2=7984&view=diff ============================================================================== --- branches/spectral_errors/generic_fns/sequence.py (original) +++ branches/spectral_errors/generic_fns/sequence.py Wed Nov 12 21:50:36 2008 @@ -29,7 +29,7 @@ # relax module imports. from generic_fns.mol_res_spin import count_spins, exists_mol_res_spin_data, generate_spin_id, return_molecule, return_residue, return_spin, spin_loop import pipes -from relax_errors import RelaxError, RelaxFileEmptyError, RelaxNoSequenceError, RelaxSequenceError +from relax_errors import RelaxError, RelaxFileEmptyError, RelaxInvalidSeqError, RelaxNoSequenceError, RelaxSequenceError from relax_io import extract_data, open_write_file, strip import sys Modified: branches/spectral_errors/specific_fns/model_free/main.py URL: http://svn.gna.org/viewcvs/relax/branches/spectral_errors/specific_fns/model_free/main.py?rev=7984&r1=7983&r2=7984&view=diff ============================================================================== --- branches/spectral_errors/specific_fns/model_free/main.py (original) +++ branches/spectral_errors/specific_fns/model_free/main.py Wed Nov 12 21:50:36 2008 @@ -1740,12 +1740,12 @@ # Loop over the spins. global_index = -1 for spin in spin_loop(): + # Increment the global spin index. + global_index = global_index + 1 + # Skip deselected spins. if not spin.select: continue - - # Increment the global spin index. - global_index = global_index + 1 # Yield the spin index. yield global_index @@ -2335,7 +2335,7 @@ return 'ps' # Rex (value at 1st field strength). - elif object_name == 'rex' and hasattr(spin, 'frq_labels'): + elif object_name == 'rex' and hasattr(spin, 'frq_labels') and spin.frq_labels != None and len(spin.frq_labels): return spin.frq_labels[0] + ' MHz' # Bond length (Angstrom). Modified: branches/spectral_errors/test_suite/system_tests/model_free.py URL: http://svn.gna.org/viewcvs/relax/branches/spectral_errors/test_suite/system_tests/model_free.py?rev=7984&r1=7983&r2=7984&view=diff ============================================================================== --- branches/spectral_errors/test_suite/system_tests/model_free.py (original) +++ branches/spectral_errors/test_suite/system_tests/model_free.py Wed Nov 12 21:50:36 2008 @@ -141,6 +141,13 @@ # Check that they are equal (converting to strings to avoid comparison nastiness). self.assertEqual(str(sub_obj1), str(sub_obj2)) + + + def test_bugs_12582_12591(self): + """Test catching bugs #12582 and #12591 as submitted by Chris Brosey.""" + + # Execute the script. + self.relax.interpreter.run(script_file=sys.path[-1] + '/test_suite/system_tests/scripts/bugs_12582_12591.py') def test_create_m4(self): Modified: branches/spectral_errors/test_suite/system_tests/structure.py URL: http://svn.gna.org/viewcvs/relax/branches/spectral_errors/test_suite/system_tests/structure.py?rev=7984&r1=7983&r2=7984&view=diff ============================================================================== --- branches/spectral_errors/test_suite/system_tests/structure.py (original) +++ branches/spectral_errors/test_suite/system_tests/structure.py Wed Nov 12 21:50:36 2008 @@ -93,6 +93,16 @@ self.assertEqual(str.z[i], z[i]) + def test_load_internal_results2(self): + """Load the PDB file using the information in a results file (using the internal structural object).""" + + # Path of the files. + path = sys.path[-1] + '/test_suite/shared_data/structures' + + # Read the results file. + self.relax.interpreter._Results.read(file=path+'/str_internal') + + def test_load_scientific_results(self): """Load the PDB file using the information in a results file (using the Scientific python structural object)."""