Author: han87 Date: Mon Jun 20 10:07:35 2011 New Revision: 13121 URL: http://svn.gna.org/viewcvs/relax?rev=13121&view=rev Log: Debugging the user functions load_xyz() and test_read_xyz_internal2(). The user functions load_xyz() in 'generic_fns/structure/internal.py' and test_read_xyz_internal2() in 'test_suite/system_tests/structure.py' have been changed so that the molecule name can be read properly. Modified: branches/xyz/generic_fns/structure/internal.py branches/xyz/test_suite/system_tests/structure.py Modified: branches/xyz/generic_fns/structure/internal.py URL: http://svn.gna.org/viewcvs/relax/branches/xyz/generic_fns/structure/internal.py?rev=13121&r1=13120&r2=13121&view=diff ============================================================================== --- branches/xyz/generic_fns/structure/internal.py (original) +++ branches/xyz/generic_fns/structure/internal.py Mon Jun 20 10:07:35 2011 @@ -853,8 +853,9 @@ if set_mol_name: new_mol_name.append(set_mol_name[mol_index]) else: - # Set the name to the file name plus the structure number. - new_mol_name.append(file_root(file) + '_mol' + repr(mol_index)) + if mol_index==0: + #Set the name to the file name plus the structure number. + new_mol_name.append(file_root(file) + '_mol' + repr(mol_index+1)) # Store the original mol number. orig_mol_num.append(mol_index) @@ -874,7 +875,8 @@ # Increment the model index. model_index = model_index + 1 - + + orig_mol_num=[0] # Create the structural data data structures. self.pack_structs(mol_conts, orig_model_num=orig_model_num, set_model_num=set_model_num, orig_mol_num=orig_mol_num, set_mol_name=new_mol_name, file_name=file, file_path=path) Modified: branches/xyz/test_suite/system_tests/structure.py URL: http://svn.gna.org/viewcvs/relax/branches/xyz/test_suite/system_tests/structure.py?rev=13121&r1=13120&r2=13121&view=diff ============================================================================== --- branches/xyz/test_suite/system_tests/structure.py (original) +++ branches/xyz/test_suite/system_tests/structure.py Mon Jun 20 10:07:35 2011 @@ -659,10 +659,10 @@ self.interpreter.structure.read_xyz(file='SSS-cluster4-new-test.xyz', dir=path) # Test the molecule name. - self.assertEqual(cdp.structure.structural_data[0].mol[0].mol_name, 'SSS-cluster4-new-test') + self.assertEqual(cdp.structure.structural_data[0].mol[0].mol_name, 'SSS-cluster4-new-test_mol1') # Load a single atom and test it. - self.interpreter.structure.load_spins('SSS-cluster4-new-test:3@C') + self.interpreter.structure.load_spins('SSS-cluster4-new-test_mol1:@C') self.assertEqual(count_spins(), 1) # Try loading a few protons.