Author: semor Date: Fri Apr 17 17:45:55 2009 New Revision: 9014 URL: http://svn.gna.org/viewcvs/relax?rev=9014&view=rev Log: Merged revisions 8997-9003,9010-9011 via svnmerge from svn+ssh://semor@xxxxxxxxxxx/svn/relax/1.3 ........ r8997 | bugman | 2009-03-25 16:49:55 -0400 (Wed, 25 Mar 2009) | 5 lines Modified the model elimination print out to show the data pipe name. This was picked up while trying to debug bug #13259 (https://gna.org/bugs/index.php?13259). ........ r8998 | bugman | 2009-03-25 17:26:06 -0400 (Wed, 25 Mar 2009) | 3 lines Clean up of the model_loop() checking. ........ r8999 | bugman | 2009-03-25 17:42:30 -0400 (Wed, 25 Mar 2009) | 6 lines Removed the check for spin selection so that determine_model_type() works with nothing selected. This is a partial response to bug #13259 (https://gna.org/bugs/index.php?13259) reported by Pierre-Yves Savard (pierre-yves dot savard att bcm dot ulaval dot ca). ........ r9000 | bugman | 2009-03-25 19:21:17 -0400 (Wed, 25 Mar 2009) | 3 lines Fixes for the MC sim methods for deselected spins. ........ r9001 | bugman | 2009-03-25 19:42:14 -0400 (Wed, 25 Mar 2009) | 5 lines Modified the structure.vectors() user function to fail if no vectors are found. This saves a lot of sanity when debugging a user script which fails. ........ r9002 | bugman | 2009-03-26 10:10:14 -0400 (Thu, 26 Mar 2009) | 7 lines Bug fix for bug #13259 (https://gna.org/bugs/index.php?13259). This bug was reported by Pierre-Yves Savard (pierre-yves dot savard att bcm dot ulaval dot ca). The bug may not be completely gone yet. ........ r9003 | bugman | 2009-03-26 11:40:57 -0400 (Thu, 26 Mar 2009) | 6 lines Fix for the regression of bug #12607 (https://gna.org/bugs/?12607). The determine_model_type() method now handles the strange case where no spins are selected (gracefully). ........ r9010 | bugman | 2009-04-15 08:33:53 -0400 (Wed, 15 Apr 2009) | 5 lines Expanded the test_read_pdb_internal3() and test_read_pdb_scientific3() system tests. Now the reading of atomic positions from different models is tested. ........ r9011 | bugman | 2009-04-15 09:28:15 -0400 (Wed, 15 Apr 2009) | 6 lines Removed a test in load_spins() causing a bug. This test is totally unnecessary as the structures are not created if they already exist. This was causing only the position from the first model to be extracted, if ave_pos was False. ........ Modified: branches/relax_disp/ (props changed) branches/relax_disp/generic_fns/model_selection.py branches/relax_disp/generic_fns/structure/main.py branches/relax_disp/sample_scripts/full_analysis.py branches/relax_disp/specific_fns/model_free/main.py branches/relax_disp/test_suite/system_tests/structure.py Propchange: branches/relax_disp/ ------------------------------------------------------------------------------ --- svnmerge-integrated (original) +++ svnmerge-integrated Fri Apr 17 17:45:55 2009 @@ -1,1 +1,1 @@ -/1.3:1-8990 +/1.3:1-9013 Modified: branches/relax_disp/generic_fns/model_selection.py URL: http://svn.gna.org/viewcvs/relax/branches/relax_disp/generic_fns/model_selection.py?rev=9014&r1=9013&r2=9014&view=diff ============================================================================== --- branches/relax_disp/generic_fns/model_selection.py (original) +++ branches/relax_disp/generic_fns/model_selection.py Fri Apr 17 17:45:55 2009 @@ -196,10 +196,9 @@ model_statistics[pipes[i]] = get_specific_fn('model_stats', get_type(pipes[i])) skip_function[pipes[i]] = get_specific_fn('skip_function', get_type(pipes[i])) - # The model loop should be the same for all data pipes! - for j in xrange(len(pipes)): - if model_loop[pipes[0]] != model_loop[pipes[j]]: - raise RelaxError, "The models for each data pipes should be the same." + # The model loop should be the same for all data pipes! + if model_loop[pipes[0]] != model_loop[pipes[i]]: + raise RelaxError, "Bug: The model loop for each data pipes should be the same!" model_loop = model_loop[pipes[0]] # The model description. Modified: branches/relax_disp/generic_fns/structure/main.py URL: http://svn.gna.org/viewcvs/relax/branches/relax_disp/generic_fns/structure/main.py?rev=9014&r1=9013&r2=9014&view=diff ============================================================================== --- branches/relax_disp/generic_fns/structure/main.py (original) +++ branches/relax_disp/generic_fns/structure/main.py Fri Apr 17 17:45:55 2009 @@ -80,10 +80,6 @@ if last_model != model_num: model_index = model_index + 1 last_model = model_num - - # Only load one set of spins if combine_models is set. - if combine_models and model_index >= 1: - break # Remove the '+' regular expression character from the mol, res, and spin names! if mol_name and search('\+', mol_name): @@ -340,6 +336,7 @@ object_name = 'bond_vect' # Loop over the spins. + no_vectors = True for spin, mol_name, res_num, res_name in spin_loop(selection=spin_id, full_info=True): # Skip deselected spins. if not spin.select: @@ -410,9 +407,16 @@ # Set the vector. setattr(spin, object_name, vector) + # We have a vector! + no_vectors = False + # Print out of modified spins. if verbosity: print "Extracted " + spin.name + "-" + attached_name + " vectors for " + `id` + '.' + + # Right, catch the problem of missing vectors to prevent massive user confusion! + if no_vectors: + raise RelaxError, "No vectors could be extracted." def write_pdb(file=None, dir=None, model_num=None, force=False): Modified: branches/relax_disp/sample_scripts/full_analysis.py URL: http://svn.gna.org/viewcvs/relax/branches/relax_disp/sample_scripts/full_analysis.py?rev=9014&r1=9013&r2=9014&view=diff ============================================================================== --- branches/relax_disp/sample_scripts/full_analysis.py (original) +++ branches/relax_disp/sample_scripts/full_analysis.py Fri Apr 17 17:45:55 2009 @@ -297,7 +297,7 @@ self.multi_model() # Model selection. - self.model_selection(modsel_pipe='final', dir=self.base_dir + 'aic') + self.model_selection(modsel_pipe='aic', dir=self.base_dir + 'aic') # Final optimisation of all diffusion and model-free parameters. fix('all', fixed=False) Modified: branches/relax_disp/specific_fns/model_free/main.py URL: http://svn.gna.org/viewcvs/relax/branches/relax_disp/specific_fns/model_free/main.py?rev=9014&r1=9013&r2=9014&view=diff ============================================================================== --- branches/relax_disp/specific_fns/model_free/main.py (original) +++ branches/relax_disp/specific_fns/model_free/main.py Fri Apr 17 17:45:55 2009 @@ -1,6 +1,6 @@ ############################################################################### # # -# Copyright (C) 2003-2008 Edward d'Auvergne # +# Copyright (C) 2003-2009 Edward d'Auvergne # # # # This file is part of the program relax. # # # @@ -992,10 +992,14 @@ # Check if any model-free parameters are allowed to vary. mf_all_fixed = True + mf_all_deselected = True for spin in spin_loop(): # Skip deselected spins. if not spin.select: continue + + # At least one spin is selected. + mf_all_deselected = False # Test the fixed flag. if not hasattr(spin, 'fixed'): @@ -1004,6 +1008,14 @@ if not spin.fixed: mf_all_fixed = False break + + # No spins selected?!? + if mf_all_deselected: + # All parameters fixed! + if cdp.diff_tensor.fixed: + raise RelaxError, "All parameters are fixed." + + return 'diff' # Local tm. if local_tm: @@ -1254,17 +1266,17 @@ # Local tm. if name == 'local_tm' and value >= c1: if sim == None: - print "The local tm parameter of %.5g is greater than %.5g, eliminating spin system '%s'." % (value, c1, spin_id) + print "Data pipe '%s': The local tm parameter of %.5g is greater than %.5g, eliminating spin system '%s'." % (pipes.cdp_name(), value, c1, spin_id) else: - print "The local tm parameter of %.5g is greater than %.5g, eliminating simulation %i of spin system '%s'." % (value, c1, sim, spin_id) + print "Data pipe '%s': The local tm parameter of %.5g is greater than %.5g, eliminating simulation %i of spin system '%s'." % (pipes.cdp_name(), value, c1, sim, spin_id) return True # Internal correlation times. if match('t[efs]', name) and value >= c2 * tm: if sim == None: - print "The %s value of %.5g is greater than %.5g, eliminating spin system '%s'." % (name, value, c2*tm, spin_id) + print "Data pipe '%s': The %s value of %.5g is greater than %.5g, eliminating spin system '%s'." % (pipes.cdp_name(), name, value, c2*tm, spin_id) else: - print "The %s value of %.5g is greater than %.5g, eliminating simulation %i of spin system '%s'." % (name, value, c2*tm, sim, spin_id) + print "Data pipe '%s': The %s value of %.5g is greater than %.5g, eliminating simulation %i of spin system '%s'." % (pipes.cdp_name(), name, value, c2*tm, sim, spin_id) return True # Accept model. @@ -1786,10 +1798,6 @@ for spin in spin_loop(): # Increment the global spin index. global_index = global_index + 1 - - # Skip deselected spins. - if not spin.select: - continue # Yield the spin index. yield global_index @@ -2857,6 +2865,10 @@ # Get the spin container. spin = return_spin_from_index(model_index) + # Skip if deselected. + if not spin.select: + return + # Set the simulation flags. spin.select_sim = deepcopy(select_sim) @@ -3227,6 +3239,10 @@ # Get the spin container. spin = return_spin_from_index(model_index) + # Skip if deselected. + if not spin.select: + return + # Return the list. return spin.select_sim Modified: branches/relax_disp/test_suite/system_tests/structure.py URL: http://svn.gna.org/viewcvs/relax/branches/relax_disp/test_suite/system_tests/structure.py?rev=9014&r1=9013&r2=9014&view=diff ============================================================================== --- branches/relax_disp/test_suite/system_tests/structure.py (original) +++ branches/relax_disp/test_suite/system_tests/structure.py Fri Apr 17 17:45:55 2009 @@ -200,14 +200,20 @@ def test_read_pdb_internal3(self): """Load the 'gromacs_phthalic_acid.pdb' PDB file (using the internal structural object PDB reader).""" + # Alias the current data pipe. + cdp = pipes.get_pipe() + # Path of the files. path = sys.path[-1] + '/test_suite/shared_data/structures' # Read the PDB. self.relax.interpreter._Structure.read_pdb(file='gromacs_phthalic_acid.pdb', dir=path, parser='internal') - # Try loading a few protons. - self.relax.interpreter._Structure.load_spins('@*H*') + # Try loading a few protons, without positions averaging across models. + self.relax.interpreter._Structure.load_spins('@*H*', ave_pos=False) + + # A test. + self.assertEqual(len(cdp.mol[0].res[0].spin[0].pos), 2) # And now all the rest of the atoms. self.relax.interpreter._Structure.load_spins() @@ -443,6 +449,9 @@ def test_read_pdb_scientific3(self): """Load the 'gromacs_phthalic_acid.pdb' PDB file (using the Scientific python structural object PDB reader).""" + # Alias the current data pipe. + cdp = pipes.get_pipe() + # Path of the files. path = sys.path[-1] + '/test_suite/shared_data/structures' @@ -450,7 +459,10 @@ self.relax.interpreter._Structure.read_pdb(file='gromacs_phthalic_acid.pdb', dir=path, parser='scientific') # Try loading a few protons. - self.relax.interpreter._Structure.load_spins('@*H*') + self.relax.interpreter._Structure.load_spins('@*H*', ave_pos=False) + + # A test. + self.assertEqual(len(cdp.mol[0].res[0].spin[0].pos), 2) # And now all the rest of the atoms. self.relax.interpreter._Structure.load_spins()