[med-svn] [Git][med-team/python-leidenalg][master] 4 commits: New upstream version 0.8.8

Nilesh Patra (@nilesh) gitlab at salsa.debian.org
Tue Oct 19 12:23:39 BST 2021



Nilesh Patra pushed to branch master at Debian Med / python-leidenalg


Commits:
429e6b91 by Nilesh Patra at 2021-10-19T16:49:05+05:30
New upstream version 0.8.8
- - - - -
42340a3e by Nilesh Patra at 2021-10-19T16:49:05+05:30
Bump Standards-Version to 4.6.0 (no changes needed)

- - - - -
3a149ef7 by Nilesh Patra at 2021-10-19T16:49:05+05:30
Test depend on python3-all

- - - - -
8968baa1 by Nilesh Patra at 2021-10-19T16:49:05+05:30
Upload to unstable

- - - - -


7 changed files:

- CHANGELOG
- debian/changelog
- debian/control
- debian/tests/control
- doc/source/advanced.rst
- src/leidenalg/MutableVertexPartition.cpp
- src/leidenalg/python_optimiser_interface.cpp


Changes:

=====================================
CHANGELOG
=====================================
@@ -1,3 +1,7 @@
+0.8.8
+- Corrected relabeling bug (PR #82)
+- Improved error handling, avoiding some crashses (issue #81)
+
 0.8.7
 - Improved numerical stability
 


=====================================
debian/changelog
=====================================
@@ -1,3 +1,11 @@
+python-leidenalg (0.8.8-1) unstable; urgency=medium
+
+  * New upstream version 0.8.8
+  * Bump Standards-Version to 4.6.0 (no changes needed)
+  * Test depend on python3-all
+
+ -- Nilesh Patra <nilesh at debian.org>  Tue, 19 Oct 2021 16:45:21 +0530
+
 python-leidenalg (0.8.7-1) unstable; urgency=medium
 
   * New upstream version 0.8.7


=====================================
debian/control
=====================================
@@ -13,7 +13,7 @@ Build-Depends: debhelper-compat (= 13),
                python3-ddt <!nocheck>,
                python3-igraph <!nocheck>,
                python3-wheel <!nocheck>
-Standards-Version: 4.5.1
+Standards-Version: 4.6.0
 Vcs-Browser: https://salsa.debian.org/med-team/python-leidenalg
 Vcs-Git: https://salsa.debian.org/med-team/python-leidenalg.git
 Homepage: https://github.com/vtraag/leidenalg


=====================================
debian/tests/control
=====================================
@@ -1,3 +1,3 @@
 Tests: run-unit-test
-Depends: @, python3-pytest, python3-ddt
+Depends: @, python3-pytest, python3-ddt, python3-all
 Restrictions: allow-stderr


=====================================
doc/source/advanced.rst
=====================================
@@ -222,7 +222,7 @@ We can then only update the community assignments for the new nodes as follows
 >>> new_partition = la.CPMVertexPartition(G2, new_membership,
 ...                                       resolution_parameter=partition.resolution_parameter)
 ... is_membership_fixed = [i < G.vcount() for i in range(G2.vcount())]
->>> diff = optimiser.optimise_partition(partition, is_membership_fixed=is_membership_fixed)
+>>> diff = optimiser.optimise_partition(new_partition, is_membership_fixed=is_membership_fixed)
 
 In this example we used :class:`~leidenalg.CPMVertexPartition`. but any other
 ``VertexPartition`` would work as well.


=====================================
src/leidenalg/MutableVertexPartition.cpp
=====================================
@@ -286,9 +286,10 @@ void MutableVertexPartition::relabel_communities(vector<size_t> const& new_comm_
   vector<size_t> new_csize(nbcomms, 0);
   vector<size_t> new_cnodes(nbcomms, 0);
 
+  // Relabel community admin
   for (size_t c = 0; c < new_comm_id.size(); c++) {
     size_t new_c = new_comm_id[c];
-    if (this->_csize[c] > 0) {
+    if (this->_cnodes[c] > 0) {
       new_total_weight_in_comm[new_c] = this->_total_weight_in_comm[c];
       new_total_weight_from_comm[new_c] = this->_total_weight_from_comm[c];
       new_total_weight_to_comm[new_c] = this->_total_weight_to_comm[c];
@@ -305,7 +306,7 @@ void MutableVertexPartition::relabel_communities(vector<size_t> const& new_comm_
 
   this->_empty_communities.clear();
   for (size_t c = 0; c < nbcomms; c++) {
-    if (this->_csize[c] == 0) {
+    if (this->_cnodes[c] == 0) {
       this->_empty_communities.push_back(c);
     }
   }


=====================================
src/leidenalg/python_optimiser_interface.cpp
=====================================
@@ -83,7 +83,8 @@ extern "C"
       size_t nb_is_membership_fixed = PyList_Size(py_is_membership_fixed);
       if (nb_is_membership_fixed != n)
       {
-        throw Exception("Node size vector not the same size as the number of nodes.");
+        PyErr_SetString(PyExc_ValueError, "Node size vector not the same size as the number of nodes.");
+        return NULL;
       }
 
       for (size_t v = 0; v < n; v++)
@@ -167,7 +168,10 @@ extern "C"
       }
 
       if (isnan(layer_weights[layer]))
-        throw Exception("Cannot accept NaN weights.");
+      {
+        PyErr_SetString(PyExc_TypeError, "Cannot accept NaN weights.");
+        return NULL;
+      }
     }
 
     if (nb_partitions == 0)
@@ -184,7 +188,8 @@ extern "C"
       size_t nb_is_membership_fixed = PyList_Size(py_is_membership_fixed);
       if (nb_is_membership_fixed != n)
       {
-        throw Exception("Node size vector not the same size as the number of nodes.");
+        PyErr_SetString(PyExc_TypeError, "Node size vector not the same size as the number of nodes.");
+        return NULL;
       }
 
       for (size_t v = 0; v < n; v++)
@@ -265,7 +270,8 @@ extern "C"
       size_t nb_is_membership_fixed = PyList_Size(py_is_membership_fixed);
       if (nb_is_membership_fixed != n)
       {
-        throw Exception("Node size vector not the same size as the number of nodes.");
+        PyErr_SetString(PyExc_TypeError, "Node size vector not the same size as the number of nodes.");
+        return NULL;
       }
 
       for (size_t v = 0; v < n; v++)
@@ -340,7 +346,8 @@ extern "C"
       size_t nb_is_membership_fixed = PyList_Size(py_is_membership_fixed);
       if (nb_is_membership_fixed != n)
       {
-        throw Exception("Node size vector not the same size as the number of nodes.");
+        PyErr_SetString(PyExc_TypeError, "Node size vector not the same size as the number of nodes.");
+        return NULL;
       }
 
       for (size_t v = 0; v < n; v++)



View it on GitLab: https://salsa.debian.org/med-team/python-leidenalg/-/compare/62e9753221365bd726a3c97986544550f7666c80...8968baa1e58ceeca93ec5a3ddb35043d146c039e

-- 
View it on GitLab: https://salsa.debian.org/med-team/python-leidenalg/-/compare/62e9753221365bd726a3c97986544550f7666c80...8968baa1e58ceeca93ec5a3ddb35043d146c039e
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20211019/5f8b09f0/attachment-0001.htm>


More information about the debian-med-commit mailing list