[Scipy-svn] r4731 - in trunk/scipy/optimize: . tests

scipy-svn@scip... scipy-svn@scip...
Thu Sep 18 14:37:51 CDT 2008


Author: alan.mcintyre
Date: 2008-09-18 14:37:37 -0500 (Thu, 18 Sep 2008)
New Revision: 4731

Modified:
   trunk/scipy/optimize/linesearch.py
   trunk/scipy/optimize/minpack.py
   trunk/scipy/optimize/optimize.py
   trunk/scipy/optimize/slsqp.py
   trunk/scipy/optimize/tests/test_optimize.py
   trunk/scipy/optimize/tests/test_slsqp.py
   trunk/scipy/optimize/tests/test_zeros.py
   trunk/scipy/optimize/zeros.py
Log:
Removed unused imports.


Modified: trunk/scipy/optimize/linesearch.py
===================================================================
--- trunk/scipy/optimize/linesearch.py	2008-09-18 19:34:57 UTC (rev 4730)
+++ trunk/scipy/optimize/linesearch.py	2008-09-18 19:37:37 UTC (rev 4731)
@@ -2,7 +2,6 @@
 
 from scipy.optimize import minpack2
 import numpy
-import sys
 
 import __builtin__
 pymin = __builtin__.min

Modified: trunk/scipy/optimize/minpack.py
===================================================================
--- trunk/scipy/optimize/minpack.py	2008-09-18 19:34:57 UTC (rev 4730)
+++ trunk/scipy/optimize/minpack.py	2008-09-18 19:37:37 UTC (rev 4731)
@@ -2,7 +2,7 @@
 
 from numpy import atleast_1d, dot, take, triu, shape, eye, \
                   transpose, zeros, product, greater, array, \
-                  any, all, where, isscalar, asarray, ndarray
+                  all, where, isscalar, asarray
 
 error = _minpack.error
 

Modified: trunk/scipy/optimize/optimize.py
===================================================================
--- trunk/scipy/optimize/optimize.py	2008-09-18 19:34:57 UTC (rev 4730)
+++ trunk/scipy/optimize/optimize.py	2008-09-18 19:37:37 UTC (rev 4731)
@@ -24,7 +24,7 @@
 
 import numpy
 from numpy import atleast_1d, eye, mgrid, argmin, zeros, shape, empty, \
-     squeeze, isscalar, vectorize, asarray, absolute, sqrt, Inf, asfarray, isinf
+     squeeze, vectorize, asarray, absolute, sqrt, Inf, asfarray, isinf
 import linesearch
 
 # These have been copied from Numeric's MLab.py

Modified: trunk/scipy/optimize/slsqp.py
===================================================================
--- trunk/scipy/optimize/slsqp.py	2008-09-18 19:34:57 UTC (rev 4730)
+++ trunk/scipy/optimize/slsqp.py	2008-09-18 19:37:37 UTC (rev 4731)
@@ -8,8 +8,8 @@
 __all__ = ['approx_jacobian','fmin_slsqp']
 
 from _slsqp import slsqp
-from numpy import zeros, array, identity, linalg, rank, squeeze, append, \
-                  asfarray,product, concatenate, finfo, sqrt, vstack, transpose
+from numpy import zeros, array, linalg, append, asfarray, concatenate, finfo, \
+                  sqrt, vstack
 from optimize import approx_fprime, wrap_function
 
 __docformat__ = "restructuredtext en"

Modified: trunk/scipy/optimize/tests/test_optimize.py
===================================================================
--- trunk/scipy/optimize/tests/test_optimize.py	2008-09-18 19:34:57 UTC (rev 4730)
+++ trunk/scipy/optimize/tests/test_optimize.py	2008-09-18 19:37:37 UTC (rev 4731)
@@ -13,8 +13,7 @@
 
 from scipy import optimize
 from scipy.optimize import leastsq
-from numpy import array, zeros, float64, dot, log, exp, inf, \
-     pi, sin, cos
+from numpy import array, zeros, float64, dot, log, exp, inf, sin, cos
 import numpy as np
 from scipy.optimize.tnc import RCSTRINGS, MSG_NONE
 import numpy.random
@@ -264,14 +263,14 @@
         return err
 
     def test_basic(self):
-        p0 = numpy.array([0,0,0])
+        p0 = array([0,0,0])
         params_fit, ier = leastsq(self.residuals, p0,
                                   args=(self.y_meas, self.x))
         assert ier in (1,2,3,4), 'solution not found (ier=%d)'%ier
         assert_array_almost_equal( params_fit, self.abc, decimal=2) # low precision due to random
 
     def test_full_output(self):
-        p0 = numpy.array([0,0,0])
+        p0 = array([0,0,0])
         full_output = leastsq(self.residuals, p0,
                               args=(self.y_meas, self.x),
                               full_output=True)
@@ -279,8 +278,8 @@
         assert ier in (1,2,3,4), 'solution not found: %s'%mesg
 
     def test_input_untouched(self):
-        p0 = numpy.array([0,0,0],dtype=numpy.float64)
-        p0_copy = numpy.array(p0, copy=True)
+        p0 = array([0,0,0],dtype=float64)
+        p0_copy = array(p0, copy=True)
         full_output = leastsq(self.residuals, p0,
                               args=(self.y_meas, self.x),
                               full_output=True)

Modified: trunk/scipy/optimize/tests/test_slsqp.py
===================================================================
--- trunk/scipy/optimize/tests/test_slsqp.py	2008-09-18 19:34:57 UTC (rev 4730)
+++ trunk/scipy/optimize/tests/test_slsqp.py	2008-09-18 19:37:37 UTC (rev 4731)
@@ -2,7 +2,6 @@
 import numpy as np
 
 from scipy.optimize import  fmin_slsqp
-from numpy import matrix, diag
 
 
 class TestSLSQP(TestCase):

Modified: trunk/scipy/optimize/tests/test_zeros.py
===================================================================
--- trunk/scipy/optimize/tests/test_zeros.py	2008-09-18 19:34:57 UTC (rev 4730)
+++ trunk/scipy/optimize/tests/test_zeros.py	2008-09-18 19:37:37 UTC (rev 4731)
@@ -7,8 +7,7 @@
 from scipy.optimize import zeros as cc
 
 # Import testing parameters
-from scipy.optimize._tstutils import methods, mstrings, functions, \
-     fstrings, description
+from scipy.optimize._tstutils import functions, fstrings
 
 class TestBasic(TestCase) :
     def run_check(self, method, name):

Modified: trunk/scipy/optimize/zeros.py
===================================================================
--- trunk/scipy/optimize/zeros.py	2008-09-18 19:34:57 UTC (rev 4730)
+++ trunk/scipy/optimize/zeros.py	2008-09-18 19:37:37 UTC (rev 4731)
@@ -1,7 +1,7 @@
 ## Automatically adapted for scipy Oct 07, 2005 by convertcode.py
 
 import _zeros
-from numpy import sqrt, sign, finfo
+from numpy import finfo
 
 _iter = 100
 _xtol = 1e-12



More information about the Scipy-svn mailing list