Author: bugman Date: Thu Feb 18 18:04:59 2010 New Revision: 10750 URL: http://svn.gna.org/viewcvs/relax?rev=10750&view=rev Log: Enabled the relative stereochemistry analysis system test. Modified: 1.3/test_suite/system_tests/n_state_model.py 1.3/test_suite/system_tests/scripts/n_state_model/stereochem_analysis.py Modified: 1.3/test_suite/system_tests/n_state_model.py URL: http://svn.gna.org/viewcvs/relax/1.3/test_suite/system_tests/n_state_model.py?rev=10750&r1=10749&r2=10750&view=diff ============================================================================== --- 1.3/test_suite/system_tests/n_state_model.py (original) +++ 1.3/test_suite/system_tests/n_state_model.py Thu Feb 18 18:04:59 2010 @@ -24,6 +24,8 @@ from math import pi, sqrt from os import sep import sys +from shutil import rmtree +from tempfile import mkdtemp # relax module imports. from base_classes import SystemTestCase @@ -36,6 +38,11 @@ def tearDown(self): """Reset the relax data storage object.""" + # Remove the temporary directory. + if hasattr(ds, 'tmpdir'): + rmtree(ds.tmpdir) + + # Reset the relax data storage object. ds.__reset__() @@ -217,3 +224,13 @@ # Execute the script. self.interpreter.run(script_file=sys.path[-1] + sep+'test_suite'+sep+'system_tests'+sep+'scripts'+sep+'n_state_model'+sep+'lactose_n_state.py') + + + def test_stereochem_analysis(self): + """The full relative stereochemistry analysis.""" + + # Create a temporary directory for all result files. + ds.tmpdir = mkdtemp() + + # Execute the script. + self.interpreter.run(script_file=sys.path[-1] + sep+'test_suite'+sep+'system_tests'+sep+'scripts'+sep+'n_state_model'+sep+'stereochem_analysis.py') Modified: 1.3/test_suite/system_tests/scripts/n_state_model/stereochem_analysis.py URL: http://svn.gna.org/viewcvs/relax/1.3/test_suite/system_tests/scripts/n_state_model/stereochem_analysis.py?rev=10750&r1=10749&r2=10750&view=diff ============================================================================== --- 1.3/test_suite/system_tests/scripts/n_state_model/stereochem_analysis.py (original) +++ 1.3/test_suite/system_tests/scripts/n_state_model/stereochem_analysis.py Thu Feb 18 18:04:59 2010 @@ -46,11 +46,17 @@ # Python module imports. from os import rename, sep -from tempfile import mkdtemp +import sys # relax module imports. from auto_analyses.stereochem_analysis import Stereochem_analysis +from data import Relax_data_store; ds = Relax_data_store() + + +# Missing temp directory (allow this script to run outside of the system test framework). +if not hasattr(ds, 'tmpdir'): + ds.tmpdir = 'temp_script' # Path of the data files. path = sys.path[-1] + sep + 'test_suite' + sep + 'shared_data' @@ -111,13 +117,10 @@ LOWER_LIM_RDC = 0.0 UPPER_LIM_RDC = 1.0 -# Results directory. -RESULTS_DIR = mkdtemp() - # Set up and code execution. analysis = Stereochem_analysis( stage=1, - results_dir=RESULTS_DIR, + results_dir=ds.tmpdir, num_ens=NUM_ENS, num_models=NUM_MODELS, configs=CONFIGS, @@ -146,15 +149,14 @@ ) # Execute all stages. -try: - for i in range(1, 6): - # Set the stage. - print "\n\n\nStage %i\n\n" % i - analysis.stage = i +for i in range(1, 6): + # Set the stage. + print "\n\n\nStage %i\n\n" % i + analysis.stage = i - # Execute the stage. - if i != 3: - analysis.run() - else: - print("Renaming '%s' to '%s'." % (RESULTS_DIR+sep+'ensembles', RESULTS_DIR+sep+'ensembles_superimposed')) - rename(RESULTS_DIR+sep+'ensembles', RESULTS_DIR+sep+'ensembles_superimposed') + # Execute the stage. + if i != 3: + analysis.run() + else: + print("Renaming '%s' to '%s'." % (RESULTS_DIR+sep+'ensembles', RESULTS_DIR+sep+'ensembles_superimposed')) + rename(RESULTS_DIR+sep+'ensembles', RESULTS_DIR+sep+'ensembles_superimposed')