Author: bugman Date: Wed Jul 27 16:20:20 2011 New Revision: 13930 URL: http://svn.gna.org/viewcvs/relax?rev=13930&view=rev Log: Merged revisions 13926-13927,13929 via svnmerge from svn+ssh://bugman@xxxxxxxxxxx/svn/relax/1.3 ........ r13926 | bugman | 2011-07-27 16:01:22 +0200 (Wed, 27 Jul 2011) | 5 lines The create_molecule, create_residue, and create_spin functions now returned the created container. This should not affect any of the current code using these, as normally None would be returned. ........ r13927 | bugman | 2011-07-27 16:05:49 +0200 (Wed, 27 Jul 2011) | 6 lines Invisible fix for the test_opendx_theta_phi_da() system test. The spins are extracted from the structure, so they don't need to be read from the relaxation data file as well. This is causing problems in the xyz branch, but is not an issue in the main line. ........ r13929 | bugman | 2011-07-27 16:15:41 +0200 (Wed, 27 Jul 2011) | 3 lines Modified the create_spin() function to overwrite the first spin if empty. ........ Modified: branches/gui_testing/ (props changed) branches/gui_testing/generic_fns/mol_res_spin.py branches/gui_testing/test_suite/system_tests/model_free.py Propchange: branches/gui_testing/ ------------------------------------------------------------------------------ --- svnmerge-integrated (original) +++ svnmerge-integrated Wed Jul 27 16:20:20 2011 @@ -1,1 +1,1 @@ -/1.3:1-13919 +/1.3:1-13929 Modified: branches/gui_testing/generic_fns/mol_res_spin.py URL: http://svn.gna.org/viewcvs/relax/branches/gui_testing/generic_fns/mol_res_spin.py?rev=13930&r1=13929&r2=13930&view=diff ============================================================================== --- branches/gui_testing/generic_fns/mol_res_spin.py (original) +++ branches/gui_testing/generic_fns/mol_res_spin.py Wed Jul 27 16:20:20 2011 @@ -907,6 +907,8 @@ @type mol_name: str @keyword mol_type: The type of molecule. @type mol_type: str + @return: The newly created molecule. + @rtype: MoleculeContainer instance """ # Test if the current data pipe exists. @@ -923,6 +925,9 @@ # Append the molecule. cdp.mol.add_item(mol_name=mol_name, mol_type=mol_type) + + # Return the molecule. + return cdp.mol[-1] def create_residue(res_num=None, res_name=None, mol_name=None): @@ -934,6 +939,8 @@ @type res_name: str @keyword mol_name: The name of the molecule to add the residue to. @type mol_name: str + @return: The newly created residue. + @rtype: ResidueContainer instance """ # Test if the current data pipe exists. @@ -950,6 +957,9 @@ # Add the residue. mol_cont.res.add_item(res_num=res_num, res_name=res_name) + + # Return the residue. + return mol_cont.res[-1] def create_pseudo_spin(spin_name=None, spin_num=None, res_id=None, members=None, averaging=None): @@ -1056,6 +1066,8 @@ @type res_name: str @keyword mol_name: The name of the molecule to add the spin to. @type mol_name: str + @return: The newly created spin. + @rtype: SpinContainer instance """ # Test if the current data pipe exists. @@ -1072,8 +1084,19 @@ if not res_cont: res_cont = cdp.mol[0].res[0] - # Add the spin. - res_cont.spin.add_item(spin_num=spin_num, spin_name=spin_name) + # Rename the spin, if only a single one exists and it is empty. + if len(res_cont.spin) == 1 and res_cont.spin[0].is_empty(): + spin_cont = res_cont.spin[0] + spin_cont.name = spin_name + spin_cont.num = spin_num + + # Otherwise add the spin. + else: + res_cont.spin.add_item(spin_num=spin_num, spin_name=spin_name) + spin_cont = res_cont.spin[-1] + + # Return the spin. + return spin_cont def convert_from_global_index(global_index=None, pipe=None): Modified: branches/gui_testing/test_suite/system_tests/model_free.py URL: http://svn.gna.org/viewcvs/relax/branches/gui_testing/test_suite/system_tests/model_free.py?rev=13930&r1=13929&r2=13930&view=diff ============================================================================== --- branches/gui_testing/test_suite/system_tests/model_free.py (original) +++ branches/gui_testing/test_suite/system_tests/model_free.py Wed Jul 27 16:20:20 2011 @@ -519,9 +519,6 @@ # Path of the files. path = status.install_path + sep+'test_suite'+sep+'shared_data'+sep+'model_free'+sep+'S2_0.970_te_2048_Rex_0.149' - - # Read the sequence. - self.interpreter.sequence.read(file='noe.500.out', dir=path, res_num_col=1, res_name_col=2) # Read the PDF file and set the vectors. self.interpreter.structure.read_pdb(file='pdb', dir=path, read_model=1)