mailr12819 - in /1.3/generic_fns: pcs.py rdc.py


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

Header


Content

Posted by edward on March 24, 2011 - 16:00:
Author: bugman
Date: Thu Mar 24 16:00:41 2011
New Revision: 12819

URL: http://svn.gna.org/viewcvs/relax?rev=12819&view=rev
Log:
The RDC and PCS Q factor user functions now do nothing when data is missing 
rather than failing.

A warning is given and the function now simply returns rather than crashing.


Modified:
    1.3/generic_fns/pcs.py
    1.3/generic_fns/rdc.py

Modified: 1.3/generic_fns/pcs.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/generic_fns/pcs.py?rev=12819&r1=12818&r2=12819&view=diff
==============================================================================
--- 1.3/generic_fns/pcs.py (original)
+++ 1.3/generic_fns/pcs.py Thu Mar 24 16:00:41 2011
@@ -1,6 +1,6 @@
 
###############################################################################
 #                                                                            
 #
-# Copyright (C) 2003-2010 Edward d'Auvergne                                  
 #
+# Copyright (C) 2003-2011 Edward d'Auvergne                                  
 #
 #                                                                            
 #
 # This file is part of the program relax.                                    
 #
 #                                                                            
 #
@@ -313,6 +313,11 @@
     @keyword spin_id:   The spin ID string used to restrict the Q-factor 
calculation to a subset of all spins.
     @type spin_id:      None or str
     """
+
+    # No PCSs, so no Q factors can be calculated.
+    if not hasattr(cdp, 'pcs_ids') or not len(cdp.pcs_ids):
+        warn(RelaxWarning("No PCS data exists, Q factors cannot be 
calculated."))
+        return
 
     # Q-factor list.
     cdp.q_factors_pcs = []

Modified: 1.3/generic_fns/rdc.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/generic_fns/rdc.py?rev=12819&r1=12818&r2=12819&view=diff
==============================================================================
--- 1.3/generic_fns/rdc.py (original)
+++ 1.3/generic_fns/rdc.py Thu Mar 24 16:00:41 2011
@@ -1,6 +1,6 @@
 
###############################################################################
 #                                                                            
 #
-# Copyright (C) 2003-2010 Edward d'Auvergne                                  
 #
+# Copyright (C) 2003-2011 Edward d'Auvergne                                  
 #
 #                                                                            
 #
 # This file is part of the program relax.                                    
 #
 #                                                                            
 #
@@ -226,6 +226,11 @@
     @keyword spin_id:   The spin ID string used to restrict the Q-factor 
calculation to a subset of all spins.
     @type spin_id:      None or str
     """
+
+    # No RDCs, so no Q factors can be calculated.
+    if not hasattr(cdp, 'rdc_ids') or not len(cdp.rdc_ids):
+        warn(RelaxWarning("No RDC data exists, Q factors cannot be 
calculated."))
+        return
 
     # Q-factor list.
     cdp.q_factors_rdc = []




Related Messages


Powered by MHonArc, Updated Thu Mar 24 16:20:02 2011