mailr8914 - in /branches/bmrb/test_suite/system_tests: bmrb.py scripts/bmrb_rw.py


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by edward on March 06, 2009 - 11:51:
Author: bugman
Date: Fri Mar  6 11:51:53 2009
New Revision: 8914

URL: http://svn.gna.org/viewcvs/relax?rev=8914&view=rev
Log:
Shifted the BMRB reading and writing test into a script and significantly 
extended it.


Added:
    branches/bmrb/test_suite/system_tests/scripts/bmrb_rw.py
Modified:
    branches/bmrb/test_suite/system_tests/bmrb.py

Modified: branches/bmrb/test_suite/system_tests/bmrb.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/bmrb/test_suite/system_tests/bmrb.py?rev=8914&r1=8913&r2=8914&view=diff
==============================================================================
--- branches/bmrb/test_suite/system_tests/bmrb.py (original)
+++ branches/bmrb/test_suite/system_tests/bmrb.py Fri Mar  6 11:51:53 2009
@@ -37,7 +37,7 @@
         """Common set up for these system tests."""
 
         # Create a temporary file name.
-        self.tmpfile = mktemp()
+        ds.tmpfile = mktemp()
 
 
     def tearDown(self):
@@ -48,7 +48,7 @@
 
         # Delete the temporary file.
         try:
-            remove(self.tmpfile)
+            remove(ds.tmpfile)
         except OSError:
             pass
 
@@ -56,21 +56,5 @@
     def test_rw_bmrb_model_free(self):
         """Write and then read a BRMB STAR formatted file containing 
model-free results."""
 
-        # Path of the files.
-        path = sys.path[-1] + '/test_suite/shared_data/model_free/OMP'
-
-        # Read the relax results file.
-        self.relax.interpreter._Pipe.create('results', 'mf')
-        self.relax.interpreter._Results.read(file='final_results_trunc_1.3', 
dir=path)
-
-        # Write the BMRB STAR formatted file.
-        self.relax.interpreter._BMRB.write(file=self.tmpfile, dir=None, 
force=True)
-
-        # Create a new data pipe for reading the data back in.
-        self.relax.interpreter._Pipe.create('bmrb', 'mf')
-
-        # Read the BMRB STAR formatted file.
-        self.relax.interpreter._BMRB.read(file=self.tmpfile)
-
-        # Try displaying some of the relaxation data.
-        self.relax.interpreter._Relax_data.display('R1', '800')
+        # Execute the script.
+        self.relax.interpreter.run(script_file=sys.path[-1] + 
'/test_suite/system_tests/scripts/bmrb_rw.py')

Added: branches/bmrb/test_suite/system_tests/scripts/bmrb_rw.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/bmrb/test_suite/system_tests/scripts/bmrb_rw.py?rev=8914&view=auto
==============================================================================
--- branches/bmrb/test_suite/system_tests/scripts/bmrb_rw.py (added)
+++ branches/bmrb/test_suite/system_tests/scripts/bmrb_rw.py Fri Mar  6 
11:51:53 2009
@@ -1,0 +1,39 @@
+# Script for testing the reading and writing of BMRB files.
+
+# Python module imports.
+import sys
+
+# relax module imports.
+from data import Relax_data_store; ds = Relax_data_store()
+
+
+# Missing temp file (allow this script to run outside of the system test 
framework).
+if not hasattr(ds, 'tmpfile'):
+    ds.tmpfile = 'temp_bmrb'
+
+# Create the data pipe.
+pipe.create(pipe_name='results', pipe_type='mf')
+
+# Read the results.
+results.read(file='final_results_trunc_1.3', dir=sys.path[-1] + 
'/test_suite/shared_data/model_free/OMP')
+
+# Play with the data.
+deselect.all()
+spin.copy(spin_from=':9', spin_to=':9@NE')
+select.spin(':9')
+select.spin(':10')
+select.spin(':11')
+spin.name(name='N')
+molecule.name(name='OMP')
+
+# Display the data (as a test).
+relax_data.display(ri_label='R1', frq_label='800')
+
+# Write, then read the data to a new data pipe.
+bmrb.write(file=ds.tmpfile, dir=None, force=True)
+pipe.create(pipe_name='new', pipe_type='mf')
+bmrb.read(file=ds.tmpfile)
+
+# Display tests.
+sequence.display()
+relax_data.display(ri_label='R1', frq_label='800')




Related Messages


Powered by MHonArc, Updated Fri Mar 06 14:00:08 2009