mailr16330 - /branches/uf_redesign/generic_fns/spectrum.py


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

Header


Content

Posted by edward on May 18, 2012 - 11:06:
Author: bugman
Date: Fri May 18 11:06:11 2012
New Revision: 16330

URL: http://svn.gna.org/viewcvs/relax?rev=16330&view=rev
Log:
The spectrum.replicated user function back end now checks for lists of None 
or of 1 element.


Modified:
    branches/uf_redesign/generic_fns/spectrum.py

Modified: branches/uf_redesign/generic_fns/spectrum.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/uf_redesign/generic_fns/spectrum.py?rev=16330&r1=16329&r2=16330&view=diff
==============================================================================
--- branches/uf_redesign/generic_fns/spectrum.py (original)
+++ branches/uf_redesign/generic_fns/spectrum.py Fri May 18 11:06:11 2012
@@ -1170,6 +1170,16 @@
         if spectrum_id not in cdp.spectrum_ids:
             raise RelaxError("The peak intensities corresponding to the 
spectrum id '%s' do not exist." % spectrum_id)
 
+    # Test for None.
+    if spectrum_ids == None:
+        warn(RelaxWarning("The spectrum ID list cannot be None."))
+        return
+
+    # Test for more than one element.
+    if len(spectrum_ids) == 1:
+        warn(RelaxWarning("The number of spectrum IDs in the list %s must be 
greater than one." % spectrum_ids))
+        return
+
     # Initialise.
     if not hasattr(cdp, 'replicates'):
         cdp.replicates = []




Related Messages


Powered by MHonArc, Updated Fri May 18 11:20:02 2012