mailr4386 - in /1.3: prompt/value.py relax_errors.py


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

Header


Content

Posted by edward on January 06, 2008 - 01:10:
Author: bugman
Date: Sun Jan  6 01:10:34 2008
New Revision: 4386

URL: http://svn.gna.org/viewcvs/relax?rev=4386&view=rev
Log:
Updated the value.set() user function to accept string values of the 'value' 
variable.

Two new RelaxErrors have been created for this.


Modified:
    1.3/prompt/value.py
    1.3/relax_errors.py

Modified: 1.3/prompt/value.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/prompt/value.py?rev=4386&r1=4385&r2=4386&view=diff
==============================================================================
--- 1.3/prompt/value.py (original)
+++ 1.3/prompt/value.py Sun Jan  6 01:10:34 2008
@@ -28,7 +28,7 @@
 import help
 from generic_fns import diffusion_tensor
 from generic_fns import value
-from relax_errors import RelaxBinError, RelaxError, RelaxFloatError, 
RelaxIntError, RelaxListFloatError, RelaxListStrError, 
RelaxNoneFloatListError, RelaxNoneIntError, RelaxNoneIntStrError, 
RelaxNoneStrError, RelaxNoneStrListError, RelaxStrError
+from relax_errors import RelaxBinError, RelaxError, RelaxFloatError, 
RelaxIntError, RelaxListFloatError, RelaxListStrError, 
RelaxNoneFloatStrListError, RelaxNoneIntError, RelaxNoneIntStrError, 
RelaxNoneStrError, RelaxNoneStrListError, RelaxStrError
 from specific_fns.model_free import Model_free
 from specific_fns.jw_mapping import Jw_mapping
 from specific_fns.relax_fit import Relax_fit
@@ -377,17 +377,17 @@
             print text
 
         # The value.
-        if val != None and type(val) != float and type(val) != int and 
type(val) != list:
-            raise RelaxNoneFloatListError, ('value', val)
+        if val != None and type(val) != float and type(val) != int and 
type(val) != str and type(val) != list:
+            raise RelaxNoneFloatStrListError, ('value', val)
         if type(val) == list:
             # Empty list.
             if val == []:
-                raise RelaxListFloatError, ('value', val)
+                raise RelaxListFloatStrError, ('value', val)
 
             # Check for values.
             for i in xrange(len(val)):
                 if type(val[i]) != float and type(val[i]) != int:
-                    raise RelaxListFloatError, ('value', val)
+                    raise RelaxListFloatStrError, ('value', val)
 
         # The parameter.
         if param != None and type(param) != str and type(param) != list:

Modified: 1.3/relax_errors.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/relax_errors.py?rev=4386&r1=4385&r2=4386&view=diff
==============================================================================
--- 1.3/relax_errors.py (original)
+++ 1.3/relax_errors.py Sun Jan  6 01:10:34 2008
@@ -271,6 +271,13 @@
         if Debug:
             self.save_state()
 
+# List of floating point numbers or strings.
+class RelaxListFloatStrError(BaseError):
+    def __init__(self, name, value):
+        self.text = "The " + name + " argument " + `value` + " must be an 
array of floating point numbers or strings."
+        if Debug:
+            self.save_state()
+
 # List of integers.
 class RelaxListIntError(BaseError):
     def __init__(self, name, value):
@@ -324,6 +331,13 @@
 class RelaxNoneFloatListError(BaseError):
     def __init__(self, name, value):
         self.text = "The " + name + " argument " + `value` + " must either 
be a floating point number, a list, or None."
+        if Debug:
+            self.save_state()
+
+# None, float, str, or list.
+class RelaxNoneFloatStrListError(BaseError):
+    def __init__(self, name, value):
+        self.text = "The " + name + " argument " + `value` + " must either 
be a floating point number, a string, a list, or None."
         if Debug:
             self.save_state()
 




Related Messages


Powered by MHonArc, Updated Sun Jan 06 01:20:37 2008