Author: bugman Date: Sun Dec 1 20:56:43 2013 New Revision: 21727 URL: http://svn.gna.org/viewcvs/relax?rev=21727&view=rev Log: Created the Relax_disp.test_ns_mmq_3site_branched system test. This is for the 'NS MMQ 3-site (branched)' CPMG dispersion model. This follows the tutorial for adding relaxation dispersion models at: http://wiki.nmr-relax.com/Tutorial_for_adding_relaxation_dispersion_models_to_relax#The_test_suite Added: trunk/test_suite/system_tests/scripts/relax_disp/ns_mmq_3site_branched.py - copied, changed from r21726, trunk/test_suite/shared_data/dispersion/ns_mmq_3site_branched/relax_results/solution.py Modified: trunk/test_suite/system_tests/relax_disp.py Modified: trunk/test_suite/system_tests/relax_disp.py URL: http://svn.gna.org/viewcvs/relax/trunk/test_suite/system_tests/relax_disp.py?rev=21727&r1=21726&r2=21727&view=diff ============================================================================== --- trunk/test_suite/system_tests/relax_disp.py (original) +++ trunk/test_suite/system_tests/relax_disp.py Sun Dec 1 20:56:43 2013 @@ -2417,6 +2417,16 @@ spin_index += 1 + def test_ns_mmq_3site_branched(self): + """Compare the 'NS MMQ 3-site (branched)' dispersion model to synthetic data from cpmg_fit.""" + + # Execute the script. + self.interpreter.run(script_file=status.install_path + sep+'test_suite'+sep+'system_tests'+sep+'scripts'+sep+'relax_disp'+sep+'ns_mmq_3site_branched.py') + + # Check the chi-squared value. + self.assertAlmostEqual(cdp.mol[0].res[0].spin[0].chi2, 0.0, 5) + + def test_r2eff_read(self): """Test the operation of the relax_disp.r2eff_read user function.""" Copied: trunk/test_suite/system_tests/scripts/relax_disp/ns_mmq_3site_branched.py (from r21726, trunk/test_suite/shared_data/dispersion/ns_mmq_3site_branched/relax_results/solution.py) URL: http://svn.gna.org/viewcvs/relax/trunk/test_suite/system_tests/scripts/relax_disp/ns_mmq_3site_branched.py?p2=trunk/test_suite/system_tests/scripts/relax_disp/ns_mmq_3site_branched.py&p1=trunk/test_suite/shared_data/dispersion/ns_mmq_3site_branched/relax_results/solution.py&r1=21726&r2=21727&rev=21727&view=diff ============================================================================== --- trunk/test_suite/shared_data/dispersion/ns_mmq_3site_branched/relax_results/solution.py (original) +++ trunk/test_suite/system_tests/scripts/relax_disp/ns_mmq_3site_branched.py Sun Dec 1 20:56:43 2013 @@ -1,17 +1,16 @@ -"""Compare the synthetic cpmg_fit data to the relax solution. - -To run this, type: - -$ rm -f solution.log; ../../../../../relax --tee solution.log solution.py -""" +"""Compare the synthetic cpmg_fit data to the relax solution.""" # Python module imports. -from os import remove -from shutil import move +from os import sep # relax module imports. from specific_analyses.relax_disp.disp_data import generate_r20_key from specific_analyses.relax_disp.variables import EXP_TYPE_CPMG_DQ, EXP_TYPE_CPMG_MQ, EXP_TYPE_CPMG_PROTON_MQ, EXP_TYPE_CPMG_PROTON_SQ, EXP_TYPE_CPMG_SQ, EXP_TYPE_CPMG_ZQ +from status import Status; status = Status() + + +# The path to the data files. +DATA_PATH = status.install_path + sep+'test_suite'+sep+'shared_data'+sep+'dispersion'+sep+'ns_mmq_3site_branched' # Create a data pipe. @@ -108,7 +107,7 @@ relax_disp.cpmg_frq(spectrum_id=new_id, cpmg_frq=cpmg_frq) # Read the R2eff data. - relax_disp.r2eff_read_spin(id=id, file=file, dir='..', spin_id=spin_id, disp_point_col=7, data_col=10, error_col=9) + relax_disp.r2eff_read_spin(id=id, file=file, dir=DATA_PATH, spin_id=spin_id, disp_point_col=7, data_col=10, error_col=9) # Change the model. relax_disp.select_model('NS MMQ 3-site') @@ -184,13 +183,7 @@ calc() # Plot the dispersion curves. -relax_disp.plot_disp_curves(dir='.', num_points=100, extend=0, force=True) +relax_disp.plot_disp_curves(dir=ds.tmpdir, num_points=100, extend=0, force=True) # Save the results. -state.save('cpmg_fit_solution', dir='.', compress_type=1, force=True) - -# Cleanup. -print("\n\nMoving 'disp_9_N.agr' to 'cpmg_fit_solution.agr'.") -move('disp_9_N.agr', 'cpmg_fit_solution.agr') -print("Deleting 'grace2images.py'.") -remove('grace2images.py') +state.save('state', dir=ds.tmpdir, compress_type=1, force=True)