Permalink
Browse files

TST: sparse.csgraph: fix random seed in tests

  • Loading branch information...
1 parent 75c3458 commit 55e8e94e5c42bdc6c0cf6358f9611dcbcc953007 @pv committed Jun 10, 2012
@@ -5,6 +5,7 @@
def test_csgraph_from_dense():
+ np.random.seed(1234)
G = np.random.random((10, 10))
some_nulls = (G < 0.4)
all_nulls = (G < 0.8)
@@ -35,6 +36,7 @@ def test_csgraph_from_dense():
@dec.skipif(np.version.short_version < '1.6', "Can't test arrays with infs.")
def test_csgraph_to_dense():
+ np.random.seed(1234)
G = np.random.random((10, 10))
nulls = (G < 0.8)
G[nulls] = np.inf
@@ -48,6 +50,7 @@ def test_csgraph_to_dense():
def test_multiple_edges():
# create a random sqare matrix with an even number of elements
+ np.random.seed(1234)
X = np.random.random((10, 10))
Xcsr = csr_matrix(X)
@@ -5,6 +5,7 @@
from scipy.sparse.csgraph import minimum_spanning_tree
def construct_sparse_graph(N):
+ np.random.seed(1234)
csgraph = np.random.random((N, N))
ind = np.random.randint(N, size=(2, N * N / 2))
csgraph[ind[0], ind[1]] = 0

0 comments on commit 55e8e94

Please sign in to comment.