Author: bugman Date: Fri Feb 18 14:37:50 2011 New Revision: 12560 URL: http://svn.gna.org/viewcvs/relax?rev=12560&view=rev Log: Added a system test for the reading of a PDC NOE file. Modified: 1.3/test_suite/system_tests/pdc.py Modified: 1.3/test_suite/system_tests/pdc.py URL: http://svn.gna.org/viewcvs/relax/1.3/test_suite/system_tests/pdc.py?rev=12560&r1=12559&r2=12560&view=diff ============================================================================== --- 1.3/test_suite/system_tests/pdc.py (original) +++ 1.3/test_suite/system_tests/pdc.py Fri Feb 18 14:37:50 2011 @@ -46,6 +46,40 @@ ds.__reset__() + def test_pdc_read_noe(self): + """Test the reading of a PDC NOE file.""" + + # Read the sequence data. + self.interpreter.sequence.read(file="seq", dir=status.install_path + sep+'test_suite'+sep+'shared_data'+sep+'pdc_files', res_num_col=2, res_name_col=1) + + # Read the PDC file. + self.interpreter.pdc.read(file="testNOE.txt", dir=status.install_path + sep+'test_suite'+sep+'shared_data'+sep+'pdc_files') + + # Check the data pipe structures. + self.assertEqual(cdp.frq[0], 600.13) + self.assertEqual(cdp.frq_labels[0], '600') + self.assertEqual(cdp.ri_labels[0], 'NOE') + self.assertEqual(cdp.remap_table[0], 0) + self.assertEqual(cdp.noe_r1_table[0], None) + self.assertEqual(cdp.num_frq, 1) + self.assertEqual(cdp.num_ri, 1) + + # The NOE values and errors. + noe = [0.00027, 0.00029999999999999997, 0.00032000000000000003, 0.00029, 0.00029, 0.00027, 0.00032000000000000003, 0.00031, 0.00019000000000000001, 0.00022000000000000001, 0.00022000000000000001, 0.00033, 0.00025000000000000001, 0.00031, 0.00019000000000000001, 0.00027999999999999998, 0.00025000000000000001, 0.00025999999999999998, 0.00020000000000000001, 0.00029, 0.00038999999999999999, 0.00035, 0.00016000000000000001, 0.00036000000000000002, 0.00034000000000000002, 0.00040000000000000002, 0.00029999999999999997, 0.00022000000000000001, 0.00027999999999999998, 0.00031, 0.00025999999999999998, 0.00025000000000000001, 0.00025999999999999998, 0.00027, 0.00029, 0.00033, 0.00034000000000000002, 0.00036999999999999999, 0.00038000000000000002, 0.00038999999999999999, 0.00055000000000000003, 0.00029, 0.00029999999999999997, 0.00025000000000000001, 0.00040999999999999999, 0.00038000000000000002, 0.00033, 0.00038000000000000002, 0.00034000000000000002, 0.00033, 0.00027999999999999998, 0.00027999999999999998, 0.00027999999999999998, 0.00024000000000000001, 0.00036000000000000002, 0.00029, 0.00027, 0.00034000000000000002, 0.00029, 0.00024000000000000001, 0.00033, 0.00040000000000000002, 0.00027, 0.00038000000000000002, 0.00027, 0.00021000000000000001, 0.00017000000000000001, 0.00020000000000000001, 0.00027999999999999998, 0.00032000000000000003] + + noe_err = [0.00027, 0.00029999999999999997, 0.00032000000000000003, 0.00029, 0.00029, 0.00027, 0.00032000000000000003, 0.00031, 0.00019000000000000001, 0.00022000000000000001, 0.00022000000000000001, 0.00033, 0.00025000000000000001, 0.00031, 0.00019000000000000001, 0.00027999999999999998, 0.00025000000000000001, 0.00025999999999999998, 0.00020000000000000001, 0.00029, 0.00038999999999999999, 0.00035, 0.00016000000000000001, 0.00036000000000000002, 0.00034000000000000002, 0.00040000000000000002, 0.00029999999999999997, 0.00022000000000000001, 0.00027999999999999998, 0.00031, 0.00025999999999999998, 0.00025000000000000001, 0.00025999999999999998, 0.00027, 0.00029, 0.00033, 0.00034000000000000002, 0.00036999999999999999, 0.00038000000000000002, 0.00038999999999999999, 0.00055000000000000003, 0.00029, 0.00029999999999999997, 0.00025000000000000001, 0.00040999999999999999, 0.00038000000000000002, 0.00033, 0.00038000000000000002, 0.00034000000000000002, 0.00033, 0.00027999999999999998, 0.00027999999999999998, 0.00027999999999999998, 0.00024000000000000001, 0.00036000000000000002, 0.00029, 0.00027, 0.00034000000000000002, 0.00029, 0.00024000000000000001, 0.00033, 0.00040000000000000002, 0.00027, 0.00038000000000000002, 0.00027, 0.00021000000000000001, 0.00017000000000000001, 0.00020000000000000001, 0.00027999999999999998, 0.00032000000000000003] + + # Loop over the spins. + i = 0 + for spin in spin_loop(): + # Check the R1 value and error. + self.assertAlmostEqual(spin.relax_data[0], noe[i]) + self.assertAlmostEqual(spin.relax_error[0], noe_err[i]) + + # Increment the data index. + i += 1 + + def test_pdc_read_r1(self): """Test the reading of a PDC R1 file."""