Author: han87 Date: Mon Jun 27 15:10:31 2011 New Revision: 13234 URL: http://svn.gna.org/viewcvs/relax?rev=13234&view=rev Log: Adding code for checking the atomic positions in the system test test_read_xyz_internal2() Code for checking the atomic position (x, y and z) of the last spin was added in the system test test_read_xyz_internal2(). Modified: branches/xyz/generic_fns/mol_res_spin.py branches/xyz/generic_fns/structure/main.py branches/xyz/test_suite/system_tests/structure.py Modified: branches/xyz/generic_fns/mol_res_spin.py URL: http://svn.gna.org/viewcvs/relax/branches/xyz/generic_fns/mol_res_spin.py?rev=13234&r1=13233&r2=13234&view=diff ============================================================================== --- branches/xyz/generic_fns/mol_res_spin.py (original) +++ branches/xyz/generic_fns/mol_res_spin.py Mon Jun 27 15:10:31 2011 @@ -867,6 +867,7 @@ # The data pipe. if pipe == None: pipe = pipes.cdp_name() + print "pipe", pipe # Test the data pipe. pipes.test(pipe) Modified: branches/xyz/generic_fns/structure/main.py URL: http://svn.gna.org/viewcvs/relax/branches/xyz/generic_fns/structure/main.py?rev=13234&r1=13233&r2=13234&view=diff ============================================================================== --- branches/xyz/generic_fns/structure/main.py (original) +++ branches/xyz/generic_fns/structure/main.py Mon Jun 27 15:10:31 2011 @@ -180,6 +180,7 @@ model_index = -1 last_model = None for model_num, mol_name, res_num, res_name, atom_num, atom_name, element, pos in cdp.structure.atom_loop(atom_id=spin_id, str_id=str_id, model_num_flag=True, mol_name_flag=True, res_num_flag=True, res_name_flag=True, atom_num_flag=True, atom_name_flag=True, element_flag=True, pos_flag=True, ave=ave_pos): + # Update the model info. if last_model != model_num: model_index = model_index + 1 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=13234&r1=13233&r2=13234&view=diff ============================================================================== --- branches/xyz/test_suite/system_tests/structure.py (original) +++ branches/xyz/test_suite/system_tests/structure.py Mon Jun 27 15:10:31 2011 @@ -656,7 +656,7 @@ path = status.install_path + sep+'test_suite'+sep+'shared_data'+sep+'structures' # Read the xyz. - self.interpreter.structure.read_xyz(file='SSS-cluster4-new-test.xyz', dir=path, read_model=[1,3]) + self.interpreter.structure.read_xyz(file='SSS-cluster4-new-test.xyz', dir=path, read_model=[1]) # Test the molecule name. self.assertEqual(cdp.structure.structural_data[0].mol[0].mol_name, 'SSS-cluster4-new-test_mol1') @@ -665,6 +665,20 @@ self.interpreter.structure.load_spins('#SSS-cluster4-new-test_mol1@2') self.assertEqual(count_spins(), 1) + # Test the spin coordinates. + mol = cdp.structure.structural_data[0].mol[0] + last_spin_x=[] + last_spin_y=[] + last_spin_z=[] + for i in xrange(len(mol.atom_num)): + last_spin_x.append(mol.x[i]) + last_spin_y.append(mol.y[i]) + last_spin_z.append(mol.z[i]) + + self.assertEqual(last_spin_x[160], -9.947) + self.assertEqual(last_spin_y[160], -6.062) + self.assertEqual(last_spin_z[160], 11.682) + # Try loading a few protons. #self.interpreter.structure.load_spins('@H')