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

Étienne Mollier (@emollier) gitlab at salsa.debian.org
Sun Nov 6 20:10:37 GMT 2022



Étienne Mollier pushed to branch master at Debian Med / python-leidenalg


Commits:
22816d5c by Étienne Mollier at 2022-11-06T20:54:11+01:00
New upstream version 0.9.0
- - - - -
aca5ec2b by Étienne Mollier at 2022-11-06T20:54:11+01:00
routine-update: New upstream version

- - - - -
0c2c4bb7 by Étienne Mollier at 2022-11-06T20:54:13+01:00
Update upstream source from tag 'upstream/0.9.0'

Update to upstream version '0.9.0'
with Debian dir 6f92805f37f38eca8cd709c0a51ef3bfbb06a98c
- - - - -
e220c198 by Étienne Mollier at 2022-11-06T21:09:21+01:00
leave note about possible dependency on igraph >= 0.10.

- - - - -


7 changed files:

- .github/workflows/build.yml
- CHANGELOG
- debian/changelog
- include/GraphHelper.h
- setup.py
- src/leidenalg/GraphHelper.cpp
- tests/test_VertexPartition.py


Changes:

=====================================
.github/workflows/build.yml
=====================================
@@ -13,7 +13,12 @@ on:
 env:
   CIBW_TEST_REQUIRES: ddt
   CIBW_TEST_COMMAND: "cd {project} && python -m unittest -v"
-  CIBW_SKIP: "pp* cp27-* cp35-* cp36-*"
+  CIBW_MANYLINUX_X86_64_IMAGE: "manylinux2014"
+  CIBW_MANYLINUX_I686_IMAGE: "manylinux2014"
+  CIBW_MANYLINUX_PYPY_X86_64_IMAGE: "manylinux2014"
+  CIBW_MANYLINUX_PYPY_I686_IMAGE: "manylinux2014"
+  CIBW_SKIP: "cp36-*"
+  MACOSX_DEPLOYMENT_TARGET: "10.9"  
 
 jobs:
   build_wheel_linux:
@@ -21,7 +26,7 @@ jobs:
     runs-on: ubuntu-20.04
     strategy:
       matrix:
-        wheel_arch: [x86_64, i686, aarch64]
+        wheel_arch: [x86_64, i686]
 
     steps:
       - uses: actions/checkout at v2
@@ -34,31 +39,60 @@ jobs:
         with:
           python-version: '3.8'
 
+      - name: Build wheels (manylinux)
+        uses: pypa/cibuildwheel at v2.10.2
+        env:
+          CIBW_BEFORE_BUILD: "yum install -y flex bison && pip install cmake wheel && python setup.py build_c_core"
+          CIBW_ARCHS_LINUX: ${{ matrix.wheel_arch }}          
+          CIBW_BUILD: "*-manylinux_${{ matrix.wheel_arch }}"
+
+      - name: Build wheels (musllinux)
+        uses: pypa/cibuildwheel at v2.10.2
+        env:
+          CIBW_BEFORE_BUILD: "apk add flex bison zlib-dev && pip install cmake wheel && python setup.py build_c_core"
+          CIBW_BUILD: "*-musllinux_${{ matrix.wheel_arch }}"
+          CIBW_TEST_EXTRAS: "test-musl"
+
+      - uses: actions/upload-artifact at v2
+        with:
+          path: ./wheelhouse/*.whl
+
+  build_wheel_linux_aarch64:
+    name: Build wheels on Linux (aarch64)
+    runs-on: ubuntu-20.04
+    steps:
+      - uses: actions/checkout at v2
+        with:
+          submodules: true
+          fetch-depth: 0
+
       - name: Set up QEMU
-        if: runner.os == 'Linux'
-        uses: docker/setup-qemu-action at v1
+        id: qemu
+        uses: docker/setup-qemu-action at v2
 
-      - name: Build wheels
-        uses: pypa/cibuildwheel at v2.4.0
+      - name: Build wheels (manylinux)
+        uses: pypa/cibuildwheel at v2.10.2
         env:
-          CIBW_BEFORE_BUILD: "yum install -y flex bison && pip install cmake && python setup.py build_c_core"
-          CIBW_ARCHS_LINUX: ${{ matrix.wheel_arch }}
-          CIBW_BUILD: "*-manylinux_${{ matrix.wheel_arch }}"
+          CIBW_BEFORE_BUILD: "yum install -y flex bison zlib-devel && pip install cmake wheel && python setup.py build_c_core"
+          CIBW_ARCHS_LINUX: aarch64
+          CIBW_BUILD: "*-manylinux_aarch64"
 
       - uses: actions/upload-artifact at v2
         with:
           path: ./wheelhouse/*.whl
 
   build_wheel_macos:
-    name: Build wheels on macOS
-    runs-on: macos-10.15
+    name: Build wheels on macOS (${{ matrix.wheel_arch }})
+    runs-on: macos-latest
+    env:
+      LLVM_VERSION: "14.0.5"
     strategy:
       matrix:
         include:
           - cmake_arch: x86_64
             wheel_arch: x86_64
           - cmake_arch: arm64
-            cmake_extra_args: -DF2C_EXTERNAL_ARITH_HEADER=../../../etc/arith_apple_m1.h
+            cmake_extra_args: -DF2C_EXTERNAL_ARITH_HEADER=../../../etc/arith_apple_m1.h -DIEEE754_DOUBLE_ENDIANNESS_MATCHES=ON
             wheel_arch: arm64
 
     steps:
@@ -72,7 +106,14 @@ jobs:
         uses: actions/cache at v2
         with:
           path: vendor/install
-          key: C-core-${{ runner.os }}-${{ hashFiles('.gitmodules') }}
+          key: C-core-cache-${{ runner.os }}-${{ matrix.cmake_arch }}-llvm${{ env.LLVM_VERSION }}-${{ hashFiles('.git/modules/**/HEAD') }}
+
+      - name: Cache C core dependencies
+        id: cache-c-deps
+        uses: actions/cache at v2
+        with:
+          path: ~/local
+          key: deps-cache-v2-${{ runner.os }}-${{ matrix.cmake_arch }}-llvm${{ env.LLVM_VERSION }}
 
       - uses: actions/setup-python at v2
         name: Install Python
@@ -80,14 +121,17 @@ jobs:
           python-version: '3.8'
 
       - name: Install OS dependencies
-        if: steps.cache-c-core.outputs.cache-hit != 'true' # Only needed when building the C core
+        if: steps.cache-c-core.outputs.cache-hit != 'true' || steps.cache-c-deps.outputs.cache-hit != 'true' # Only needed when building the C core
         run:
-          brew install autoconf automake libtool cmake
+          brew install ninja autoconf automake libtool cmake
 
       - name: Build wheels
-        uses: pypa/cibuildwheel at v2.4.0
+        uses: pypa/cibuildwheel at v2.10.2
         env:
+          CIBW_ARCHS_MACOS: "${{ matrix.wheel_arch }}"
           CIBW_BEFORE_BUILD: "python setup.py build_c_core"
+          CIBW_ENVIRONMENT: "LDFLAGS=-L$HOME/local/lib"
+          IGRAPH_CMAKE_EXTRA_ARGS: -DCMAKE_OSX_ARCHITECTURES=${{ matrix.cmake_arch }} ${{ matrix.cmake_extra_args }} -DCMAKE_PREFIX_PATH=$HOME/local
 
       - uses: actions/upload-artifact at v2
         with:
@@ -101,10 +145,8 @@ jobs:
         include:
           - cmake_arch: Win32
             wheel_arch: win32
-            vcpkg_arch: x86
           - cmake_arch: x64
             wheel_arch: win_amd64
-            vcpkg_arch: x64
 
     steps:
       - uses: actions/checkout at v2
@@ -122,18 +164,19 @@ jobs:
         uses: actions/cache at v2
         with:
           path: vendor/install
-          key: C-core-build-${{ runner.os }}-${{ matrix.cmake_arch }}-${{ hashFiles('.gitmodules') }}-
+          key: C-core-cache-${{ runner.os }}-${{ matrix.cmake_arch }}-${{ hashFiles('.git/modules/**/HEAD') }}
 
       - name: Install build dependencies
         if: steps.cache-c-core.outputs.cache-hit != 'true' # Only needed when building the C core
-        run: choco install winflexbison3 cmake
+        run: choco install winflexbison3 cmake ninja
 
       - name: Build wheels
-        uses: pypa/cibuildwheel at v2.4.0
+        uses: pypa/cibuildwheel at v2.10.2
         env:
           CIBW_BEFORE_BUILD: "python setup.py build_c_core"
           CIBW_BUILD: "*-${{ matrix.wheel_arch }}"
-          IGRAPH_CMAKE_EXTRA_ARGS: -DCMAKE_BUILD_TYPE=Release -A ${{ matrix.cmake_arch }}
+          IGRAPH_CMAKE_EXTRA_ARGS: -DCMAKE_BUILD_TYPE=RelWithDebInfo -A ${{ matrix.cmake_arch }}
+          IGRAPH_STATIC_EXTENSION: True
           CIBW_TEST_COMMAND: "cd /d {project} && python -m unittest -v"
 
       - uses: actions/upload-artifact at v2
@@ -154,14 +197,13 @@ jobs:
         uses: actions/cache at v2
         with:
           path: |
-            vendor/build
             vendor/install
-          key: C-core-${{ runner.os }}-${{ hashFiles('.gitmodules') }}-4
+          key: C-core-cache-${{ runner.os }}-${{ hashFiles('.git/modules/**/HEAD') }}
 
       - name: Install OS dependencies
         if: steps.cache-c-core.outputs.cache-hit != 'true' # Only needed when building the C core
         run:
-          sudo apt install cmake flex bison
+          sudo apt install ninja-build cmake flex bison
 
       - uses: actions/setup-python at v2
         name: Install Python


=====================================
CHANGELOG
=====================================
@@ -1,3 +1,6 @@
+0.9.0
+- Update C core to 0.10.1
+
 0.8.10
 - Fixed installation from source package (issue #101)
 


=====================================
debian/changelog
=====================================
@@ -1,3 +1,11 @@
+python-leidenalg (0.9.0-1) UNRELEASED; urgency=medium
+
+  * New upstream version
+ NOTE: it seems igraph >= 0.10 is needed before an upgrade is possible[1].
+ [1]: https://github.com/vtraag/leidenalg/issues/112
+
+ -- Étienne Mollier <emollier at debian.org>  Sun, 06 Nov 2022 20:54:11 +0100
+
 python-leidenalg (0.8.10-1) unstable; urgency=medium
 
   * New upstream version


=====================================
include/GraphHelper.h
=====================================
@@ -172,7 +172,7 @@ class Graph
 
   private:
     igraph_t* _graph;
-    igraph_vector_t _temp_igraph_vector;
+    igraph_vector_int_t _temp_igraph_vector;
 
     // Utility variables to easily access the strength of each node
     vector<double> _strength_in;


=====================================
setup.py
=====================================
@@ -7,13 +7,18 @@ import sys
 ###########################################################################
 
 # Check Python's version info and exit early if it is too old
-if sys.version_info < (3, 6):
-    print("This module requires Python >= 3.6")
+if sys.version_info < (3, 7):
+    print("This module requires Python >= 3.7")
     sys.exit(0)
 
 ###########################################################################
 
-from setuptools import setup, Command, Extension
+from setuptools import find_packages, setup, Command, Extension
+
+try:
+    from wheel.bdist_wheel import bdist_wheel
+except ImportError:
+    bdist_wheel = None
 
 import glob
 import shlex
@@ -230,7 +235,7 @@ class IgraphCCoreCMakeBuilder:
         args = [cmake]
 
         # Build the Python interface with vendored libraries
-        for deps in "ARPACK BLAS CXSPARSE GLPK GMP LAPACK".split():
+        for deps in "ARPACK BLAS GLPK GMP LAPACK".split():
             args.append("-DIGRAPH_USE_INTERNAL_" + deps + "=ON")
 
         # -fPIC is needed on Linux so we can link to a static igraph lib from a
@@ -795,6 +800,29 @@ class BuildConfiguration:
 
 ###########################################################################
 
+if bdist_wheel is not None:
+    class bdist_wheel_abi3(bdist_wheel):
+        def get_tag(self):
+            python, abi, plat = super().get_tag()
+            if python.startswith("cp"):
+                # on CPython, our wheels are abi3 and compatible back to 3.9
+                return "cp39", "abi3", plat
+
+            return python, abi, plat
+else:
+    bdist_wheel_abi3 = None
+
+# We are going to build an abi3 wheel if we are at least on CPython 3.9.
+# This is because the C code contains conditionals for CPython 3.7 and
+# 3.8 so we cannot use an abi3 wheel built with CPython 3.7 or 3.8 on
+# CPython 3.9
+should_build_abi3_wheel = (
+    False and # Disable abi3 wheels for now
+    bdist_wheel_abi3 and
+    platform.python_implementation() == "CPython" and
+    sys.version_info >= (3, 9)
+)
+
 # Process command line options
 buildcfg = BuildConfiguration()
 buildcfg.process_args_from_command_line()
@@ -802,40 +830,54 @@ buildcfg.process_args_from_command_line()
 
 
 # Define the extension
+macros = []
+if should_build_abi3_wheel:
+    macros.append(("Py_LIMITED_API", "0x03090000"))
 leiden_ext = Extension('leidenalg._c_leiden',
                     sources = glob.glob(os.path.join('src', 'leidenalg', '*.cpp')),
+                    py_limited_api=should_build_abi3_wheel,
+                    define_macros=macros,
                     include_dirs=['include']);
 
-options =  dict(
-  name = 'leidenalg',
-  description = 'Leiden is a general algorithm for methods of community detection in large networks.',
-  long_description=
-    """
- Leiden is a general algorithm for methods of community detection in large networks.
+description = """
+Leiden is a general algorithm for methods of community detection in large networks.
 
- Please refer to the `documentation <http://leidenalg.readthedocs.io/en/latest>`_
- for more details.
+Please refer to the `documentation <http://leidenalg.readthedocs.io/en/latest>`_
+for more details.
 
- The source code of this package is hosted at `GitHub <https://github.com/vtraag/leidenalg>`_.
- Issues and bug reports are welcome at https://github.com/vtraag/leidenalg/issues.
-    """,
-  license = 'GPLv3+',
-  url = 'https://github.com/vtraag/leidenalg',
+The source code of this package is hosted at `GitHub <https://github.com/vtraag/leidenalg>`_.
+Issues and bug reports are welcome at https://github.com/vtraag/leidenalg/issues.
+"""
+
+cmdclass = {
+    "build_c_core": buildcfg.build_c_core,  # used by CI
+    "build_ext": buildcfg.build_ext,
+    "sdist": buildcfg.sdist,
+}
 
+if should_build_abi3_wheel:
+    cmdclass["bdist_wheel"] = bdist_wheel_abi3
+
+options =  dict(
+  name = 'leidenalg',
   use_scm_version={
         'write_to': 'src/leidenalg/version.py',
   },
-  setup_requires=['setuptools_scm'],
-
+  setup_requires=['setuptools_scm'],  
+  url = 'https://github.com/vtraag/leidenalg',
+  description = 'Leiden is a general algorithm for methods of community detection in large networks.',
+  long_description=description,
+  license = 'GPLv3+',
   author = 'V.A. Traag',
   author_email = 'vincent at traag.net',
+  ext_modules = [leiden_ext],  
   test_suite = 'tests',
+  package_dir = {'leidenalg': os.path.join('src', 'leidenalg')},
+  packages = ['leidenalg'],  
 
   provides = ['leidenalg'],
-  package_dir = {'leidenalg': os.path.join('src', 'leidenalg')},
-  packages = ['leidenalg'],
-  ext_modules = [leiden_ext],
-  install_requires = ['igraph >= 0.9.0,< 0.10'],
+  python_requires=">=3.7",
+  install_requires = ['igraph >= 0.10.0,< 0.11'],
   platforms="ALL",
   keywords=[
     'graph',
@@ -859,11 +901,7 @@ options =  dict(
       'Topic :: Scientific/Engineering :: Information Analysis',
       'Topic :: Sociology'
     ],
-    cmdclass={
-        "build_c_core": buildcfg.build_c_core,  # used by CI
-        "build_ext": buildcfg.build_ext,
-        "sdist": buildcfg.sdist
-    },
+    cmdclass=cmdclass,
 )
 
 setup(**options)


=====================================
src/leidenalg/GraphHelper.cpp
=====================================
@@ -89,7 +89,7 @@ Graph::Graph(igraph_t* graph,
   this->_node_self_weights = node_self_weights;
 
   this->_correct_self_loops = correct_self_loops;
-  igraph_vector_init(&this->_temp_igraph_vector, this->vcount());
+  igraph_vector_int_init(&this->_temp_igraph_vector, this->vcount());
   this->init_admin();
 }
 
@@ -113,7 +113,7 @@ Graph::Graph(igraph_t* graph,
   this->_correct_self_loops = this->has_self_loops();
 
   this->_node_self_weights = node_self_weights;
-  igraph_vector_init(&this->_temp_igraph_vector, this->vcount());
+  igraph_vector_int_init(&this->_temp_igraph_vector, this->vcount());
   this->init_admin();
 }
 
@@ -134,7 +134,7 @@ Graph::Graph(igraph_t* graph,
   this->_node_sizes = node_sizes;
 
   this->_correct_self_loops = correct_self_loops;
-  igraph_vector_init(&this->_temp_igraph_vector, this->vcount());
+  igraph_vector_int_init(&this->_temp_igraph_vector, this->vcount());
   this->init_admin();
   this->set_self_weights();
 }
@@ -156,7 +156,7 @@ Graph::Graph(igraph_t* graph,
 
   this->_correct_self_loops = this->has_self_loops();
 
-  igraph_vector_init(&this->_temp_igraph_vector, this->vcount());
+  igraph_vector_int_init(&this->_temp_igraph_vector, this->vcount());
   this->init_admin();
   this->set_self_weights();
 }
@@ -171,7 +171,7 @@ Graph::Graph(igraph_t* graph, vector<double> const& edge_weights, int correct_se
   this->_edge_weights = edge_weights;
   this->_is_weighted = true;
   this->set_default_node_size();
-  igraph_vector_init(&this->_temp_igraph_vector, this->vcount());
+  igraph_vector_int_init(&this->_temp_igraph_vector, this->vcount());
   this->init_admin();
   this->set_self_weights();
 }
@@ -188,7 +188,7 @@ Graph::Graph(igraph_t* graph, vector<double> const& edge_weights)
   this->_correct_self_loops = this->has_self_loops();
 
   this->set_default_node_size();
-  igraph_vector_init(&this->_temp_igraph_vector, this->vcount());
+  igraph_vector_int_init(&this->_temp_igraph_vector, this->vcount());
   this->init_admin();
   this->set_self_weights();
 }
@@ -205,7 +205,7 @@ Graph::Graph(igraph_t* graph, vector<size_t> const& node_sizes, int correct_self
 
   this->set_default_edge_weight();
   this->_is_weighted = false;
-  igraph_vector_init(&this->_temp_igraph_vector, this->vcount());
+  igraph_vector_int_init(&this->_temp_igraph_vector, this->vcount());
   this->init_admin();
   this->set_self_weights();
 }
@@ -224,7 +224,7 @@ Graph::Graph(igraph_t* graph, vector<size_t> const& node_sizes)
 
   this->_correct_self_loops = this->has_self_loops();
 
-  igraph_vector_init(&this->_temp_igraph_vector, this->vcount());
+  igraph_vector_int_init(&this->_temp_igraph_vector, this->vcount());
   this->init_admin();
   this->set_self_weights();
 }
@@ -236,7 +236,7 @@ Graph::Graph(igraph_t* graph, int correct_self_loops)
   this->_correct_self_loops = correct_self_loops;
   this->set_defaults();
   this->_is_weighted = false;
-  igraph_vector_init(&this->_temp_igraph_vector, this->vcount());
+  igraph_vector_int_init(&this->_temp_igraph_vector, this->vcount());
   this->init_admin();
   this->set_self_weights();
 }
@@ -250,7 +250,7 @@ Graph::Graph(igraph_t* graph)
 
   this->_correct_self_loops = this->has_self_loops();
 
-  igraph_vector_init(&this->_temp_igraph_vector, this->vcount());
+  igraph_vector_int_init(&this->_temp_igraph_vector, this->vcount());
   this->init_admin();
   this->set_self_weights();
 }
@@ -262,7 +262,7 @@ Graph::Graph()
   this->set_defaults();
   this->_is_weighted = false;
   this->_correct_self_loops = false;
-  igraph_vector_init(&this->_temp_igraph_vector, this->vcount());
+  igraph_vector_int_init(&this->_temp_igraph_vector, this->vcount());
   this->init_admin();
   this->set_self_weights();
 }
@@ -274,26 +274,13 @@ Graph::~Graph()
     igraph_destroy(this->_graph);
     delete this->_graph;
   }
-  igraph_vector_destroy(&this->_temp_igraph_vector);
+  igraph_vector_int_destroy(&this->_temp_igraph_vector);
 }
 
 int Graph::has_self_loops()
 {
-  size_t m = this->ecount();
-  igraph_vector_bool_t loop;
-  igraph_vector_bool_init(&loop, m);
-  igraph_is_loop(this->_graph, &loop, igraph_ess_all(IGRAPH_EDGEORDER_ID));
-
-  int has_self_loops = false;
-  for (size_t idx = 0; idx < m; idx++)
-  {
-    if (VECTOR(loop)[idx])
-    {
-      has_self_loops = true;
-      break;
-    }
-  }
-  igraph_vector_bool_destroy(&loop);
+  igraph_bool_t has_self_loops;  
+  igraph_has_loop(this->_graph, &has_self_loops);
   return has_self_loops;
 }
 
@@ -461,7 +448,7 @@ void Graph::cache_neighbour_edges(size_t v, igraph_neimode_t mode)
     cerr << "Degree: " << degree << endl;
   #endif
 
-  igraph_vector_t *incident_edges = &this->_temp_igraph_vector;
+  igraph_vector_int_t *incident_edges = &this->_temp_igraph_vector;
   igraph_incident(this->_graph, incident_edges, v, mode);
 
   vector<size_t>* _cached_neigh_edges = NULL;
@@ -480,8 +467,8 @@ void Graph::cache_neighbour_edges(size_t v, igraph_neimode_t mode)
       _cached_neigh_edges = &(this->_cached_neigh_edges_all);
       break;
   }
-  _cached_neigh_edges->assign(igraph_vector_e_ptr(incident_edges, 0),
-                              igraph_vector_e_ptr(incident_edges, degree));
+  _cached_neigh_edges->assign(igraph_vector_int_get_ptr(incident_edges, 0),
+                              igraph_vector_int_get_ptr(incident_edges, degree));
   #ifdef DEBUG
     cerr << "Number of edges: " << _cached_neigh_edges->size() << endl;
   #endif
@@ -533,7 +520,7 @@ void Graph::cache_neighbours(size_t v, igraph_neimode_t mode)
     cerr << "Degree: " << degree << endl;
   #endif
 
-  igraph_vector_t *neighbours = &this->_temp_igraph_vector;
+  igraph_vector_int_t *neighbours = &this->_temp_igraph_vector;
   igraph_neighbors(this->_graph, neighbours, v, mode);
 
   vector<size_t>* _cached_neighs = NULL;
@@ -552,7 +539,8 @@ void Graph::cache_neighbours(size_t v, igraph_neimode_t mode)
       _cached_neighs = &(this->_cached_neighs_all);
       break;
   }
-  _cached_neighs->assign(igraph_vector_e_ptr(neighbours, 0),igraph_vector_e_ptr(neighbours, degree));
+  _cached_neighs->assign(igraph_vector_int_get_ptr(neighbours, 0),
+                         igraph_vector_int_get_ptr(neighbours, degree));
 
   #ifdef DEBUG
     cerr << "Number of edges: " << _cached_neighs->size() << endl;
@@ -708,8 +696,8 @@ Graph* Graph::collapse_graph(MutableVertexPartition* partition)
   vector<bool> neighbour_comm_added(n_collapsed, false);
 
   // collapsed edges for new graph
-  igraph_vector_t edges;
-  igraph_vector_init(&edges, 0);
+  igraph_vector_int_t edges;
+  igraph_vector_int_init(&edges, 0);
 
   for (size_t v_comm = 0; v_comm < n_collapsed; v_comm++) {
     vector<size_t> neighbour_communities;
@@ -739,8 +727,8 @@ Graph* Graph::collapse_graph(MutableVertexPartition* partition)
     }
 
     for (size_t u_comm : neighbour_communities) {
-        igraph_vector_push_back(&edges, v_comm);
-        igraph_vector_push_back(&edges, u_comm);
+        igraph_vector_int_push_back(&edges, v_comm);
+        igraph_vector_int_push_back(&edges, u_comm);
         collapsed_weights.push_back(edge_weight_to_community[u_comm]);
         total_collapsed_weight += edge_weight_to_community[u_comm];
 
@@ -753,7 +741,7 @@ Graph* Graph::collapse_graph(MutableVertexPartition* partition)
   // Create graph based on edges
   igraph_t* graph = new igraph_t();
   igraph_create(graph, &edges, n_collapsed, this->is_directed());
-  igraph_vector_destroy(&edges);
+  igraph_vector_int_destroy(&edges);
 
   if ((size_t) igraph_vcount(graph) != partition->n_communities())
     throw Exception("Something went wrong with collapsing the graph.");


=====================================
tests/test_VertexPartition.py
=====================================
@@ -43,11 +43,11 @@ graphs = [
 
     ###########################################################################
     # Tree
-    name_object(ig.Graph.Tree(100, 3, type=ig.TREE_UNDIRECTED),
+    name_object(ig.Graph.Tree(100, 3, mode='undirected'),
                 'Tree_undirected'),
-    name_object(ig.Graph.Tree(100, 3, type=ig.TREE_OUT),
+    name_object(ig.Graph.Tree(100, 3, mode='out'),
                 'Tree_directed_out'),
-    name_object(ig.Graph.Tree(100, 3, type=ig.TREE_IN),
+    name_object(ig.Graph.Tree(100, 3, mode='in'),
                 'Tree_directed_in'),
 
     ###########################################################################



View it on GitLab: https://salsa.debian.org/med-team/python-leidenalg/-/compare/3fd96352807778c7a6a6ce4d800dd0e0897160e4...e220c198736aa2e7e8f791087e08ce98c499a9a6

-- 
View it on GitLab: https://salsa.debian.org/med-team/python-leidenalg/-/compare/3fd96352807778c7a6a6ce4d800dd0e0897160e4...e220c198736aa2e7e8f791087e08ce98c499a9a6
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/20221106/b39724f6/attachment-0001.htm>


More information about the debian-med-commit mailing list