Author: bugman Date: Fri May 25 18:02:25 2012 New Revision: 16458 URL: http://svn.gna.org/viewcvs/relax?rev=16458&view=rev Log: Shifted out the interpreter components of the J(w) mapping tests into scripts. This allows the tests to work in the GUI test framework. Added: branches/uf_redesign/test_suite/system_tests/scripts/jw_mapping_calc_test.py branches/uf_redesign/test_suite/system_tests/scripts/jw_mapping_set_value.py Modified: branches/uf_redesign/test_suite/system_tests/jw_mapping.py Modified: branches/uf_redesign/test_suite/system_tests/jw_mapping.py URL: http://svn.gna.org/viewcvs/relax/branches/uf_redesign/test_suite/system_tests/jw_mapping.py?rev=16458&r1=16457&r2=16458&view=diff ============================================================================== --- branches/uf_redesign/test_suite/system_tests/jw_mapping.py (original) +++ branches/uf_redesign/test_suite/system_tests/jw_mapping.py Fri May 25 18:02:25 2012 @@ -47,38 +47,13 @@ def test_calc(self): """The spectral density calculation test.""" - # Data directory. - dir = status.install_path + sep+'test_suite'+sep+'shared_data'+sep+'jw_mapping'+sep - - # The data. - ri_ids = ['NOE_600', 'R1_600', 'R2_600'] - ri_type = ['NOE', 'R1', 'R2'] - frq = [600e6]*3 - data_paths = [dir + 'noe.dat', dir + 'R1.dat', dir + 'R2.dat'] + # Execute the script. + self.script_exec(status.install_path + sep+'test_suite'+sep+'system_tests'+sep+'scripts'+sep+'jw_mapping_calc_test.py') # Correct jw values: j0 = [4.0703318681008998e-09, 3.7739393907014834e-09] jwx = [1.8456254300773903e-10, 1.6347516082378241e-10] jwh = [1.5598167512718012e-12, 2.9480536599037041e-12] - - # Read the sequence. - self.interpreter.sequence.read(file='test_seq', dir=status.install_path + sep+'test_suite'+sep+'shared_data', res_num_col=1, res_name_col=2) - - # Read the data. - for i in xrange(len(ri_ids)): - self.interpreter.relax_data.read(ri_id=ri_ids[i], ri_type=ri_type[i], frq=frq[i], file=data_paths[i], res_num_col=1, res_name_col=2, data_col=3, error_col=4) - - # Set r, csa, heteronucleus type, and proton type. - self.interpreter.value.set(NH_BOND_LENGTH, 'r') - self.interpreter.value.set(N15_CSA, 'csa') - self.interpreter.value.set('15N', 'heteronuc_type') - self.interpreter.value.set('1H', 'proton_type') - - # Select the frequency. - self.interpreter.jw_mapping.set_frq(frq=600.0 * 1e6) - - # Try the reduced spectral density mapping. - self.interpreter.calc() # Loop over residues. index = 0 @@ -99,14 +74,8 @@ def test_set_value(self): """The user function value.set().""" - # Read the sequence. - self.interpreter.sequence.read(file='test_seq', dir=status.install_path + sep+'test_suite'+sep+'shared_data', res_num_col=1, res_name_col=2) - - # Try to set the values. - bond_length = NH_BOND_LENGTH - csa = N15_CSA - self.interpreter.value.set(bond_length, 'r') - self.interpreter.value.set(csa, 'csa') + # Execute the script. + self.script_exec(status.install_path + sep+'test_suite'+sep+'system_tests'+sep+'scripts'+sep+'jw_mapping_set_value.py') # Loop over residues. for res in residue_loop(): Added: branches/uf_redesign/test_suite/system_tests/scripts/jw_mapping_calc_test.py URL: http://svn.gna.org/viewcvs/relax/branches/uf_redesign/test_suite/system_tests/scripts/jw_mapping_calc_test.py?rev=16458&view=auto ============================================================================== --- branches/uf_redesign/test_suite/system_tests/scripts/jw_mapping_calc_test.py (added) +++ branches/uf_redesign/test_suite/system_tests/scripts/jw_mapping_calc_test.py Fri May 25 18:02:25 2012 @@ -1,0 +1,37 @@ +"""Script for testing J(w) mapping.""" + +# Python module imports. +from os import sep + +# relax module imports. +from physical_constants import N15_CSA, NH_BOND_LENGTH +from status import Status; status = Status() + + +# Data directory. +dir = status.install_path + sep+'test_suite'+sep+'shared_data'+sep+'jw_mapping'+sep + +# The data. +ri_ids = ['NOE_600', 'R1_600', 'R2_600'] +ri_type = ['NOE', 'R1', 'R2'] +frq = [600e6]*3 +data_paths = [dir + 'noe.dat', dir + 'R1.dat', dir + 'R2.dat'] + +# Read the sequence. +self._execute_uf(uf_name='sequence.read', file='test_seq', dir=status.install_path + sep+'test_suite'+sep+'shared_data', res_num_col=1, res_name_col=2) + +# Read the data. +for i in xrange(len(ri_ids)): + self._execute_uf(uf_name='relax_data.read', ri_id=ri_ids[i], ri_type=ri_type[i], frq=frq[i], file=data_paths[i], res_num_col=1, res_name_col=2, data_col=3, error_col=4) + +# Set r, csa, heteronucleus type, and proton type. +self._execute_uf(uf_name='value.set', val=NH_BOND_LENGTH, param='r') +self._execute_uf(uf_name='value.set', val=N15_CSA, param='csa') +self._execute_uf(uf_name='value.set', val='15N', param='heteronuc_type') +self._execute_uf(uf_name='value.set', val='1H', param='proton_type') + +# Select the frequency. +self._execute_uf(uf_name='jw_mapping.set_frq', frq=600.0 * 1e6) + +# Try the reduced spectral density mapping. +self._execute_uf(uf_name='calc') Added: branches/uf_redesign/test_suite/system_tests/scripts/jw_mapping_set_value.py URL: http://svn.gna.org/viewcvs/relax/branches/uf_redesign/test_suite/system_tests/scripts/jw_mapping_set_value.py?rev=16458&view=auto ============================================================================== --- branches/uf_redesign/test_suite/system_tests/scripts/jw_mapping_set_value.py (added) +++ branches/uf_redesign/test_suite/system_tests/scripts/jw_mapping_set_value.py Fri May 25 18:02:25 2012 @@ -1,0 +1,16 @@ +"""Script for testing the value.set() user function for J(w) mapping.""" + +# Python module imports. +from os import sep + +# relax module imports. +from physical_constants import N15_CSA, NH_BOND_LENGTH +from status import Status; status = Status() + + +# Read the sequence. +self._execute_uf(uf_name='sequence.read', file='test_seq', dir=status.install_path + sep+'test_suite'+sep+'shared_data', res_num_col=1, res_name_col=2) + +# Try to set the values. +self._execute_uf(uf_name='value.set', val=NH_BOND_LENGTH, param='r') +self._execute_uf(uf_name='value.set', val=N15_CSA, param='csa')