mailr16453 - in /1.3: relax_errors.py specific_fns/model_free/mf_minimise.py


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

Header


Content

Posted by edward on May 25, 2012 - 09:47:
Author: bugman
Date: Fri May 25 09:47:49 2012
New Revision: 16453

URL: http://svn.gna.org/viewcvs/relax?rev=16453&view=rev
Log:
The model-free minimisation is now checking for multiple vectors per spin, 
and raises a RelaxError.

This is in response to James Nyirenda's <jamesn7414 att yahoo dott com> post 
at
https://mail.gna.org/public/relax-users/2012-05/msg00023.html (Message-id:
<1337916876.99384.YahooMailNeo@xxxxxxxxxxxxxxxxxxxxxxxxxxx>).

The RelaxMultiVectorError has been modified to accept a spin ID.  This error 
is now raised if
multiple vectors exist per spin, as model-free analysis cannot handle this.


Modified:
    1.3/relax_errors.py
    1.3/specific_fns/model_free/mf_minimise.py

Modified: 1.3/relax_errors.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/relax_errors.py?rev=16453&r1=16452&r2=16453&view=diff
==============================================================================
--- 1.3/relax_errors.py (original)
+++ 1.3/relax_errors.py Fri May 25 09:47:49 2012
@@ -260,8 +260,11 @@
 
 # Multiple unit vectors.
 class RelaxMultiVectorError(BaseError):
-    def __init__(self):
-        self.text = "The multiple unit XH bond vectors per spin - this is 
not supported by the current data pipe type."
+    def __init__(self, spin_id=None):
+        if spin_id != None:
+            self.text = "The multiple unit XH bond vectors for the spin '%s' 
- this is not supported by the current data pipe type." % spin_id
+        else:
+            self.text = "The multiple unit XH bond vectors per spin - this 
is not supported by the current data pipe type."
 
 # No unit vectors.
 class RelaxNoVectorsError(BaseError):

Modified: 1.3/specific_fns/model_free/mf_minimise.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/specific_fns/model_free/mf_minimise.py?rev=16453&r1=16452&r2=16453&view=diff
==============================================================================
--- 1.3/specific_fns/model_free/mf_minimise.py (original)
+++ 1.3/specific_fns/model_free/mf_minimise.py Fri May 25 09:47:49 2012
@@ -1102,7 +1102,14 @@
 
             # Vectors.
             if data_store.model_type != 'local_tm' and cdp.diff_tensor.type 
!= 'sphere':
+                # Check that this is a single vector!
+                if arg_check.is_num_list(spin.xh_vect[0], raise_error=False):
+                    raise RelaxMultiVectorError(data_store.spin_id)
+
+                # Store the vector.
                 data_store.xh_unit_vectors.append(spin.xh_vect)
+
+            # No vector.
             else:
                 data_store.xh_unit_vectors.append(None)
 




Related Messages


Powered by MHonArc, Updated Fri May 25 11:40:02 2012