mailr18054 - /trunk/generic_fns/frq.py


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

Header


Content

Posted by edward on November 30, 2012 - 13:09:
Author: bugman
Date: Fri Nov 30 13:09:13 2012
New Revision: 18054

URL: http://svn.gna.org/viewcvs/relax?rev=18054&view=rev
Log:
Modified the frq.set user function - the value can be set twice if it is the 
same value.


Modified:
    trunk/generic_fns/frq.py

Modified: trunk/generic_fns/frq.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/generic_fns/frq.py?rev=18054&r1=18053&r2=18054&view=diff
==============================================================================
--- trunk/generic_fns/frq.py (original)
+++ trunk/generic_fns/frq.py Fri Nov 30 13:09:13 2012
@@ -54,8 +54,7 @@
 def set(id=None, frq=None):
     """Set the spectrometer frequency of the experiment.
 
-    @keyword id:    The experimental identification string (allowing for 
multiple experiments per
-                    data pipe).
+    @keyword id:    The experimental identification string (allowing for 
multiple experiments per data pipe).
     @type id:       str
     @keyword frq:   The spectrometer frequency in Hertz.
     @type frq:      float
@@ -69,8 +68,8 @@
         cdp.frq = {}
 
     # Test the frequency has not already been set.
-    if id in cdp.frq:
-        raise RelaxError("The frequency for the experiment " + repr(id) + " 
has already been set.")
+    if id in cdp.frq and cdp.frq[id] != frq:
+        raise RelaxError("The frequency for the experiment '%s' has already 
been set to %s Hz." % (id, cdp.frq[id]))
 
     # Set the frequency.
     cdp.frq[id] = frq




Related Messages


Powered by MHonArc, Updated Fri Nov 30 14:20:01 2012