mailr4417 - /1.3/prompt/minimisation.py


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

Header


Content

Posted by edward on January 07, 2008 - 13:51:
Author: bugman
Date: Mon Jan  7 13:37:30 2008
New Revision: 4417

URL: http://svn.gna.org/viewcvs/relax?rev=4417&view=rev
Log:
Bug fix for the grid_search() user function.

Empty lists for the lower, upper, and inc args now throw a RelaxError.


Modified:
    1.3/prompt/minimisation.py

Modified: 1.3/prompt/minimisation.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/prompt/minimisation.py?rev=4417&r1=4416&r2=4417&view=diff
==============================================================================
--- 1.3/prompt/minimisation.py (original)
+++ 1.3/prompt/minimisation.py Mon Jan  7 13:37:30 2008
@@ -100,6 +100,11 @@
         elif type(lower) != list:
             raise RelaxListError, ('lower bounds', lower)
         else:
+            # Empty list.
+            if lower == []:
+                raise RelaxListNumError, ('lower bounds', lower)
+
+            # Check the values.
             for i in xrange(len(lower)):
                 if type(lower[i]) != float and type(lower[i]) != int:
                     raise RelaxListNumError, ('lower bounds', lower)
@@ -110,6 +115,11 @@
         elif type(upper) != list:
             raise RelaxListError, ('upper bounds', upper)
         else:
+            # Empty list.
+            if upper == []:
+                raise RelaxListNumError, ('upper bounds', upper)
+
+            # Check the values.
             for i in xrange(len(upper)):
                 if type(upper[i]) != float and type(upper[i]) != int:
                     raise RelaxListNumError, ('upper bounds', upper)
@@ -118,6 +128,11 @@
         if type(inc) == int:
             pass
         elif type(inc) == list:
+            # Empty list.
+            if inc == []:
+                raise RelaxIntListIntError, ('incrementation value', inc)
+
+            # Check the values.
             for i in xrange(len(inc)):
                 if type(inc[i]) != int:
                     raise RelaxIntListIntError, ('incrementation value', inc)




Related Messages


Powered by MHonArc, Updated Mon Jan 07 14:00:19 2008