diff --git a/python-networkx.spec b/python-networkx.spec index 154d6c4..94e699e 100644 --- a/python-networkx.spec +++ b/python-networkx.spec @@ -23,6 +23,7 @@ Source3: http://networkx.github.io/documentation/latest/_downloads/networ Patch0: optional-modules.patch Patch1: test-rounding-fix.patch Patch2: networkx-nose1.0.patch +Patch3: skip-scipy-0.8-tests.patch BuildArch: noarch Requires: %{name}-core = %{version}-%{release} @@ -174,6 +175,7 @@ Documentation for networkx %patch1 -p1 %if 0%{?rhel} == 6 %patch2 -p1 +%patch3 -p1 %endif # Fix permissions diff --git a/skip-scipy-0.8-tests.patch b/skip-scipy-0.8-tests.patch new file mode 100644 index 0000000..e639348 --- /dev/null +++ b/skip-scipy-0.8-tests.patch @@ -0,0 +1,64 @@ +el6 currently has scipy 0.7 and the following is only supported by 0.8: + networkx.current_flow_betweenness_centrality(...,normalized=False,...) + +Also on el6 the drawing/tests/test_layout.py fails as the following is only supported by 0.8: + scipy.sparse.linalg.eigen_symmetric + +diff -Naur networkx-1.8.1.orig/networkx/algorithms/centrality/tests/test_current_flow_betweenness_centrality.py networkx-1.8.1/networkx/algorithms/centrality/tests/test_current_flow_betweenness_centrality.py +--- networkx-1.8.1.orig/networkx/algorithms/centrality/tests/test_current_flow_betweenness_centrality.py 2013-08-04 13:53:31.000000000 +0000 ++++ networkx-1.8.1/networkx/algorithms/centrality/tests/test_current_flow_betweenness_centrality.py 2014-03-17 21:37:38.623458820 +0000 +@@ -41,17 +41,6 @@ + for n in sorted(G): + assert_almost_equal(b[n],wb_answer[n]) + +- def test_K4(self): +- """Betweenness centrality: K4""" +- G=networkx.complete_graph(4) +- for solver in ['full','lu','cg']: +- b=networkx.current_flow_betweenness_centrality(G, normalized=False, +- solver=solver) +- b_answer={0: 0.75, 1: 0.75, 2: 0.75, 3: 0.75} +- for n in sorted(G): +- assert_almost_equal(b[n],b_answer[n]) +- +- + def test_P4_normalized(self): + """Betweenness centrality: P4 normalized""" + G=networkx.path_graph(4) +@@ -80,16 +69,6 @@ + + + +- def test_solers(self): +- """Betweenness centrality: alternate solvers""" +- G=networkx.complete_graph(4) +- for solver in ['full','lu','cg']: +- b=networkx.current_flow_betweenness_centrality(G,normalized=False, +- solver=solver) +- b_answer={0: 0.75, 1: 0.75, 2: 0.75, 3: 0.75} +- for n in sorted(G): +- assert_almost_equal(b[n],b_answer[n]) +- + + + class TestApproximateFlowBetweennessCentrality(object): +diff -Naur networkx-1.8.1.orig/networkx/drawing/tests/test_layout.py networkx-1.8.1/networkx/drawing/tests/test_layout.py +--- networkx-1.8.1.orig/networkx/drawing/tests/test_layout.py 2013-08-04 13:53:31.000000000 +0000 ++++ networkx-1.8.1/networkx/drawing/tests/test_layout.py 2014-03-17 21:40:40.192283827 +0000 +@@ -46,16 +46,3 @@ + pos=nx.drawing.layout._fruchterman_reingold(A) + pos=nx.drawing.layout._fruchterman_reingold(A,dim=3) + assert_equal(pos.shape,(6,3)) +- +- def test_adjacency_interface_scipy(self): +- try: +- import scipy +- except ImportError: +- raise SkipTest('scipy not available.') +- +- A=nx.to_scipy_sparse_matrix(self.Gs,dtype='f') +- pos=nx.drawing.layout._sparse_fruchterman_reingold(A) +- pos=nx.drawing.layout._sparse_spectral(A) +- +- pos=nx.drawing.layout._sparse_fruchterman_reingold(A,dim=3) +- assert_equal(pos.shape,(6,3))