Author: bugman
Date: Tue Mar 10 09:35:38 2015
New Revision: 27788

URL: http://svn.gna.org/viewcvs/relax?rev=27788&view=rev
Log:
Merged revisions 27782-27787 via svnmerge from 
svn+ssh://bug...@svn.gna.org/svn/relax/trunk

........
  r27782 | bugman | 2015-03-05 11:02:08 +0100 (Thu, 05 Mar 2015) | 9 lines
  
  Huge speed up for loading results and state files with Monte Carlo simulation 
alignment tensors.
  
  The reading of the alignment tensor component of XML formatted results and 
state files has been
  modified.  Previously the 
data_store.align_tensor.AlignTensorData._update_object() method for
  updating the alignment tensor object (for values, errors, simulations) was 
being called once for
  each Monte Carlo simulation.  Now is it called only once for all simulations. 
 In one test, the
  reading of the save file with 500 simulations dropped from 253.7 to 10.0 
seconds.
........
  r27783 | bugman | 2015-03-05 14:49:00 +0100 (Thu, 05 Mar 2015) | 6 lines
  
  Added an extra check for the assembly of RDC data.
  
  This is in the pipe_control.rdc.return_rdc_data() function and the check is 
for any unit vectors set
  to None, which is a fatal condition.
........
  r27784 | bugman | 2015-03-05 15:05:28 +0100 (Thu, 05 Mar 2015) | 3 lines
  
  Improved the RelaxError message from the RDC assembly function when unit 
vectors are None.
........
  r27785 | bugman | 2015-03-05 15:17:51 +0100 (Thu, 05 Mar 2015) | 6 lines
  
  Added a new warning to the interatom.unit_vectors user function if data is 
missing.
  
  This is to aid in detecting problems earlier before unit vectors of None are 
encountered by other
  parts of relax.
........
  r27786 | bugman | 2015-03-09 11:48:12 +0100 (Mon, 09 Mar 2015) | 6 lines
  
  Improvements for the rdc.weight and pcs.weight user functions.
  
  The spin_id argument can now be set to None to allow all spins or interatomic 
data containers to be
  set.
........
  r27787 | bugman | 2015-03-09 16:53:08 +0100 (Mon, 09 Mar 2015) | 6 lines
  
  Modified the rdc.corr_plot user function to skip deselected interatomic data 
containers.
  
  This would normally happen as no back-calculated data is normally present.  
However, if data has
  been copied from elsewhere, this may not always be the case.
........

Modified:
    branches/frame_order_cleanup/   (props changed)
    branches/frame_order_cleanup/data_store/align_tensor.py
    branches/frame_order_cleanup/pipe_control/interatomic.py
    branches/frame_order_cleanup/pipe_control/rdc.py
    branches/frame_order_cleanup/user_functions/pcs.py
    branches/frame_order_cleanup/user_functions/rdc.py

Propchange: branches/frame_order_cleanup/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Tue Mar 10 09:35:38 2015
@@ -1 +1 @@
-/trunk:1-27780
+/trunk:1-27787

Modified: branches/frame_order_cleanup/data_store/align_tensor.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/frame_order_cleanup/data_store/align_tensor.py?rev=27788&r1=27787&r2=27788&view=diff
==============================================================================
--- branches/frame_order_cleanup/data_store/align_tensor.py     (original)
+++ branches/frame_order_cleanup/data_store/align_tensor.py     Tue Mar 10 
09:35:38 2015
@@ -1129,11 +1129,11 @@
 
                 # Normal parameters.
                 if category == 'val':
-                    self[-1].set(param=param, value=value)
+                    self[-1].set(param=param, value=value, category=category, 
update=False)
 
                 # Errors.
                 elif category == 'err':
-                    self[-1].set(param=param, value=value, category='err')
+                    self[-1].set(param=param, value=value, category=category, 
update=False)
 
                 # Simulation objects objects.
                 else:
@@ -1143,7 +1143,11 @@
 
                     # Recreate the list elements.
                     for i in range(len(value)):
-                        self[-1].set(param=param, value=value[i], 
category='sim', sim_index=i)
+                        self[-1].set(param=param, value=value[i], 
category=category, sim_index=i, update=False)
+
+                # Update the data structures.
+                for target, update_if_set, depends in dependency_generator():
+                    self[-1]._update_object(param, target, update_if_set, 
depends, category)
 
             # Delete the temporary object.
             del temp_obj
@@ -1375,7 +1379,7 @@
                         self.__dict__[target+'_sim']._set(value=value, 
sim_index=i)
 
 
-    def set(self, param=None, value=None, category='val', sim_index=None):
+    def set(self, param=None, value=None, category='val', sim_index=None, 
update=True):
         """Set a alignment tensor parameter.
 
         @keyword param:     The name of the parameter to set.
@@ -1386,6 +1390,8 @@
         @type category:     str
         @keyword sim_index: The index for a Monte Carlo simulation for 
simulated parameter.
         @type sim_index:    int or None
+        @keyword update:    A flag which if True will cause all the alignment 
tensor objects to be updated correctly.  This can be turned off for speed, as 
long as the _update_object() method is called prior to using the tensor.
+        @type update:       bool
         """
 
         # Check the type.
@@ -1428,8 +1434,9 @@
             return
 
         # Update the data structures.
-        for target, update_if_set, depends in dependency_generator():
-            self._update_object(param, target, update_if_set, depends, 
category)
+        if update:
+            for target, update_if_set, depends in dependency_generator():
+                self._update_object(param, target, update_if_set, depends, 
category)
 
 
     def set_fixed(self, flag):

Modified: branches/frame_order_cleanup/pipe_control/interatomic.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/frame_order_cleanup/pipe_control/interatomic.py?rev=27788&r1=27787&r2=27788&view=diff
==============================================================================
--- branches/frame_order_cleanup/pipe_control/interatomic.py    (original)
+++ branches/frame_order_cleanup/pipe_control/interatomic.py    Tue Mar 10 
09:35:38 2015
@@ -759,6 +759,7 @@
             for i in range(len(spin1.pos)):
                 # No structural information.
                 if spin1.pos[i] == None or spin2.pos[i] == None:
+                    warn(RelaxWarning("No structural information for state %i 
can be found between spins '%s' and '%s'." % (i, interatom.spin_id1, 
interatom.spin_id2)))
                     vector_list.append(None)
 
                 # All data is present.

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=27788&r1=27787&r2=27788&view=diff
==============================================================================
--- branches/frame_order_cleanup/pipe_control/rdc.py    (original)
+++ branches/frame_order_cleanup/pipe_control/rdc.py    Tue Mar 10 09:35:38 2015
@@ -495,7 +495,7 @@
                 break
 
         # Loop over the interatomic data.
-        for interatom in interatomic_loop():
+        for interatom in interatomic_loop(skip_desel=True):
             # Skip if data is missing.
             if not hasattr(interatom, 'rdc') or not hasattr(interatom, 
'rdc_bc') or not align_id in interatom.rdc or not align_id in interatom.rdc_bc:
                 continue
@@ -1145,6 +1145,12 @@
             # Calculate the RDC dipolar constant (in Hertz, and the 3 comes 
from the alignment tensor), and append it to the list.
             rdc_const.append(3.0/(2.0*pi) * dipolar_constant(g1, g2, 
interatom.r))
 
+        # Sanity check, to prevent cryptic Python errors.
+        indices = []
+        for i in range(len(unit_vect[-1])):
+            if unit_vect[-1][i] == None:
+                raise RelaxError("Unit vectors of None have been detected 
between the spins '%s' and '%s' %s." % (interatom.spin_id1, interatom.spin_id2, 
unit_vect[-1]))
+
         # Store the measured J coupling.
         if opt_uses_j_couplings():
             j_couplings.append(interatom.j_coupling)

Modified: branches/frame_order_cleanup/user_functions/pcs.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/frame_order_cleanup/user_functions/pcs.py?rev=27788&r1=27787&r2=27788&view=diff
==============================================================================
--- branches/frame_order_cleanup/user_functions/pcs.py  (original)
+++ branches/frame_order_cleanup/user_functions/pcs.py  Tue Mar 10 09:35:38 2015
@@ -559,7 +559,8 @@
     name = "spin_id",
     py_type = "str",
     desc_short = "spin ID string",
-    desc = "The spin ID string."
+    desc = "The spin ID string.",
+    can_be_none = True
 )
 uf.add_keyarg(
     name = "weight",

Modified: branches/frame_order_cleanup/user_functions/rdc.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/frame_order_cleanup/user_functions/rdc.py?rev=27788&r1=27787&r2=27788&view=diff
==============================================================================
--- branches/frame_order_cleanup/user_functions/rdc.py  (original)
+++ branches/frame_order_cleanup/user_functions/rdc.py  Tue Mar 10 09:35:38 2015
@@ -479,7 +479,8 @@
     name = "spin_id",
     py_type = "str",
     desc_short = "spin ID string",
-    desc = "The spin ID string."
+    desc = "The spin ID string.",
+    can_be_none = True
 )
 uf.add_keyarg(
     name = "weight",


_______________________________________________
relax (http://www.nmr-relax.com)

This is the relax-commits mailing list
relax-commits@gna.org

To unsubscribe from this list, get a password
reminder, or change your subscription options,
visit the list information page at
https://mail.gna.org/listinfo/relax-commits

Reply via email to