Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Make Umfpack free its data (#1597) #162

merged 2 commits into from

3 participants

pv commented

Fixes this:
Can't really add an unit test for this, since the data is held on C level.

@rc: do you concur?

The WarningManager stuff is for present Numpy.


The error on deprecation should be reverted before release in Numpy. But why are you seeing it? I don't you adding anything that can cause a new one here.

Either way those warnings should be filtered out of the tests.

rc commented

@pv Yes, the patch seems ok.

pv commented

@rgommers: the DeprecationWarning raised by the umfpack routines is converted into an error, so these tests are not otherwise ran when using the dev version of Numpy.

@rgommers rgommers merged commit d24cc56 into scipy:master

I'll backport to 0.10.x too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
20 scipy/sparse/linalg/dsolve/umfpack/tests/
@@ -7,8 +7,10 @@
import warnings
import random
from numpy.testing import TestCase, assert_array_almost_equal, dec, \
+from numpy.testing.utils import WarningManager
from scipy import rand, matrix, diag, eye
from scipy.sparse import csc_matrix, spdiags, SparseEfficiencyWarning
@@ -29,7 +31,17 @@
_umfpack_skip = dec.skipif(not _have_umfpack,
'UMFPACK appears not to be compiled')
-class TestSolvers(TestCase):
+class _DeprecationAccept:
+ def setUp(self):
+ self.mgr = WarningManager()
+ self.mgr.__enter__()
+ warnings.simplefilter("ignore", DeprecationWarning)
+ def tearDown(self):
+ self.mgr.__exit__()
+class TestSolvers(TestCase, _DeprecationAccept):
"""Tests inverting a sparse linear system"""
def test_solve_complex_without_umfpack(self):
@@ -113,9 +125,9 @@ def setUp(self):
self.b = np.array([1, 2, 3, 4, 5])
self.b2 = np.array([5, 4, 3, 2, 1])
+ _DeprecationAccept.setUp(self)
-class TestFactorization(TestCase):
+class TestFactorization(TestCase, _DeprecationAccept):
"""Tests factorizing a sparse linear system"""
def test_complex_lu(self):
@@ -175,6 +187,8 @@ def setUp(self):
self.complex_matrices = [x.astype(np.complex128)
for x in self.real_matrices]
+ _DeprecationAccept.setUp(self)
# Skip methods if umfpack not present
for cls in [TestSolvers, TestFactorization]:
decorate_methods(cls, _umfpack_skip)
3  scipy/sparse/linalg/dsolve/umfpack/
@@ -296,6 +296,9 @@ def __init__( self, family = 'di', **kwargs ):
self.funs.defaults( self.control )
self.control[UMFPACK_PRL] = 3
+ def __del__(self):
# 30.11.2005, c
def strControl( self ):
Something went wrong with that request. Please try again.