mailr15225 - in /branches/frame_order_testing: ./ generic_fns/


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

Header


Content

Posted by edward on January 24, 2012 - 15:12:
Author: bugman
Date: Tue Jan 24 15:12:25 2012
New Revision: 15225

URL: http://svn.gna.org/viewcvs/relax?rev=15225&view=rev
Log:
Merged revisions 15220,15223-15224 via svnmerge from 
svn+ssh://bugman@xxxxxxxxxxx/svn/relax/1.3

........
  r15220 | bugman | 2012-01-24 10:18:12 +0100 (Tue, 24 Jan 2012) | 6 lines
  
  Added a print out for the diffusion_tensor.init uf to inform the user of an 
angle unit change.
  
  This is in response to bug #19323 (https://gna.org/bugs/?19323), to make it 
clearer that a parameter
  conversion has occurred.
........
  r15223 | bugman | 2012-01-24 14:58:21 +0100 (Tue, 24 Jan 2012) | 7 lines
  
  Significant speed ups of the return_spin() and return_residue() functions.
  
  This change to the generic_fns.mol_res_spin functions cuts the system tests 
from ~8 min to ~7 min on
  my laptop.  The support for multiple spin selections has been dropped as 
this additional flexibility
  is not being used anyway.
........
  r15224 | bugman | 2012-01-24 15:00:01 +0100 (Tue, 24 Jan 2012) | 6 lines
  
  Fixes for the rdc.read and pcs.read user function backends.
  
  The spin_id string is now not used in the back end - it was being sent to 
the return_spin() function
  - removing flexibility but significantly speeding up the user functions.
........

Modified:
    branches/frame_order_testing/   (props changed)
    branches/frame_order_testing/generic_fns/diffusion_tensor.py
    branches/frame_order_testing/generic_fns/mol_res_spin.py
    branches/frame_order_testing/generic_fns/pcs.py
    branches/frame_order_testing/generic_fns/rdc.py

Propchange: branches/frame_order_testing/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Tue Jan 24 15:12:25 2012
@@ -1,1 +1,1 @@
-/1.3:1-15210
+/1.3:1-15224

Modified: branches/frame_order_testing/generic_fns/diffusion_tensor.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/frame_order_testing/generic_fns/diffusion_tensor.py?rev=15225&r1=15224&r2=15225&view=diff
==============================================================================
--- branches/frame_order_testing/generic_fns/diffusion_tensor.py (original)
+++ branches/frame_order_testing/generic_fns/diffusion_tensor.py Tue Jan 24 
15:12:25 2012
@@ -599,6 +599,7 @@
 
     # Convert the angles to radians.
     if angle_units == 'deg':
+        print("Converting the angles from degrees to radian units.")
         alpha = (alpha / 360.0) * 2.0 * pi
         beta = (beta / 360.0) * 2.0 * pi
         gamma = (gamma / 360.0) * 2.0 * pi
@@ -1709,6 +1710,7 @@
 
     # Convert the angles to radians.
     if angle_units == 'deg':
+        print("Converting the angles from degrees to radian units.")
         theta = (theta / 360.0) * 2.0 * pi
         phi = (phi / 360.0) * 2.0 * pi
 

Modified: branches/frame_order_testing/generic_fns/mol_res_spin.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/frame_order_testing/generic_fns/mol_res_spin.py?rev=15225&r1=15224&r2=15225&view=diff
==============================================================================
--- branches/frame_order_testing/generic_fns/mol_res_spin.py (original)
+++ branches/frame_order_testing/generic_fns/mol_res_spin.py Tue Jan 24 
15:12:25 2012
@@ -1,6 +1,6 @@
 
###############################################################################
 #                                                                            
 #
-# Copyright (C) 2003-2004, 2006-2011 Edward d'Auvergne                       
 #
+# Copyright (C) 2003-2012 Edward d'Auvergne                                  
 #
 #                                                                            
 #
 # This file is part of the program relax.                                    
 #
 #                                                                            
 #
@@ -2233,10 +2233,14 @@
     res_num = 0
     res_container = None
     for mol in dp.mol:
+        # Skip the molecule if there is no match to the selection.
+        if mol not in select_obj:
+            continue
+
         # Loop over the residues.
         for res in mol.res:
             # Skip the residue if there is no match to the selection.
-            if (mol, res) not in select_obj:
+            if res not in select_obj:
                 continue
 
             # Store the residue container.
@@ -2256,21 +2260,16 @@
 def return_spin(selection=None, pipe=None, full_info=False):
     """Function for returning the spin data container of the given selection.
 
-    If more than one selection is given, then the boolean AND operation will 
be used to pull out the
-    spin.
-
-    @param selection:   The spin selection identifier(s).
-    @type selection:    str or list of str
+    If more than one selection is given, then the boolean AND operation will 
be used to pull out the spin.
+
+    @param selection:   The spin selection identifier.
+    @type selection:    str
     @param pipe:        The data pipe containing the spin.  Defaults to the 
current data pipe.
     @type pipe:         str
-    @param full_info:   A flag specifying if the amount of information to be 
returned.  If false,
-                        only the data container is returned.  If true, the 
molecule name, residue
-                        number, and residue name is additionally returned.
+    @param full_info:   A flag specifying if the amount of information to be 
returned.  If false, only the data container is returned.  If true, the 
molecule name, residue number, and residue name is additionally returned.
     @type full_info:    boolean
-    @return:            The spin system specific data container and, if 
full_info=True, the molecule
-                        name, residue number, and residue name.
-    @rtype:             instance of the SpinContainer class.  If 
full_info=True, the type is the
-                        tuple (SpinContainer, str, int, str).
+    @return:            The spin system specific data container and, if 
full_info=True, the molecule name, residue number, and residue name.
+    @rtype:             instance of the SpinContainer class.  If 
full_info=True, the type is the tuple (SpinContainer, str, int, str).
     """
 
     # Handle Unicode.
@@ -2281,34 +2280,31 @@
     if pipe == None:
         pipe = pipes.cdp_name()
 
-    # Test the data pipe.
-    pipes.test(pipe)
-
     # Get the data pipe.
     dp = pipes.get_pipe(pipe)
 
     # Parse the selection string.
-    if isinstance(selection, str):
-        selection = [selection]
-    select_obj = []
-    for i in range(len(selection)):
-        select_obj.append(Selection(selection[i]))
+    select_obj = Selection(selection)
 
     # Loop over the molecules.
     spin = None
     spin_num = 0
     spin_container = None
     for mol in dp.mol:
+        # Skip the molecule if there is no match to the selection.
+        if mol not in select_obj:
+            continue
+
         # Loop over the residues.
         for res in mol.res:
+            # Skip the residue if there is no match to the selection.
+            if res not in select_obj:
+                continue
+
             # Loop over the spins.
             for spin in res.spin:
                 # Skip the spin if there is no match to the selection.
-                skip = False
-                for i in range(len(selection)):
-                    if (mol, res, spin) not in select_obj[i]:
-                        skip = True
-                if skip:
+                if spin not in select_obj:
                     continue
 
                 # Store all containers.

Modified: branches/frame_order_testing/generic_fns/pcs.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/frame_order_testing/generic_fns/pcs.py?rev=15225&r1=15224&r2=15225&view=diff
==============================================================================
--- branches/frame_order_testing/generic_fns/pcs.py (original)
+++ branches/frame_order_testing/generic_fns/pcs.py Tue Jan 24 15:12:25 2012
@@ -1,6 +1,6 @@
 
###############################################################################
 #                                                                            
 #
-# Copyright (C) 2003-2011 Edward d'Auvergne                                  
 #
+# Copyright (C) 2003-2012 Edward d'Auvergne                                  
 #
 #                                                                            
 #
 # This file is part of the program relax.                                    
 #
 #                                                                            
 #
@@ -469,7 +469,7 @@
             raise RelaxError("An invalid error value of zero has been 
encountered.")
 
         # Get the corresponding spin container.
-        spin = return_spin([id, spin_id])
+        spin = return_spin(id)
         if spin == None:
             warn(RelaxNoSpinWarning(id))
             continue

Modified: branches/frame_order_testing/generic_fns/rdc.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/frame_order_testing/generic_fns/rdc.py?rev=15225&r1=15224&r2=15225&view=diff
==============================================================================
--- branches/frame_order_testing/generic_fns/rdc.py (original)
+++ branches/frame_order_testing/generic_fns/rdc.py Tue Jan 24 15:12:25 2012
@@ -1,6 +1,6 @@
 
###############################################################################
 #                                                                            
 #
-# Copyright (C) 2003-2011 Edward d'Auvergne                                  
 #
+# Copyright (C) 2003-2012 Edward d'Auvergne                                  
 #
 #                                                                            
 #
 # This file is part of the program relax.                                    
 #
 #                                                                            
 #
@@ -436,7 +436,7 @@
             raise RelaxError("An invalid error value of zero has been 
encountered.")
 
         # Get the corresponding spin container.
-        spin = return_spin([id, spin_id])
+        spin = return_spin(id)
         if spin == None:
             warn(RelaxNoSpinWarning(id))
             continue




Related Messages


Powered by MHonArc, Updated Tue Jan 24 15:20:02 2012