mailr27019 - /branches/nmrglue/test_suite/system_tests/nmrglue.py


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

Header


Content

Posted by edward on December 08, 2014 - 16:32:
Author: bugman
Date: Mon Dec  8 16:32:27 2014
New Revision: 27019

URL: http://svn.gna.org/viewcvs/relax?rev=27019&view=rev
Log:
Updated the Nmrglue.test_save_state system test for the changed data store 
structures.


Modified:
    branches/nmrglue/test_suite/system_tests/nmrglue.py

Modified: branches/nmrglue/test_suite/system_tests/nmrglue.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/nmrglue/test_suite/system_tests/nmrglue.py?rev=27019&r1=27018&r2=27019&view=diff
==============================================================================
--- branches/nmrglue/test_suite/system_tests/nmrglue.py (original)
+++ branches/nmrglue/test_suite/system_tests/nmrglue.py Mon Dec  8 16:32:27 
2014
@@ -470,12 +470,10 @@
         self.assertEqual(cdp.nmrglue_ids[0], sp_id)
 
         # Extract the data.
-        dic  = cdp.nmrglue_dic[sp_id]
-        udic  = cdp.nmrglue_udic[sp_id]
-        data = cdp.nmrglue_data[sp_id]
-        s = base64.b64encode(data)
-        cdp.nmrglue_data[sp_id] = s
-        print("Type of encoding is:", type(cdp.nmrglue_data[sp_id]))
+        dic  = cdp.nmrglue[sp_id].dic
+        udic  = cdp.nmrglue[sp_id].udic
+        data = cdp.nmrglue[sp_id].data
+        print("Type of encoding is:", type(cdp.nmrglue[sp_id].data))
 
         # Try storing the numpy array, and print size
         data_numpy = ds.tmpdir + sep + 'data.npy'
@@ -484,9 +482,6 @@
         data_numpy_size = path.getsize(data_numpy)
         print("Filesize of .npy file is: %i"%(data_numpy_size) )
 
-        # Delete the large data array, for faster saving.
-        #cdp.nmrglue_data[sp_id] = 0
-
         # Store the directory path, before reset of the controller.
         dirpath = ds.tmpdir
 
@@ -508,29 +503,25 @@
         self.interpreter.state.load(dirpath+sep+'state')
 
         # Decode
-        print("Decoding")
-        r = base64.decodestring(cdp.nmrglue_data[sp_id])
-        q = frombuffer(r,dtype=float32)
-        cdp.nmrglue_data[sp_id] = q.reshape((512, 4096))
-        print("Type of decoded is:", type(cdp.nmrglue_data[sp_id]))
-        print("Shape of numpy array is:", cdp.nmrglue_data[sp_id].shape)
+        print("Type of decoded is:", type(cdp.nmrglue[sp_id].data))
+        print("Shape of numpy array is:", cdp.nmrglue[sp_id].data.shape)
 
         # Test data.
         print("Testing data array.")
-        print("Shape of data is %ix%i, and of cdp.nmrglue_data is 
%ix%i"%(data.shape[0], data.shape[1], cdp.nmrglue_data[sp_id].shape[0], 
cdp.nmrglue_data[sp_id].shape[1]))
-        test = data == cdp.nmrglue_data[sp_id]
+        print("Shape of data is %ix%i, and of cdp.nmrglue[].data is 
%ix%i"%(data.shape[0], data.shape[1], cdp.nmrglue[sp_id].data.shape[0], 
cdp.nmrglue[sp_id].data.shape[1]))
+        test = data == cdp.nmrglue[sp_id].data
         print(test.all())
         self.assert_(test.all())
 
         print("Testing dics.")
         # Make tests that they are the same.
-        self.assertEqual(dic, cdp.nmrglue_dic[sp_id])
+        self.assertEqual(dic, cdp.nmrglue[sp_id].dic)
         for id in dic:
-            self.assertEqual(dic[id], cdp.nmrglue_dic[sp_id][id])
-
-        self.assertEqual(udic, cdp.nmrglue_udic[sp_id])
+            self.assertEqual(dic[id], cdp.nmrglue[sp_id].dic[id])
+
+        self.assertEqual(udic, cdp.nmrglue[sp_id].udic)
         for id in udic:
-            self.assertEqual(udic[id], cdp.nmrglue_udic[sp_id][id])
+            self.assertEqual(udic[id], cdp.nmrglue[sp_id].udic[id])
 
 
     def test_version(self):




Related Messages


Powered by MHonArc, Updated Mon Dec 08 17:40:01 2014