1
0

Accepting request 839779 from home:alarrosa:branches:devel:languages:python:numeric

- 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

OBS-URL: https://build.opensuse.org/request/show/839779
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:numeric/python-networkx?expand=0&rev=28
This commit is contained in:
Antonio Larrosa 2020-10-06 11:51:12 +00:00 committed by Git OBS Bridge
parent 8d51cc5087
commit 143862eac7
4 changed files with 34 additions and 18 deletions

View 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]

View File

@ -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)

View File

@ -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>

View File

@ -25,7 +25,7 @@ Summary: Python package for the study of complex networks
License: BSD-3-Clause
URL: https://networkx.github.io/
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 decorator >= 3.4.0}
BuildRequires: %{python_module matplotlib >= 3.1}