Author: bugman Date: Wed Nov 14 17:21:07 2012 New Revision: 17970 URL: http://svn.gna.org/viewcvs/relax?rev=17970&view=rev Log: Created the N_state_model.test_data_copying system test for the rdc.copy and pcs.copy user functions. These user functions do not exist yet, but this test will be used to implement them. Added: trunk/test_suite/system_tests/scripts/n_state_model/data_copying.py - copied, changed from r17959, trunk/test_suite/system_tests/scripts/n_state_model/populations.py Modified: trunk/test_suite/system_tests/n_state_model.py Modified: trunk/test_suite/system_tests/n_state_model.py URL: http://svn.gna.org/viewcvs/relax/trunk/test_suite/system_tests/n_state_model.py?rev=17970&r1=17969&r2=17970&view=diff ============================================================================== --- trunk/test_suite/system_tests/n_state_model.py (original) +++ trunk/test_suite/system_tests/n_state_model.py Wed Nov 14 17:21:07 2012 @@ -31,6 +31,7 @@ from generic_fns.align_tensor import calc_chi_tensor from generic_fns.interatomic import interatomic_loop, return_interatom from generic_fns.mol_res_spin import return_spin, spin_loop +from generic_fns.pipes import get_pipe from status import Status; status = Status() from test_suite.system_tests.base_classes import SystemTestCase @@ -379,6 +380,22 @@ self.assertAlmostEqual(cdp.q_rdc_norm2, 0.14049691097282743) # Pales (Q RDC_RMS): 0.141 + def test_data_copying(self): + """The copying of RDC and PCS data from one pipe to another.""" + + # Execute the script. + self.script_exec(status.install_path + sep+'test_suite'+sep+'system_tests'+sep+'scripts'+sep+'n_state_model'+sep+'data_copying.py') + + # Get the data pipes. + orig = get_pipe('orig') + new = get_pipe('new') + + # Check the data. + self.assertEqual(orig.rdc_ids, new.rdc_ids) + self.assertEqual(orig.pcs_ids, new.pcs_ids) + self.assertEqual(orig.align_ids, new.align_ids) + + def test_lactose_n_state_fixed(self): """The 4-state model analysis of lactose using RDCs and PCSs.""" Copied: trunk/test_suite/system_tests/scripts/n_state_model/data_copying.py (from r17959, trunk/test_suite/system_tests/scripts/n_state_model/populations.py) URL: http://svn.gna.org/viewcvs/relax/trunk/test_suite/system_tests/scripts/n_state_model/data_copying.py?p2=trunk/test_suite/system_tests/scripts/n_state_model/data_copying.py&p1=trunk/test_suite/system_tests/scripts/n_state_model/populations.py&r1=17959&r2=17970&rev=17970&view=diff ============================================================================== --- trunk/test_suite/system_tests/scripts/n_state_model/populations.py (original) +++ trunk/test_suite/system_tests/scripts/n_state_model/data_copying.py Wed Nov 14 17:21:07 2012 @@ -13,7 +13,7 @@ data_path = status.install_path + sep+'test_suite'+sep+'shared_data'+sep+'align_data'+sep+'population_model' # Create the data pipe. -self._execute_uf(uf_name='pipe.create', pipe_name='populations', pipe_type='N-state') +self._execute_uf(uf_name='pipe.create', pipe_name='orig', pipe_type='N-state') # Load the structures. NUM_STR = 3 @@ -32,14 +32,14 @@ self._execute_uf(uf_name='deselect.spin', spin_id=':UNK@H17') self._execute_uf(uf_name='deselect.spin', spin_id=':UNK@H18') -# Define the magnetic dipole-dipole relaxation interaction. -self._execute_uf(uf_name='dipole_pair.define', spin_id1='@C*', spin_id2='@H*', direct_bond=True) -self._execute_uf(uf_name='dipole_pair.set_dist', spin_id1='@C*', spin_id2='@H*', ave_dist=1.10 * 1e-10) -self._execute_uf(uf_name='dipole_pair.unit_vectors', ave=False) - -# Set the nuclear isotope type. -self._execute_uf(uf_name='spin.isotope', isotope='13C', spin_id='@C*') -self._execute_uf(uf_name='spin.isotope', isotope='1H', spin_id='@H*') +## Define the magnetic dipole-dipole relaxation interaction. +#self._execute_uf(uf_name='dipole_pair.define', spin_id1='@C*', spin_id2='@H*', direct_bond=True) +#self._execute_uf(uf_name='dipole_pair.set_dist', spin_id1='@C*', spin_id2='@H*', ave_dist=1.10 * 1e-10) +#self._execute_uf(uf_name='dipole_pair.unit_vectors', ave=False) +# +## Set the nuclear isotope type. +#self._execute_uf(uf_name='spin.isotope', isotope='13C', spin_id='@C*') +#self._execute_uf(uf_name='spin.isotope', isotope='1H', spin_id='@H*') # File list. align_list = ['Dy', 'Tb', 'Tm', 'Er'] @@ -59,39 +59,9 @@ # The frequency. self._execute_uf(uf_name='frq.set', id=align_list[i], frq=799.75376122 * 1e6) -# Set the paramagnetic centre. -self._execute_uf(uf_name='paramag.centre', pos=[ -14.845, 0.969, 0.265]) +# Create a new data pipe. +self._execute_uf(uf_name='pipe.create', pipe_name='new', pipe_type='N-state') - -# The solution. -############### - -# Set up the model. -self._execute_uf(uf_name='n_state_model.select_model', model='population') - -# Set pc to the exact values. -self._execute_uf(uf_name='value.set', val=0.3, param='p0') -self._execute_uf(uf_name='value.set', val=0.1, param='p2') -self._execute_uf(uf_name='value.set', val=0.6, param='p1') - -# Set the tensors. -self._execute_uf(uf_name='align_tensor.init', tensor=align_list[0], params=( 1.42219822168827662867e-04, -1.44543001566521341940e-04, -7.07796211648713973798e-04, -6.01619494082773244303e-04, 2.02008007072950861996e-04), param_types=2) -self._execute_uf(uf_name='align_tensor.init', tensor=align_list[1], params=( 3.56720663040924505435e-04, -2.68385787902088840916e-04, -1.69361406642305853832e-04, 1.71873715515064501074e-04, -3.05790155096090983822e-04), param_types=2) -self._execute_uf(uf_name='align_tensor.init', tensor=align_list[2], params=( 2.32088908680377300801e-07, 2.08076808579168379617e-06, -2.21735465435989729223e-06, -3.74311563209448033818e-06, -2.40784858070560310370e-06), param_types=2) -self._execute_uf(uf_name='align_tensor.init', tensor=align_list[3], params=(-2.62495279588228071048e-04, 7.35617367964106275147e-04, 6.39754192258981332648e-05, 6.27880171180572523460e-05, 2.01197582457700226708e-04), param_types=2) - -# Calculation. -self._execute_uf(uf_name='calc') -print("Chi2: %s" % cdp.chi2) -if abs(cdp.chi2) > 1e-15: - raise RelaxError("The chi2 at the solution is not zero!") - - -# The population model opt. -########################### - -# Minimisation. -self._execute_uf(uf_name='minimise', min_algor='sd', func_tol=1e-2) - -# Write out a results file. -self._execute_uf(uf_name='results.write', file='devnull', force=True) +# Copy the data. +self._execute_uf(uf_name='rdc.copy', pipe_from='orig', pipe_to='new') +self._execute_uf(uf_name='pcs.copy', pipe_from='orig', pipe_to='new')