mailr23330 - in /branches/disp_speed: ./ lib/structure/internal/ test_suite/system_tests/ test_suite/unit_tests/_lib/_dispersion/


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

Header


Content

Posted by tlinnet on May 22, 2014 - 14:50:
Author: tlinnet
Date: Thu May 22 14:50:55 2014
New Revision: 23330

URL: http://svn.gna.org/viewcvs/relax?rev=23330&view=rev
Log:
Merged revisions 23327-23329 via svnmerge from 
svn+ssh://tlinnet@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'".
........

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

Propchange: branches/disp_speed/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Thu May 22 14:50:55 2014
@@ -1 +1 @@
-/trunk:1-23319
+/trunk:1-23329

Modified: branches/disp_speed/lib/structure/internal/object.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/disp_speed/lib/structure/internal/object.py?rev=23330&r1=23329&r2=23330&view=diff
==============================================================================
--- branches/disp_speed/lib/structure/internal/object.py        (original)
+++ branches/disp_speed/lib/structure/internal/object.py        Thu May 22 
14:50:55 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/disp_speed/test_suite/system_tests/structure.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/disp_speed/test_suite/system_tests/structure.py?rev=23330&r1=23329&r2=23330&view=diff
==============================================================================
--- branches/disp_speed/test_suite/system_tests/structure.py    (original)
+++ branches/disp_speed/test_suite/system_tests/structure.py    Thu May 22 
14:50:55 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/disp_speed/test_suite/unit_tests/_lib/_dispersion/__init__.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/disp_speed/test_suite/unit_tests/_lib/_dispersion/__init__.py?rev=23330&r1=23329&r2=23330&view=diff
==============================================================================
--- branches/disp_speed/test_suite/unit_tests/_lib/_dispersion/__init__.py    
  (original)
+++ branches/disp_speed/test_suite/unit_tests/_lib/_dispersion/__init__.py    
  Thu May 22 14:50:55 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:00:03 2014