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

Source Code for Module test_suite.system_tests.relax_data

  1  ############################################################################### 
  2  #                                                                             # 
  3  # Copyright (C) 2011 Edward d'Auvergne                                        # 
  4  #                                                                             # 
  5  # This file is part of the program relax.                                     # 
  6  #                                                                             # 
  7  # relax 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 2 of the License, or           # 
 10  # (at your option) any later version.                                         # 
 11  #                                                                             # 
 12  # relax 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 relax; if not, write to the Free Software                        # 
 19  # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA   # 
 20  #                                                                             # 
 21  ############################################################################### 
 22   
 23  # Python module imports. 
 24  from os import sep 
 25   
 26  # relax module imports. 
 27  from base_classes import SystemTestCase 
 28  from data import Relax_data_store; ds = Relax_data_store() 
 29  from generic_fns.mol_res_spin import spin_loop 
 30  from status import Status; status = Status() 
 31   
 32   
33 -class Relax_data(SystemTestCase):
34 """Class for testing various aspects specific to relaxation data back calculation.""" 35
36 - def test_back_calc(self):
37 """Test the back calculation of relaxation data from model-free results.""" 38 39 # Load the original state. 40 self.interpreter.state.load(state='sphere_trunc', dir=status.install_path + sep+'test_suite'+sep+'shared_data'+sep+'model_free'+sep+'bug_14941_local_tm_global_selection') 41 42 # Back calculate the relaxation data. 43 self.interpreter.relax_data.back_calc() 44 45 # The actual data. 46 ri_data_bc = [{'R2_600': 4.7159538829340821, 'R1_500': 2.4779663389365068, 'NOE_500': 0.51989421750722165, 'R2_500': 4.3440970032224548, 'R1_600': 2.2831801922968129, 'NOE_600': 0.63592506242171432}, 47 {'R2_600': 4.7211287713315739, 'R1_500': 2.5267468751446214, 'NOE_500': 0.57703969243842634, 'R2_500': 4.6185111669453738, 'R1_600': 2.2320234021052801, 'NOE_600': 0.66505178335932991}] 48 49 # Loop over the spins. 50 index = 0 51 for spin in spin_loop(): 52 # Check the back calculated data. 53 self.assertEqual(spin.ri_data_bc, ri_data_bc[index]) 54 55 # Increment. 56 index += 1
57 58
59 - def test_back_calc_specific(self):
60 """Test the back calculation of specific relaxation data from model-free results.""" 61 62 # Load the original state. 63 self.interpreter.state.load(state='sphere_trunc', dir=status.install_path + sep+'test_suite'+sep+'shared_data'+sep+'model_free'+sep+'bug_14941_local_tm_global_selection') 64 65 # Back calculate the relaxation data. 66 self.interpreter.relax_data.back_calc('NOE_500') 67 68 # The actual data. 69 ri_data_bc = [{'NOE_500': 0.51989421750722165}, 70 {'NOE_500': 0.57703969243842634}] 71 72 # Loop over the spins. 73 index = 0 74 for spin in spin_loop(): 75 # Check the back calculated data. 76 self.assertEqual(spin.ri_data_bc, ri_data_bc[index]) 77 78 # Increment. 79 index += 1
80 81
82 - def test_back_calc_new(self):
83 """Test the back calculation of new relaxation data from model-free results.""" 84 85 # Load the original state. 86 self.interpreter.state.load(state='sphere_trunc', dir=status.install_path + sep+'test_suite'+sep+'shared_data'+sep+'model_free'+sep+'bug_14941_local_tm_global_selection') 87 88 # Back calculate the relaxation data. 89 self.interpreter.relax_data.back_calc('NOE_500.001', ri_type='NOE', frq=500.001e6) 90 91 # The actual data. 92 ri_data_bc = [{'NOE_500.001': 0.52064607759431081}, 93 {'NOE_500.001': 0.57759452179767434}] 94 95 # Loop over the spins. 96 index = 0 97 for spin in spin_loop(): 98 # Check the back calculated data. 99 self.assertEqual(spin.ri_data_bc, ri_data_bc[index]) 100 101 # Increment. 102 index += 1
103