From e7c07e34de2fd427d9ac60dcf8d488bec6c246c079be2eaecb380fd25cdbd788 Mon Sep 17 00:00:00 2001 From: Daniel Garcia Date: Fri, 14 Oct 2022 09:15:21 +0000 Subject: [PATCH] - Update to 0.16: * Fix #86. When computing the change in modularity after alternating the block membership of a node, the resolution parameter was multiplied to the wrong term. As a result, the current code fails to correctly implement the Louvain algorithm, except for the special case when the resolution parameter is set to one. - Add fix-test-karate.patch to fix tests with networkx<=2.7 gh#taynaud/python-louvain#95 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:numeric/python-python-louvain?expand=0&rev=18 --- fix-test-karate.patch | 13 +++++++++++++ python-louvain-0.15.tar.gz | 3 --- python-louvain-0.16.tar.gz | 3 +++ python-python-louvain.changes | 13 +++++++++++++ python-python-louvain.spec | 8 +++++--- 5 files changed, 34 insertions(+), 6 deletions(-) create mode 100644 fix-test-karate.patch delete mode 100644 python-louvain-0.15.tar.gz create mode 100644 python-louvain-0.16.tar.gz diff --git a/fix-test-karate.patch b/fix-test-karate.patch new file mode 100644 index 0000000..161390d --- /dev/null +++ b/fix-test-karate.patch @@ -0,0 +1,13 @@ +Index: python-louvain-0.16/test_community.py +=================================================================== +--- python-louvain-0.16.orig/test_community.py ++++ python-louvain-0.16/test_community.py +@@ -203,7 +203,7 @@ class BestPartitionTest(unittest.TestCas + self.assertAlmostEqual(co.modularity(part, graph), + co.modularity(part_weight, + graph, +- "test_weight"), places=2) ++ "test_weight"), places=1) + + part_res_low = co.best_partition(graph, resolution=0.1) + self.assertTrue( diff --git a/python-louvain-0.15.tar.gz b/python-louvain-0.15.tar.gz deleted file mode 100644 index bc1e20d..0000000 --- a/python-louvain-0.15.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:2a856edfbe29952a60a5538a84bb78cca18f6884a88b9325e85a11c8dd4917eb -size 204601 diff --git a/python-louvain-0.16.tar.gz b/python-louvain-0.16.tar.gz new file mode 100644 index 0000000..6c672f2 --- /dev/null +++ b/python-louvain-0.16.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b7ba2df5002fd28d3ee789a49532baad11fe648e4f2117cf0798e7520a1da56b +size 204641 diff --git a/python-python-louvain.changes b/python-python-louvain.changes index 6e58360..2ab29ba 100644 --- a/python-python-louvain.changes +++ b/python-python-louvain.changes @@ -1,3 +1,16 @@ +------------------------------------------------------------------- +Fri Oct 14 09:09:53 UTC 2022 - Daniel Garcia + +- Update to 0.16: + * Fix #86. When computing the change in modularity after alternating the + block membership of a node, the resolution parameter was multiplied to the + wrong term. + As a result, the current code fails to correctly implement the Louvain + algorithm, except for the special case when the resolution parameter is set + to one. +- Add fix-test-karate.patch to fix tests with networkx<=2.7 + gh#taynaud/python-louvain#95 + ------------------------------------------------------------------- Fri Apr 23 05:57:36 UTC 2021 - Steve Kowalik diff --git a/python-python-louvain.spec b/python-python-louvain.spec index 623b4d1..03da6a5 100644 --- a/python-python-louvain.spec +++ b/python-python-louvain.spec @@ -1,7 +1,7 @@ # # spec file for package python-python-louvain # -# Copyright (c) 2021 SUSE LLC +# Copyright (c) 2022 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -20,12 +20,14 @@ %define skip_python2 1 %define skip_python36 1 Name: python-python-louvain -Version: 0.15 +Version: 0.16 Release: 0 Summary: Louvain algorithm for community detection License: BSD-3-Clause URL: https://github.com/taynaud/python-louvain Source0: https://files.pythonhosted.org/packages/source/p/python-louvain/python-louvain-%{version}.tar.gz +# PATCH-FIX-UPSTREAM fix-test-karate.patch gh#taynaud/python-louvain#95 +Patch: fix-test-karate.patch BuildRequires: %{python_module devel} BuildRequires: %{python_module numpy} BuildRequires: %{python_module setuptools} @@ -50,7 +52,7 @@ Guillaume, Renaud Lambiotte, Renaud Lefebvre, Journal of Statistical Mechanics: Theory and Experiment 2008(10), P10008 (12pp) %prep -%setup -q -n python-louvain-%{version} +%autosetup -p1 -n python-louvain-%{version} sed -i -e '/^#!\//, 1d' community/__init__.py %build