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

Source Code for Module test_suite.system_tests.jw_mapping

 1  ############################################################################### 
 2  #                                                                             # 
 3  # Copyright (C) 2006 Chris MacRaild                                           # 
 4  # Copyright (C) 2007-2013 Edward d'Auvergne                                   # 
 5  #                                                                             # 
 6  # This file is part of the program relax (http://www.nmr-relax.com).          # 
 7  #                                                                             # 
 8  # This program is free software: you can redistribute it and/or modify        # 
 9  # it under the terms of the GNU General Public License as published by        # 
10  # the Free Software Foundation, either version 3 of the License, or           # 
11  # (at your option) any later version.                                         # 
12  #                                                                             # 
13  # This program is distributed in the hope that it will be useful,             # 
14  # but WITHOUT ANY WARRANTY; without even the implied warranty of              # 
15  # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the               # 
16  # GNU General Public License for more details.                                # 
17  #                                                                             # 
18  # You should have received a copy of the GNU General Public License           # 
19  # along with this program.  If not, see <http://www.gnu.org/licenses/>.       # 
20  #                                                                             # 
21  ############################################################################### 
22   
23  # Python module imports. 
24  from os import sep 
25   
26  # relax module imports. 
27  from data_store import Relax_data_store; ds = Relax_data_store() 
28  from pipe_control.mol_res_spin import residue_loop 
29  from lib.physical_constants import N15_CSA 
30  from status import Status; status = Status() 
31  from test_suite.system_tests.base_classes import SystemTestCase 
32   
33   
34 -class Jw(SystemTestCase):
35 """Class for testing various aspects specific to reduced spectral density mapping.""" 36
37 - def setUp(self):
38 """Set up for all the functional tests.""" 39 40 # Create the data pipe. 41 self.interpreter.pipe.create('jw', 'jw')
42 43
45 """Catch U{bug #20674<https://web.archive.org/web/https://gna.org/bugs/?20674>}, but for the J(w) mapping analysis.""" 46 47 # Execute the script. 48 self.script_exec(status.install_path + sep+'test_suite'+sep+'system_tests'+sep+'scripts'+sep+'bug_20674_jw_mapping.py')
49 50
51 - def test_calc(self):
52 """The spectral density calculation test.""" 53 54 # Execute the script. 55 self.script_exec(status.install_path + sep+'test_suite'+sep+'system_tests'+sep+'scripts'+sep+'jw_mapping_calc_test.py') 56 57 # Correct jw values. 58 j0 = [4.0703318681008998e-09, 3.7739393907014834e-09] 59 jwx = [1.8456254300773903e-10, 1.6347516082378241e-10] 60 jwh = [1.5598167512718012e-12, 2.9480536599037041e-12] 61 62 # Loop over residues. 63 index = 0 64 for res in residue_loop(): 65 # Residues -2 and -1 have data. 66 if res.num == -2 or res.num == -1: 67 self.assert_(res.spin[0].select) 68 self.assertAlmostEqual(res.spin[0].j0 * 1e9, j0[index] * 1e9) 69 self.assertAlmostEqual(res.spin[0].jwh * 1e10, jwh[index] * 1e10) 70 self.assertAlmostEqual(res.spin[0].jwx * 1e12, jwx[index] * 1e12) 71 index = index + 1 72 73 # Other residues have insufficient data. 74 else: 75 self.assert_(not res.spin[0].select)
76 77
78 - def test_set_value(self):
79 """The user function value.set().""" 80 81 # Execute the script. 82 self.script_exec(status.install_path + sep+'test_suite'+sep+'system_tests'+sep+'scripts'+sep+'jw_mapping_set_value.py') 83 84 # Loop over residues. 85 for res in residue_loop(): 86 self.assertAlmostEqual(res.spin[0].csa, N15_CSA)
87 88
89 - def test_mapping(self):
90 """Test a complete jw mapping run using a script.""" 91 92 # Execute the script. 93 self.script_exec(status.install_path + sep+'test_suite'+sep+'system_tests'+sep+'scripts'+sep+'jw_mapping.py')
94