Package test_suite :: Package system_tests :: Module rdc
[hide private]
[frames] | no frames]

Source Code for Module test_suite.system_tests.rdc

 1  ############################################################################### 
 2  #                                                                             # 
 3  # Copyright (C) 2011-2012 Edward d'Auvergne                                   # 
 4  #                                                                             # 
 5  # This file is part of the program relax (http://www.nmr-relax.com).          # 
 6  #                                                                             # 
 7  # This program is free software: you can redistribute it and/or modify        # 
 8  # it under the terms of the GNU General Public License as published by        # 
 9  # the Free Software Foundation, either version 3 of the License, or           # 
10  # (at your option) any later version.                                         # 
11  #                                                                             # 
12  # This program is distributed in the hope that it will be useful,             # 
13  # but WITHOUT ANY WARRANTY; without even the implied warranty of              # 
14  # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the               # 
15  # GNU General Public License for more details.                                # 
16  #                                                                             # 
17  # You should have received a copy of the GNU General Public License           # 
18  # along with this program.  If not, see <http://www.gnu.org/licenses/>.       # 
19  #                                                                             # 
20  ############################################################################### 
21   
22  # Module docstring. 
23  """RDC-based system tests.""" 
24   
25   
26  # Python module imports. 
27  from os import sep 
28   
29  # relax module imports. 
30  from generic_fns.interatomic import interatomic_loop 
31  from generic_fns.mol_res_spin import count_spins 
32  from status import Status; status = Status() 
33  from test_suite.system_tests.base_classes import SystemTestCase 
34   
35   
36 -class Rdc(SystemTestCase):
37 """Class for testing RDC operations.""" 38
39 - def test_rdc_load(self):
40 """Test for the loading of some RDC data with the spin ID format.""" 41 42 # Create a data pipe. 43 self.interpreter.pipe.create('test', 'N-state') 44 45 # Data directory. 46 dir = status.install_path + sep+'test_suite'+sep+'shared_data'+sep+'align_data'+sep 47 48 # Load the spins. 49 self.interpreter.sequence.read(file='tb.txt', dir=dir, spin_id_col=1) 50 self.interpreter.sequence.attach_protons() 51 self.interpreter.sequence.display() 52 53 # Load the RDCs. 54 self.interpreter.rdc.read(align_id='tb', file='tb.txt', dir=dir, spin_id1_col=1, spin_id2_col=2, data_col=3, error_col=4) 55 self.interpreter.sequence.display() 56 57 # The RDCs. 58 rdcs = [ -26.2501958629, 9.93081766942, 7.26317614156, -1.24840526981, 5.31803314334, 14.0362909456, 1.33652530397, -1.6021670281] 59 60 # Checks. 61 self.assertEqual(count_spins(), 16) 62 self.assertEqual(len(cdp.interatomic), 8) 63 i = 0 64 for interatom in interatomic_loop(): 65 self.assertAlmostEqual(rdcs[i], interatom.rdc['tb']) 66 i += 1
67