mailr23335 - in /branches/frame_order_cleanup: ./ lib/dispersion/ lib/structure/internal/ test_suite/system_tests/ test_suite/un...


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

Header


Content

Posted by edward on May 22, 2014 - 15:23:
Author: bugman
Date: Thu May 22 15:23:58 2014
New Revision: 23335

URL: http://svn.gna.org/viewcvs/relax?rev=23335&view=rev
Log:
Merged revisions 23327-23329,23331 via svnmerge from 
svn+ssh://bugman@xxxxxxxxxxx/svn/relax/trunk

........
  r23327 | bugman | 2014-05-22 14:05:01 +0200 (Thu, 22 May 2014) | 17 lines
  
  Added 7 unit tests demonstrating edge case 'no Rex' failures of the 'NS 
CPMG 2-site expanded' model.
  
  This follows from the ideas in the post 
http://article.gmane.org/gmane.science.nmr.relax.devel/5858.
  
  These tests cover all parameter value combinations which result in no 
exchange:
  
      - dw = 0.0,
      - pA = 1.0,
      - kex = 0.0,
      - dw = 0.0 and pA = 1.0,
      - dw = 0.0 and kex = 0.0,
      - pA = 1.0 and kex = 0.0,
      - dw = 0.0, pA = 1.0, and kex = 0.0.
  
  Such tests should be replicated for all dispersion models.
........
  r23328 | bugman | 2014-05-22 14:30:58 +0200 (Thu, 22 May 2014) | 6 lines
  
  Created the Structure.test_bug_22069_structure_delete_helix_attribute 
system test.
  
  This is to catch bug #22069 (https://gna.org/bugs/index.php?22069), the 
failure of the
  structure.delete user function with "AttributeError: Internal instance has 
no attribute 'helices'".
........
  r23329 | bugman | 2014-05-22 14:37:09 +0200 (Thu, 22 May 2014) | 6 lines
  
  Fix for bug #22069 by only deleting helix and sheet data with 
structure.delete when it exists.
  
  This is bug #22069 (https://gna.org/bugs/index.php?22069), the failure of 
the structure.delete user
  function with "AttributeError: Internal instance has no attribute 
'helices'".
........
  r23331 | bugman | 2014-05-22 14:52:08 +0200 (Thu, 22 May 2014) | 10 lines
  
  Fix for all edge case 'no Rex' failures of the 'NS CPMG 2-site expanded' 
model.
  
  This uses the no exchange checking idea, modified to function in the relax 
trunk, from
  http://article.gmane.org/gmane.science.nmr.relax.devel/5847.  This is 
importantly on line 1 of the
  function.
  
  The recently introduced set of 7 unit tests (r23327) comprehensively 
showing these failures now all
  pass.  This commit is mainly for demonstration purposes.
........

Added:
    
branches/frame_order_cleanup/test_suite/unit_tests/_lib/_dispersion/test_ns_cpmg_2site_expanded.py
      - copied unchanged from r23331, 
trunk/test_suite/unit_tests/_lib/_dispersion/test_ns_cpmg_2site_expanded.py
Modified:
    branches/frame_order_cleanup/   (props changed)
    branches/frame_order_cleanup/lib/dispersion/ns_cpmg_2site_expanded.py
    branches/frame_order_cleanup/lib/structure/internal/object.py
    branches/frame_order_cleanup/test_suite/system_tests/structure.py
    
branches/frame_order_cleanup/test_suite/unit_tests/_lib/_dispersion/__init__.py

Propchange: branches/frame_order_cleanup/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Thu May 22 15:23:58 2014
@@ -1 +1 @@
-/trunk:1-23324
+/trunk:1-23334

Modified: 
branches/frame_order_cleanup/lib/dispersion/ns_cpmg_2site_expanded.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/frame_order_cleanup/lib/dispersion/ns_cpmg_2site_expanded.py?rev=23335&r1=23334&r2=23335&view=diff
==============================================================================
--- branches/frame_order_cleanup/lib/dispersion/ns_cpmg_2site_expanded.py     
  (original)
+++ branches/frame_order_cleanup/lib/dispersion/ns_cpmg_2site_expanded.py     
  Thu May 22 15:23:58 2014
@@ -272,6 +272,12 @@
     @type num_cpmg:             numpy int16, rank-1 array
     """
 
+    # Catch parameter values that will result in no exchange, returning flat 
R2eff = R20 lines (when kex = 0.0, k_AB = 0.0).
+    if dw == 0.0 or pA == 1.0 or k_AB == 0.0:
+        for i in range(num_points):
+            back_calc[i] = r20
+        return
+
     # Repeditive calculations.
     half_tcp = 0.5 * tcp
     k_AB_plus_k_BA = k_AB + k_BA

Modified: branches/frame_order_cleanup/lib/structure/internal/object.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/frame_order_cleanup/lib/structure/internal/object.py?rev=23335&r1=23334&r2=23335&view=diff
==============================================================================
--- branches/frame_order_cleanup/lib/structure/internal/object.py       
(original)
+++ branches/frame_order_cleanup/lib/structure/internal/object.py       Thu 
May 22 15:23:58 2014
@@ -1579,42 +1579,44 @@
             del_res_nums.reverse()
 
             # Handle the helix metadata.
-            del_helix_indices = []
-            for i in range(len(self.helices)):
-                # Trim the helix.
-                helix = self._trim_helix(helix=self.helices[i], 
trim_res_list=del_res_nums, res_data=res_data)
-
-                # Trimmed helix.
-                if helix != None:
-                    self.helices[i] = helix
-
-                # No helix left.
-                else:
-                    del_helix_indices.append(i)
-
-            # Loop over the reverse helix indices and pop out the data.
-            del_helix_indices.reverse()
-            for i in del_helix_indices:
-                self.helices.pop(i)
+            if hasattr(self, 'helices'):
+                del_helix_indices = []
+                for i in range(len(self.helices)):
+                    # Trim the helix.
+                    helix = self._trim_helix(helix=self.helices[i], 
trim_res_list=del_res_nums, res_data=res_data)
+
+                    # Trimmed helix.
+                    if helix != None:
+                        self.helices[i] = helix
+
+                    # No helix left.
+                    else:
+                        del_helix_indices.append(i)
+
+                # Loop over the reverse helix indices and pop out the data.
+                del_helix_indices.reverse()
+                for i in del_helix_indices:
+                    self.helices.pop(i)
 
             # Handle the sheet metadata.
-            del_sheet_indices = []
-            for i in range(len(self.sheets)):
-                # Trim the sheet.
-                sheet = self._trim_sheet(sheet=self.sheets[i], 
trim_res_list=del_res_nums, res_data=res_data)
-
-                # Trimmed sheet.
-                if sheet != None:
-                    self.sheets[i] = sheet
-
-                # No sheet left.
-                else:
-                    del_sheet_indices.append(i)
-
-            # Loop over the reverse sheet indices and pop out the data.
-            del_sheet_indices.reverse()
-            for i in del_sheet_indices:
-                self.sheets.pop(i)
+            if hasattr(self, 'sheets'):
+                del_sheet_indices = []
+                for i in range(len(self.sheets)):
+                    # Trim the sheet.
+                    sheet = self._trim_sheet(sheet=self.sheets[i], 
trim_res_list=del_res_nums, res_data=res_data)
+
+                    # Trimmed sheet.
+                    if sheet != None:
+                        self.sheets[i] = sheet
+
+                    # No sheet left.
+                    else:
+                        del_sheet_indices.append(i)
+
+                # Loop over the reverse sheet indices and pop out the data.
+                del_sheet_indices.reverse()
+                for i in del_sheet_indices:
+                    self.sheets.pop(i)
 
 
     def empty(self):

Modified: branches/frame_order_cleanup/test_suite/system_tests/structure.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/frame_order_cleanup/test_suite/system_tests/structure.py?rev=23335&r1=23334&r2=23335&view=diff
==============================================================================
--- branches/frame_order_cleanup/test_suite/system_tests/structure.py   
(original)
+++ branches/frame_order_cleanup/test_suite/system_tests/structure.py   Thu 
May 22 15:23:58 2014
@@ -194,6 +194,19 @@
         lines = file.readlines()
         for i in range(len(lines)):
             self.assertEqual(contents[i], lines[i])
+
+
+    def test_bug_22069_structure_delete_helix_attribute(self):
+        """Catch U{bug #22069<https://gna.org/bugs/?22069>}, the failure of 
the structure.delete user function with helix attribute errors."""
+
+        # Path of the structure file.
+        path = status.install_path + 
sep+'test_suite'+sep+'shared_data'+sep+'frame_order'+sep+'cam'
+
+        # Load the structure.
+        self.interpreter.structure.read_pdb('1J7P_1st_NH_rot.pdb', dir=path)
+
+        # Delete the calciums.
+        self.interpreter.structure.delete(atom_id='@CA')
 
 
     def test_delete_empty(self):

Modified: 
branches/frame_order_cleanup/test_suite/unit_tests/_lib/_dispersion/__init__.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/frame_order_cleanup/test_suite/unit_tests/_lib/_dispersion/__init__.py?rev=23335&r1=23334&r2=23335&view=diff
==============================================================================
--- 
branches/frame_order_cleanup/test_suite/unit_tests/_lib/_dispersion/__init__.py
     (original)
+++ 
branches/frame_order_cleanup/test_suite/unit_tests/_lib/_dispersion/__init__.py
     Thu May 22 15:23:58 2014
@@ -1,6 +1,6 @@
 
###############################################################################
 #                                                                            
 #
-# Copyright (C) 2013 Edward d'Auvergne                                       
 #
+# Copyright (C) 2013-2014 Edward d'Auvergne                                  
 #
 #                                                                            
 #
 # This file is part of the program relax (http://www.nmr-relax.com).         
 #
 #                                                                            
 #
@@ -21,5 +21,6 @@
 
 
 __all__ = [
-    'test___init__'
+    'test___init__',
+    'test_ns_cpmg_2site_expanded'
 ]




Related Messages


Powered by MHonArc, Updated Thu May 22 15:40:02 2014