[Scipy-svn] r3866 - in trunk/scipy: linalg splinalg/dsolve/tests splinalg/dsolve/umfpack/tests

scipy-svn@scip... scipy-svn@scip...
Sat Jan 26 10:14:57 CST 2008


Author: wnbell
Date: 2008-01-26 10:14:42 -0600 (Sat, 26 Jan 2008)
New Revision: 3866

Added:
   trunk/scipy/linalg/iterative.py
Modified:
   trunk/scipy/linalg/__init__.py
   trunk/scipy/splinalg/dsolve/tests/test_linsolve.py
   trunk/scipy/splinalg/dsolve/umfpack/tests/test_umfpack.py
Log:
deprecate linalg.iterative properly
filter warnings in splinalg.dsolve unittests


Modified: trunk/scipy/linalg/__init__.py
===================================================================
--- trunk/scipy/linalg/__init__.py	2008-01-25 22:32:47 UTC (rev 3865)
+++ trunk/scipy/linalg/__init__.py	2008-01-26 16:14:42 UTC (rev 3866)
@@ -10,10 +10,9 @@
 from matfuncs import *
 from blas import *
 
-#from iterative import *
-# TODO remove this
-from scipy.splinalg.isolve import *
+from iterative import *
 
+
 __all__ = filter(lambda s:not s.startswith('_'),dir())
 
 from numpy.dual import register_func

Added: trunk/scipy/linalg/iterative.py
===================================================================
--- trunk/scipy/linalg/iterative.py	2008-01-25 22:32:47 UTC (rev 3865)
+++ trunk/scipy/linalg/iterative.py	2008-01-26 16:14:42 UTC (rev 3866)
@@ -0,0 +1,13 @@
+__all__ = ['bicg','bicgstab','cg','cgs','gmres','qmr']
+
+# Deprecated on January 26, 2008
+
+from scipy.splinalg import isolve
+from numpy import deprecate
+
+for name in __all__:
+    oldfn = getattr(isolve, name)
+    oldname='scipy.linalg.' + name 
+    newname='scipy.splinalg.' + name
+    newfn = deprecate(oldfn, oldname=oldname, newname=newname)
+    exec(name + ' = newfn')

Modified: trunk/scipy/splinalg/dsolve/tests/test_linsolve.py
===================================================================
--- trunk/scipy/splinalg/dsolve/tests/test_linsolve.py	2008-01-25 22:32:47 UTC (rev 3865)
+++ trunk/scipy/splinalg/dsolve/tests/test_linsolve.py	2008-01-26 16:14:42 UTC (rev 3866)
@@ -1,3 +1,4 @@
+import warnings
 
 from numpy import array, finfo
 from scipy.testing import *
@@ -3,7 +4,9 @@
 
 from scipy.linalg import norm, inv
-from scipy.sparse import spdiags, csc_matrix
+from scipy.sparse import spdiags, csc_matrix, SparseEfficiencyWarning
 from scipy.splinalg.dsolve import spsolve, use_solver
 
+warnings.simplefilter('ignore',SparseEfficiencyWarning)
+
 #TODO add more comprehensive tests
 use_solver( useUmfpack = False )

Modified: trunk/scipy/splinalg/dsolve/umfpack/tests/test_umfpack.py
===================================================================
--- trunk/scipy/splinalg/dsolve/umfpack/tests/test_umfpack.py	2008-01-25 22:32:47 UTC (rev 3865)
+++ trunk/scipy/splinalg/dsolve/umfpack/tests/test_umfpack.py	2008-01-26 16:14:42 UTC (rev 3866)
@@ -5,15 +5,19 @@
 
 """
 
+import warnings
+
 from numpy import transpose, array, arange
 
 import random
 from scipy.testing import *
 
 from scipy import rand, matrix, diag, eye
-from scipy.sparse import csc_matrix, dok_matrix, spdiags
+from scipy.sparse import csc_matrix, dok_matrix, spdiags, SparseEfficiencyWarning
 from scipy.splinalg import linsolve
 
+warnings.simplefilter('ignore',SparseEfficiencyWarning)
+
 import numpy as nm
 try:
     import scipy.splinalg.dsolve.umfpack as um



More information about the Scipy-svn mailing list