[SciPy-dev] Random fixes

David M. Cooke cookedm at physics.mcmaster.ca
Mon Jul 21 20:12:50 EDT 2003


Just some stuff I found running pychecker over a few files...

-- 
|>|\/|<
/--------------------------------------------------------------------------\
|David M. Cooke                      http://arbutus.physics.mcmaster.ca/dmc/
|cookedm at physics.mcmaster.ca
-------------- next part --------------
Index: Lib/integrate/ode.py
===================================================================
RCS file: /home/cvsroot/world/scipy/Lib/integrate/ode.py,v
retrieving revision 1.1
diff -c -u -r1.1 ode.py
--- Lib/integrate/ode.py	3 Feb 2002 19:08:07 -0000	1.1
+++ Lib/integrate/ode.py	22 Jul 2003 01:36:09 -0000
@@ -200,6 +200,7 @@
         if re.match(name,cl.__name__,re.I):
             print 'Found integrator',cl.__name__
             return cl
+    return None
 
 class IntegratorBase:
 
Index: Lib/linalg/interface_gen.py
===================================================================
RCS file: /home/cvsroot/world/scipy/Lib/linalg/interface_gen.py,v
retrieving revision 1.14
diff -c -u -r1.14 interface_gen.py
--- Lib/linalg/interface_gen.py	13 Oct 2002 23:09:28 -0000	1.14
+++ Lib/linalg/interface_gen.py	22 Jul 2003 01:36:09 -0000
@@ -1,7 +1,7 @@
 #!/usr/bin/env python
 
 import string,os
-import pre as re
+import re
 
 def all_subroutines(interface_in):
     # remove comments
Index: Lib/optimize/optimize.py
===================================================================
RCS file: /home/cvsroot/world/scipy/Lib/optimize/optimize.py,v
retrieving revision 1.36
diff -c -u -r1.36 optimize.py
--- Lib/optimize/optimize.py	17 Sep 2002 16:13:22 -0000	1.36
+++ Lib/optimize/optimize.py	22 Jul 2003 01:36:09 -0000
@@ -590,7 +590,7 @@
         while Num.add.reduce(abs(ri)) > termcond:
             if fhess is None:
                 if fhess_p is None:
-                    Ap = apply(approx_fhess_p,(xk,psupi,fprime,espilon)+args)
+                    Ap = apply(approx_fhess_p,(xk,psupi,fprime,epsilon)+args)
                     gcalls = gcalls + 2
                 else:
                     Ap = apply(fhess_p,(xk,psupi)+args)
@@ -782,7 +782,7 @@
             flag = 1
             fval = fx
             if disp > 0:
-                _endprint(x, flag, fval, maxfun, tol, disp)
+                _endprint(x, flag, fval, maxfun, xtol, disp)
             if full_output:
                 return xf, fval, flag, num
             else:
@@ -826,7 +826,7 @@
         assert ((fb<fa) and (fb < fc)), "Not a bracketing interval."
         funcalls = 3
     else:
-        raise ValuError, "Bracketing interval must be length 2 or 3 sequence."
+        raise ValueError, "Bracketing interval must be length 2 or 3 sequence."
 
     x=w=v=xb
     fw=fv=fx=apply(func, (x,)+args)
@@ -922,7 +922,7 @@
         assert ((fb<fa) and (fb < fc)), "Not a bracketing interval."
         funcalls = 3
     else:
-        raise ValuError, "Bracketing interval must be length 2 or 3 sequence."
+        raise ValueError, "Bracketing interval must be length 2 or 3 sequence."
 
     _gR = 0.61803399
     _gC = 1.0-_gR
@@ -985,7 +985,7 @@
         w = xb - ((xb-xc)*tmp2-(xb-xa)*tmp1)/denom
         wlim = xb + grow_limit*(xc-xb)
         if iter > 1000:
-            raise RunTimeError, "Too many iterations."
+            raise RuntimeError, "Too many iterations."
         if (w-xc)*(xb-w) > 0.0:
             fw = apply(func, (w,)+args)
             funcalls += 1
@@ -1018,7 +1018,7 @@
     return xa, xb, xc, fa, fb, fc, funcalls
             
             
-global _powell_funcalls
+_powell_funcalls = 0
 
 def _myfunc(alpha, func, x0, direc, args=()):
     funcargs = (x0 + alpha * direc,)+args
Index: Lib/weave/build_tools.py
===================================================================
RCS file: /home/cvsroot/world/scipy/Lib/weave/build_tools.py,v
retrieving revision 1.25
diff -c -u -r1.25 build_tools.py
--- Lib/weave/build_tools.py	29 Mar 2003 06:24:37 -0000	1.25
+++ Lib/weave/build_tools.py	22 Jul 2003 01:36:09 -0000
@@ -518,7 +518,7 @@
                  libraries,
                  library_dirs,
                  runtime_library_dirs,
-                 None, # export_symbols, we do this in our def-file
+                 _, # export_symbols, we do this in our def-file
                  debug,
                  extra_preargs,
                  extra_postargs,


More information about the SciPy-Dev mailing list