[Scipy-svn] r6555 - trunk/scipy/optimize

scipy-svn@scip... scipy-svn@scip...
Mon Jun 21 11:02:08 CDT 2010


Author: oliphant
Date: 2010-06-21 11:02:08 -0500 (Mon, 21 Jun 2010)
New Revision: 6555

Modified:
   trunk/scipy/optimize/minpack.py
Log:
Fix curve_fit to not raise an error unless an error actually exists.

Modified: trunk/scipy/optimize/minpack.py
===================================================================
--- trunk/scipy/optimize/minpack.py	2010-06-21 15:53:30 UTC (rev 6554)
+++ trunk/scipy/optimize/minpack.py	2010-06-21 16:02:08 UTC (rev 6555)
@@ -406,7 +406,7 @@
     res = leastsq(func, p0, args=args, full_output=1, **kw)
     (popt, pcov, infodict, errmsg, ier) = res
 
-    if ier != 1:
+    if ier not in [1,2,3,4]:
         msg = "Optimal parameters not found: " + errmsg
         raise RuntimeError(msg)
 



More information about the Scipy-svn mailing list