[Python-modules-commits] r29493 - in packages/python-networkx/trunk/debian (5 files)
zigo at users.alioth.debian.org
zigo at users.alioth.debian.org
Wed Jun 25 17:22:43 UTC 2014
Date: Wednesday, June 25, 2014 @ 17:22:42
Author: zigo
Revision: 29493
Removed 50_force_ordering_in_dict_to_numpy_array_functions.patch 55_fixups_to_numpy_array_functions_patch.patch
60_fix_tests_failure_due_to_py3.3_hash_randomization.patch applied upstream.
Modified:
packages/python-networkx/trunk/debian/changelog
packages/python-networkx/trunk/debian/patches/series
Deleted:
packages/python-networkx/trunk/debian/patches/50_force_ordering_in_dict_to_numpy_array_functions.patch
packages/python-networkx/trunk/debian/patches/55_fixups_to_numpy_array_functions_patch.patch
packages/python-networkx/trunk/debian/patches/60_fix_tests_failure_due_to_py3.3_hash_randomization.patch
Modified: packages/python-networkx/trunk/debian/changelog
===================================================================
--- packages/python-networkx/trunk/debian/changelog 2014-06-25 17:22:38 UTC (rev 29492)
+++ packages/python-networkx/trunk/debian/changelog 2014-06-25 17:22:42 UTC (rev 29493)
@@ -7,6 +7,10 @@
removed the clean of the egg-info folder.
* Refreshed/rebased 10_doc_relocation, 20_example_dirs_remove and
30_use_local_objects.inv patches.
+ * Removed 50_force_ordering_in_dict_to_numpy_array_functions.patch
+ 55_fixups_to_numpy_array_functions_patch.patch
+ 60_fix_tests_failure_due_to_py3.3_hash_randomization.patch applied
+ upstream.
-- Thomas Goirand <zigo at debian.org> Sun, 22 Jun 2014 07:11:42 +0000
Deleted: packages/python-networkx/trunk/debian/patches/50_force_ordering_in_dict_to_numpy_array_functions.patch
===================================================================
--- packages/python-networkx/trunk/debian/patches/50_force_ordering_in_dict_to_numpy_array_functions.patch 2014-06-25 17:22:38 UTC (rev 29492)
+++ packages/python-networkx/trunk/debian/patches/50_force_ordering_in_dict_to_numpy_array_functions.patch 2014-06-25 17:22:42 UTC (rev 29493)
@@ -1,91 +0,0 @@
-From ee8df352ae88299f1e9c7bd74db954ff06d03770 Mon Sep 17 00:00:00 2001
-From: Aric Hagberg <aric.hagberg at gmail.com>
-Date: Sat, 9 Nov 2013 09:43:26 -0700
-Subject: [PATCH] Force ordering in dict_to_numpy_array functions
-
-Force ordering to be that of the provided mapping dictionary or else create a mapping using the input data dictionary ordering.
-
-Fix tests to determine ordering.
----
- networkx/utils/misc.py | 22 +++++++++++++++-------
- networkx/utils/tests/test_misc.py | 20 +++++++++++++++-----
- 2 files changed, 30 insertions(+), 12 deletions(-)
-
---- a/networkx/utils/misc.py
-+++ b/networkx/utils/misc.py
-@@ -125,11 +125,19 @@ def dict_to_numpy_array2(d,mapping=None)
- mapping=dict(zip(s,range(len(s))))
- n=len(mapping)
- a = numpy.zeros((n, n))
-- for k1, row in d.items():
-- for k2, value in row.items():
-- i=mapping[k1]
-- j=mapping[k2]
-- a[i,j] = value
-+ print(mapping)
-+ for k1, i in mapping.items():
-+# for k1, row in d.items():
-+ for k2, j in mapping.items():
-+ try:
-+ a[i,j]=d[k1][k2]
-+ except KeyError:
-+ pass
-+# for k2, value in row.items():
-+# a[i,j] = d[k1][k2]
-+# i=mapping[k1]
-+# j=mapping[k2]
-+# a[i,j] = value
- return a
-
- def dict_to_numpy_array1(d,mapping=None):
-@@ -145,7 +153,7 @@ def dict_to_numpy_array1(d,mapping=None)
- mapping = dict(zip(s,range(len(s))))
- n = len(mapping)
- a = numpy.zeros(n)
-- for k1, value in d.items():
-+ for k1,i in mapping.items():
- i = mapping[k1]
-- a[i] = value
-+ a[i] = d[k1]
- return a
---- a/networkx/utils/tests/test_misc.py
-+++ b/networkx/utils/tests/test_misc.py
-@@ -49,7 +49,7 @@ class TestNumpyArray(object):
- def test_dict_to_numpy_array1(self):
- d = {'a':1,'b':2}
- a = dict_to_numpy_array1(d)
-- assert_equal(a, numpy.array([1,2]))
-+ assert_equal(a, numpy.array(list(d.values())))
- a = dict_to_numpy_array1(d, mapping = {'b':0,'a':1})
- assert_equal(a, numpy.array([2,1]))
-
-@@ -57,7 +57,12 @@ class TestNumpyArray(object):
- d = {'a': {'a':1,'b':2},
- 'b': {'a':10,'b':20}}
- a = dict_to_numpy_array(d)
-- assert_equal(a, numpy.array([[1,2],[10,20]]))
-+ if list(d.keys())[0] == 'a':
-+ assert_equal(a, numpy.array([[1,2],[10,20]]))
-+ elif list(d.keys())[0] == 'b':
-+ assert_equal(a, numpy.array([[20,10],[2,1]]))
-+ else:
-+ raise
- a = dict_to_numpy_array2(d, mapping = {'b':0,'a':1})
- assert_equal(a, numpy.array([[20,10],[2,1]]))
-
-@@ -66,7 +71,12 @@ class TestNumpyArray(object):
- d = {'a': {'a':1,'b':2},
- 'b': {'a':10,'b':20}}
- a = dict_to_numpy_array(d)
-- assert_equal(a, numpy.array([[1,2],[10,20]]))
-+ if list(d.keys())[0] == 'a':
-+ assert_equal(a, numpy.array([[1,2],[10,20]]))
-+ elif list(d.keys())[0] == 'b':
-+ assert_equal(a, numpy.array([[20,10],[2,1]]))
-+ else:
-+ raise
- d = {'a':1,'b':2}
-- a = dict_to_numpy_array1(d)
-- assert_equal(a, numpy.array([1,2]))
-+ a = dict_to_numpy_array(d)
-+ assert_equal(a, numpy.array(list(d.values())))
Deleted: packages/python-networkx/trunk/debian/patches/55_fixups_to_numpy_array_functions_patch.patch
===================================================================
--- packages/python-networkx/trunk/debian/patches/55_fixups_to_numpy_array_functions_patch.patch 2014-06-25 17:22:38 UTC (rev 29492)
+++ packages/python-networkx/trunk/debian/patches/55_fixups_to_numpy_array_functions_patch.patch 2014-06-25 17:22:42 UTC (rev 29493)
@@ -1,32 +0,0 @@
-From 25086b5bb00f0c879749de60bef610f37c6625a3 Mon Sep 17 00:00:00 2001
-From: Aric Hagberg <aric.hagberg at gmail.com>
-Date: Sat, 9 Nov 2013 10:56:03 -0700
-Subject: [PATCH] Clean up the mess I left in #1006
-
-Remove a print statement and some commented out code.
----
- networkx/utils/misc.py | 7 -------
- 1 file changed, 7 deletions(-)
-
---- a/networkx/utils/misc.py
-+++ b/networkx/utils/misc.py
-@@ -125,19 +125,12 @@ def dict_to_numpy_array2(d,mapping=None)
- mapping=dict(zip(s,range(len(s))))
- n=len(mapping)
- a = numpy.zeros((n, n))
-- print(mapping)
- for k1, i in mapping.items():
--# for k1, row in d.items():
- for k2, j in mapping.items():
- try:
- a[i,j]=d[k1][k2]
- except KeyError:
- pass
--# for k2, value in row.items():
--# a[i,j] = d[k1][k2]
--# i=mapping[k1]
--# j=mapping[k2]
--# a[i,j] = value
- return a
-
- def dict_to_numpy_array1(d,mapping=None):
Deleted: packages/python-networkx/trunk/debian/patches/60_fix_tests_failure_due_to_py3.3_hash_randomization.patch
===================================================================
--- packages/python-networkx/trunk/debian/patches/60_fix_tests_failure_due_to_py3.3_hash_randomization.patch 2014-06-25 17:22:38 UTC (rev 29492)
+++ packages/python-networkx/trunk/debian/patches/60_fix_tests_failure_due_to_py3.3_hash_randomization.patch 2014-06-25 17:22:42 UTC (rev 29493)
@@ -1,38 +0,0 @@
-From 8564c5e4aecfbbaa68965d5f684e705c6070e464 Mon Sep 17 00:00:00 2001
-From: Aric Hagberg <aric.hagberg at gmail.com>
-Date: Wed, 23 Oct 2013 20:45:59 -0600
-Subject: [PATCH] Fix tests that fail due to hash randomization
-
----
- networkx/algorithms/assortativity/correlation.py | 2 +-
- networkx/convert.py | 8 ++++++--
- 2 files changed, 7 insertions(+), 3 deletions(-)
-
---- a/networkx/algorithms/assortativity/correlation.py
-+++ b/networkx/algorithms/assortativity/correlation.py
-@@ -115,7 +115,7 @@ def degree_pearson_correlation_coefficie
- --------
- >>> G=nx.path_graph(4)
- >>> r=nx.degree_pearson_correlation_coefficient(G)
-- >>> r
-+ >>> print("%3.1f"%r)
- -0.5
-
- Notes
---- a/networkx/convert.py
-+++ b/networkx/convert.py
-@@ -568,8 +568,12 @@ def from_numpy_matrix(A,create_using=Non
- >>> dt=[('weight',float),('cost',int)]
- >>> A=numpy.matrix([[(1.0,2)]],dtype=dt)
- >>> G=nx.from_numpy_matrix(A)
-- >>> G.edges(data=True)
-- [(0, 0, {'cost': 2, 'weight': 1.0})]
-+ >>> G.edges()
-+ [(0, 0)]
-+ >>> G[0][0]['cost']
-+ 2
-+ >>> G[0][0]['weight']
-+ 1.0
- """
- kind_to_python_type={'f':float,
- 'i':int,
Modified: packages/python-networkx/trunk/debian/patches/series
===================================================================
--- packages/python-networkx/trunk/debian/patches/series 2014-06-25 17:22:38 UTC (rev 29492)
+++ packages/python-networkx/trunk/debian/patches/series 2014-06-25 17:22:42 UTC (rev 29493)
@@ -2,6 +2,3 @@
20_example_dirs_remove
30_use_local_objects.inv
40_no_setuptools_in_requires.txt
-50_force_ordering_in_dict_to_numpy_array_functions.patch
-55_fixups_to_numpy_array_functions_patch.patch
-60_fix_tests_failure_due_to_py3.3_hash_randomization.patch
More information about the Python-modules-commits
mailing list