mailr27762 - in /branches/frame_order_cleanup: ./ pipe_control/rdc.py test_suite/system_tests/rdc.py


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

Header


Content

Posted by edward on March 03, 2015 - 17:22:
Author: bugman
Date: Tue Mar  3 17:22:14 2015
New Revision: 27762

URL: http://svn.gna.org/viewcvs/relax?rev=27762&view=rev
Log:
Merged revisions 27758-27761 via svnmerge from 
svn+ssh://bugman@xxxxxxxxxxx/svn/relax/trunk

........
  r27758 | bugman | 2015-03-03 17:10:38 +0100 (Tue, 03 Mar 2015) | 6 lines
  
  The Rdc.test_rdc_copy_* system tests now check for the 'rdc_data_types' 
data structure.
  
  This is in the Rdc.test_rdc_copy_different_spins and 
Rdc.test_rdc_copy_back_calc system tests and
  shows that the rdc.copy user function fails to duplicate this information.
........
  r27759 | bugman | 2015-03-03 17:11:47 +0100 (Tue, 03 Mar 2015) | 3 lines
  
  Removed a debugging printout.
........
  r27760 | bugman | 2015-03-03 17:15:33 +0100 (Tue, 03 Mar 2015) | 6 lines
  
  The Rdc.test_rdc_copy_* system tests now check for the 'absolute_rdc' data 
structure.
  
  This is in the Rdc.test_rdc_copy_different_spins and 
Rdc.test_rdc_copy_back_calc system tests and
  shows that the rdc.copy user function fails to duplicate this information 
as well.
........
  r27761 | bugman | 2015-03-03 17:18:14 +0100 (Tue, 03 Mar 2015) | 3 lines
  
  Expanded the rdc.copy user function to copy the RDC data type and absolute 
RDC flag information.
........

Modified:
    branches/frame_order_cleanup/   (props changed)
    branches/frame_order_cleanup/pipe_control/rdc.py
    branches/frame_order_cleanup/test_suite/system_tests/rdc.py

Propchange: branches/frame_order_cleanup/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Tue Mar  3 17:22:14 2015
@@ -1 +1 @@
-/trunk:1-27756
+/trunk:1-27761

Modified: branches/frame_order_cleanup/pipe_control/rdc.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/frame_order_cleanup/pipe_control/rdc.py?rev=27762&r1=27761&r2=27762&view=diff
==============================================================================
--- branches/frame_order_cleanup/pipe_control/rdc.py    (original)
+++ branches/frame_order_cleanup/pipe_control/rdc.py    Tue Mar  3 17:22:14 
2015
@@ -388,11 +388,17 @@
                 interatom_to.rdc_bc = {}
             if hasattr(interatom_from, 'rdc_err') and not 
hasattr(interatom_to, 'rdc_err'):
                 interatom_to.rdc_err = {}
+            if hasattr(interatom_from, 'rdc_data_types') and not 
hasattr(interatom_to, 'rdc_data_types'):
+                interatom_to.rdc_data_types = {}
+            if hasattr(interatom_from, 'absolute_rdc') and not 
hasattr(interatom_to, 'absolute_rdc'):
+                interatom_to.absolute_rdc = {}
 
             # Copy the value and error from pipe_from.
             value = None
             error = None
             value_bc = None
+            data_type = None
+            absolute_rdc = None
             if hasattr(interatom_from, 'rdc'):
                 value = interatom_from.rdc[align_id]
                 interatom_to.rdc[align_id] = value
@@ -402,6 +408,12 @@
             if hasattr(interatom_from, 'rdc_err'):
                 error = interatom_from.rdc_err[align_id]
                 interatom_to.rdc_err[align_id] = error
+            if hasattr(interatom_from, 'rdc_data_types'):
+                data_type = interatom_from.rdc_data_types[align_id]
+                interatom_to.rdc_data_types[align_id] = data_type
+            if hasattr(interatom_from, 'absolute_rdc'):
+                absolute_rdc = interatom_from.absolute_rdc[align_id]
+                interatom_to.absolute_rdc[align_id] = absolute_rdc
 
             # Append the data for printout.
             data.append([interatom_from.spin_id1, interatom_from.spin_id2])
@@ -418,13 +430,15 @@
                 data[-1].append("%20.15f" % error)
             else:
                 data[-1].append("%20s" % error)
+            data[-1].append("%20s" % data_type)
+            data[-1].append("%20s" % absolute_rdc)
 
         # Printout.
         print("The following RDCs have been copied:\n")
         if back_calc:
-            write_data(out=sys.stdout, headings=["Spin_ID1", "Spin_ID2", 
"Value", "Back-calculated", "Error"], data=data)
+            write_data(out=sys.stdout, headings=["Spin_ID1", "Spin_ID2", 
"Value", "Back-calculated", "Error", "Data_type", "Absolute_RDC"], data=data)
         else:
-            write_data(out=sys.stdout, headings=["Spin_ID1", "Spin_ID2", 
"Value", "Error"], data=data)
+            write_data(out=sys.stdout, headings=["Spin_ID1", "Spin_ID2", 
"Value", "Error", "Data_type", "Absolute_RDC"], data=data)
 
 
 def corr_plot(format=None, title=None, subtitle=None, file=None, dir=None, 
force=False):

Modified: branches/frame_order_cleanup/test_suite/system_tests/rdc.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/frame_order_cleanup/test_suite/system_tests/rdc.py?rev=27762&r1=27761&r2=27762&view=diff
==============================================================================
--- branches/frame_order_cleanup/test_suite/system_tests/rdc.py (original)
+++ branches/frame_order_cleanup/test_suite/system_tests/rdc.py Tue Mar  3 
17:22:14 2015
@@ -159,20 +159,31 @@
         ]
         for i in range(2):
             print("\nChecking data pipe '%s'." % pipes[i])
+
+            # Metadata.
             self.assert_(hasattr(ds[pipes[i]], 'align_ids'))
             self.assert_('tb' in ds[pipes[i]].align_ids)
             self.assert_(hasattr(ds[pipes[i]], 'rdc_ids'))
             self.assert_('tb' in ds[pipes[i]].rdc_ids)
-            self.interpreter.pipe.switch(pipe_name=pipes[i])
-            self.assertEqual(count_spins(), 14)
-            self.assertEqual(len(cdp.interatomic), 7)
+
+            # Spin data.
+            self.assertEqual(count_spins(pipe=pipes[i]), 14)
+            self.assertEqual(len(ds[pipes[i]].interatomic), 7)
             j = 0
-            for interatom in interatomic_loop():
+            for interatom in interatomic_loop(pipe=pipes[i]):
                 # Residue 6 in the 'new' data pipe has no RDCs.
                 if i == 1 and j == 1:
                     self.assert_(not hasattr(interatom, 'rdc'))
+                    self.assert_(not hasattr(interatom, 'rdc_data_types'))
+                    self.assert_(not hasattr(interatom, 'absolute_rdc'))
                 else:
                     self.assertAlmostEqual(rdcs[i][j], interatom.rdc['tb'])
+                    self.assert_(hasattr(interatom, 'rdc_data_types'))
+                    self.assert_('tb' in interatom.rdc_data_types)
+                    self.assertEqual(interatom.rdc_data_types['tb'], 'D')
+                    self.assert_(hasattr(interatom, 'absolute_rdc'))
+                    self.assert_('tb' in interatom.absolute_rdc)
+                    self.assertEqual(interatom.absolute_rdc['tb'], False)
                 j += 1
 
 
@@ -232,21 +243,32 @@
         ]
         for i in range(2):
             print("\nChecking data pipe '%s'." % pipes[i])
+
+            # Metadata.
             self.assert_(hasattr(ds[pipes[i]], 'align_ids'))
             self.assert_('tb' in ds[pipes[i]].align_ids)
             self.assert_(hasattr(ds[pipes[i]], 'rdc_ids'))
             self.assert_('tb' in ds[pipes[i]].rdc_ids)
-            self.interpreter.pipe.switch(pipe_name=pipes[i])
-            self.assertEqual(count_spins(), 14)
-            self.assertEqual(len(cdp.interatomic), 7)
+
+            # Spin data.
+            self.assertEqual(count_spins(pipe=pipes[i]), 14)
+            self.assertEqual(len(ds[pipes[i]].interatomic), 7)
             j = 0
-            for interatom in interatomic_loop():
+            for interatom in interatomic_loop(pipe=pipes[i]):
                 # Residue 6 in the 'new' data pipe has no RDCs.
                 if i == 1 and j == 1:
                     self.assert_(not hasattr(interatom, 'rdc'))
+                    self.assert_(not hasattr(interatom, 'rdc_data_types'))
+                    self.assert_(not hasattr(interatom, 'absolute_rdc'))
                 else:
                     self.assertAlmostEqual(rdcs[i][j], interatom.rdc['tb'])
                     self.assertAlmostEqual(rdcs[i][j]+1.0, 
interatom.rdc_bc['tb'])
+                    self.assert_(hasattr(interatom, 'rdc_data_types'))
+                    self.assert_('tb' in interatom.rdc_data_types)
+                    self.assertEqual(interatom.rdc_data_types['tb'], 'D')
+                    self.assert_(hasattr(interatom, 'absolute_rdc'))
+                    self.assert_('tb' in interatom.absolute_rdc)
+                    self.assertEqual(interatom.absolute_rdc['tb'], False)
                 j += 1
 
 




Related Messages


Powered by MHonArc, Updated Tue Mar 03 17:40:02 2015