forked from pool/python-networkx
Accepting request 839780 from devel:languages:python:numeric
OBS-URL: https://build.opensuse.org/request/show/839780 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-networkx?expand=0&rev=25
This commit is contained in:
commit
e572dc2eb8
25
0001-Replace-hash-function-for-test-of-weighted-astar.patch
Normal file
25
0001-Replace-hash-function-for-test-of-weighted-astar.patch
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
From 7e4ddaa2e1745cdb3ed9969680d755ce81ddcdfd Mon Sep 17 00:00:00 2001
|
||||||
|
From: Ross Barnowski <rossbar@berkeley.edu>
|
||||||
|
Date: Mon, 5 Oct 2020 13:36:55 -0700
|
||||||
|
Subject: [PATCH] TST: Modify heuristic for astar path test.
|
||||||
|
|
||||||
|
Replace hash() with a sum-of-squares heuristic in
|
||||||
|
test_weight_functions so that the heuristic is not
|
||||||
|
platform-dependent.
|
||||||
|
---
|
||||||
|
networkx/algorithms/shortest_paths/tests/test_weighted.py | 2 +-
|
||||||
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/networkx/algorithms/shortest_paths/tests/test_weighted.py b/networkx/algorithms/shortest_paths/tests/test_weighted.py
|
||||||
|
index b234618c4c..a4ba92c023 100644
|
||||||
|
--- a/networkx/algorithms/shortest_paths/tests/test_weighted.py
|
||||||
|
+++ b/networkx/algorithms/shortest_paths/tests/test_weighted.py
|
||||||
|
@@ -198,7 +198,7 @@ def test_bidirectional_dijkstra(self):
|
||||||
|
|
||||||
|
def test_weight_functions(self):
|
||||||
|
def heuristic(*z):
|
||||||
|
- return hash(z)
|
||||||
|
+ return sum(val ** 2 for val in z)
|
||||||
|
|
||||||
|
def getpath(pred, v, s):
|
||||||
|
return [v] if v == s else getpath(pred, pred[v], s) + [v]
|
@ -1,17 +0,0 @@
|
|||||||
From: Antonio Larrosa <alarrosa@suse.com>
|
|
||||||
Subject: Disable test that fails on i586
|
|
||||||
|
|
||||||
The issue was reported at https://github.com/networkx/networkx/issues/4203
|
|
||||||
Index: networkx-2.5/networkx/algorithms/shortest_paths/tests/test_weighted.py
|
|
||||||
===================================================================
|
|
||||||
--- networkx-2.5.orig/networkx/algorithms/shortest_paths/tests/test_weighted.py
|
|
||||||
+++ networkx-2.5/networkx/algorithms/shortest_paths/tests/test_weighted.py
|
|
||||||
@@ -230,7 +230,7 @@ class TestWeightedPath(WeightedTestBase)
|
|
||||||
vlp(G, s, t, length, nx.single_source_dijkstra, weight)
|
|
||||||
vlp(G, s, t, length, nx.single_source_bellman_ford, weight)
|
|
||||||
vlp(G, s, t, length, goldberg_radzik, weight)
|
|
||||||
- vlp(G, s, t, length, astar, weight)
|
|
||||||
+ #vlp(G, s, t, length, astar, weight)
|
|
||||||
|
|
||||||
def weight(u, v, _):
|
|
||||||
return 2 ** (u * v)
|
|
@ -1,3 +1,11 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Tue Oct 6 11:47:47 UTC 2020 - Antonio Larrosa <alarrosa@suse.com>
|
||||||
|
|
||||||
|
- Add patch from upstream that fixes gh#networkx/networkx#4203)
|
||||||
|
* 0001-Replace-hash-function-for-test-of-weighted-astar.patch
|
||||||
|
- Drop patch that is not needed anymore:
|
||||||
|
* disable-test-failing-in-i586.patch
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Fri Sep 11 06:08:25 UTC 2020 - Antonio Larrosa <alarrosa@suse.com>
|
Fri Sep 11 06:08:25 UTC 2020 - Antonio Larrosa <alarrosa@suse.com>
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@ Summary: Python package for the study of complex networks
|
|||||||
License: BSD-3-Clause
|
License: BSD-3-Clause
|
||||||
URL: https://networkx.github.io/
|
URL: https://networkx.github.io/
|
||||||
Source: https://files.pythonhosted.org/packages/source/n/networkx/networkx-%{version}.tar.gz
|
Source: https://files.pythonhosted.org/packages/source/n/networkx/networkx-%{version}.tar.gz
|
||||||
Patch0: disable-test-failing-in-i586.patch
|
Patch0: 0001-Replace-hash-function-for-test-of-weighted-astar.patch
|
||||||
BuildRequires: %{python_module PyYAML}
|
BuildRequires: %{python_module PyYAML}
|
||||||
BuildRequires: %{python_module decorator >= 3.4.0}
|
BuildRequires: %{python_module decorator >= 3.4.0}
|
||||||
BuildRequires: %{python_module matplotlib >= 3.1}
|
BuildRequires: %{python_module matplotlib >= 3.1}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user