[med-svn] [Git][med-team/python-leidenalg][upstream] New upstream version 0.11.0

Nilesh Patra (@nilesh) gitlab at salsa.debian.org
Sat Nov 1 16:33:12 GMT 2025



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


Commits:
de0c8afc by Nilesh Patra at 2025-11-01T21:51:13+05:30
New upstream version 0.11.0
- - - - -


16 changed files:

- − .github/dependabot.yml
- − .github/workflows/build.yml
- CHANGELOG
- README.rst
- build-doc.yml
- doc/source/conf.py
- doc/source/intro.rst
- pyproject.toml
- scripts/build_igraph.bat
- scripts/build_igraph.sh
- scripts/build_libleidenalg.bat
- scripts/build_libleidenalg.sh
- setup.py
- src/leidenalg/Optimiser.py
- src/leidenalg/VertexPartition.py
- src/leidenalg/python_optimiser_interface.cpp


Changes:

=====================================
.github/dependabot.yml deleted
=====================================
@@ -1,6 +0,0 @@
-version: 2
-updates:
-  - package-ecosystem: "github-actions"
-    directory: "/"
-    schedule:
-      interval: "weekly"


=====================================
.github/workflows/build.yml deleted
=====================================
@@ -1,257 +0,0 @@
-name: Build and test, upload to PyPI on release
-
-on:
-  push:
-    branches:
-      - master
-      - '*'
-    tags:
-      - '*'
-  pull_request:
-    branches:
-      - master
-
-env:
-  CIBW_TEST_REQUIRES: ddt
-  CIBW_TEST_COMMAND: "cd {project} && python -m unittest -v"
-  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:
-    name: Build wheels on Linux (${{ matrix.wheel_arch }})
-    runs-on: ubuntu-20.04
-    strategy:
-      fail-fast: false
-      matrix:
-        wheel_arch: [x86_64, i686]
-
-    steps:
-      - uses: actions/checkout at v4
-        with:
-          submodules: true
-          fetch-depth: 0
-
-      - uses: actions/setup-python at v5
-        name: Install Python
-        with:
-          python-version: '3.8'
-
-      - name: Build wheels (manylinux)
-        uses: pypa/cibuildwheel at v2.16.2
-        env:
-          CIBW_BEFORE_BUILD: "yum install -y flex bison &&
-                              pip install cmake wheel &&
-                              {package}/scripts/build_igraph.sh &&
-                              {package}/scripts/build_libleidenalg.sh "
-          CIBW_ARCHS_LINUX: ${{ matrix.wheel_arch }}
-          CIBW_BUILD: "*-manylinux_${{ matrix.wheel_arch }}"
-          CIBW_ENVIRONMENT: >
-            CFLAGS='-I/project/build-deps/install/include/ -L/project/build-deps/install/lib64/ -L/project/build-deps/install/lib/'
-            LD_LIBRARY_PATH='/project/build-deps/install/lib64/:/project/build-deps/install/lib/'
-
-      - name: Build wheels (musllinux)
-        uses: pypa/cibuildwheel at v2.16.2
-        env:
-          CIBW_BEFORE_BUILD: "apk add flex bison zlib-dev &&
-                              pip install cmake wheel &&
-                              {package}/scripts/build_igraph.sh &&
-                              {package}/scripts/build_libleidenalg.sh"
-          CIBW_BUILD: "*-musllinux_${{ matrix.wheel_arch }}"
-          CIBW_TEST_EXTRAS: "test-musl"
-          CIBW_ENVIRONMENT: >
-            CFLAGS='-I/project/build-deps/install/include/ -L/project/build-deps/install/lib64/ -L/project/build-deps/install/lib/'
-            LD_LIBRARY_PATH='/project/build-deps/install/lib64/:/project/build-deps/install/lib/'
-
-      - uses: actions/upload-artifact at v4
-        with:
-          name: wheels-linux-${{ matrix.wheel_arch }}
-          path: ./wheelhouse/*.whl
-
-  build_wheel_linux_aarch64:
-    name: Build wheels on Linux (aarch64)
-    runs-on: ubuntu-20.04
-    steps:
-      - uses: actions/checkout at v4
-        with:
-          submodules: true
-          fetch-depth: 0
-
-      - name: Set up QEMU
-        id: qemu
-        uses: docker/setup-qemu-action at v3
-
-      - name: Build wheels (manylinux)
-        uses: pypa/cibuildwheel at v2.16.2
-        env:
-          CIBW_BEFORE_BUILD: "yum install -y flex bison zlib-devel &&
-                              pip install cmake wheel &&
-                              {package}/scripts/build_igraph.sh &&
-                              {package}/scripts/build_libleidenalg.sh"
-          CIBW_ARCHS_LINUX: aarch64
-          CIBW_BUILD: "*-manylinux_aarch64"
-          CIBW_ENVIRONMENT: >
-            CFLAGS='-I/project/build-deps/install/include/ -L/project/build-deps/install/lib64/ -L/project/build-deps/install/lib/'
-            LD_LIBRARY_PATH='/project/build-deps/install/lib64/:/project/build-deps/install/lib/'
-
-      - uses: actions/upload-artifact at v4
-        with:
-          name: wheels-linux-aarch64
-          path: ./wheelhouse/*.whl
-
-  build_wheel_macos:
-    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
-            extra_cmake_args: -DF2C_EXTERNAL_ARITH_HEADER=../../../etc/arith_apple_m1.h -DIEEE754_DOUBLE_ENDIANNESS_MATCHES=ON
-            wheel_arch: arm64
-
-    steps:
-      - uses: actions/checkout at v4
-        with:
-          submodules: true
-          fetch-depth: 0
-
-      - name: Cache installed C core
-        id: cache-c-core
-        uses: actions/cache at v3
-        with:
-          path: build-deps
-          key: C-core-cache-${{ runner.os }}-${{ matrix.cmake_arch }}-llvm${{ env.LLVM_VERSION }}-${{ hashFiles('scripts/build_igraph.sh') }}-${{ hashFiles('scripts/build_libleidenalg.sh') }}
-
-      - uses: actions/setup-python at v5
-        name: Install Python
-        with:
-          python-version: '3.8'
-
-      - name: Install OS dependencies
-        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 ninja cmake
-
-      - name: Build wheels
-        uses: pypa/cibuildwheel at v2.16.2
-        env:
-          CIBW_ARCHS_MACOS: "${{ matrix.wheel_arch }}"
-          CIBW_BEFORE_BUILD: "{package}/scripts/build_igraph.sh &&
-                             {package}/scripts/build_libleidenalg.sh"
-          CIBW_ENVIRONMENT: >
-            CFLAGS='-Wno-unused-command-line-argument -I/Users/runner/work/leidenalg/leidenalg/build-deps/install/include/ -L/Users/runner/work/leidenalg/leidenalg/build-deps/install/lib64/ -L/Users/runner/work/leidenalg/leidenalg/build-deps/install/lib/'
-            REPAIR_LIBRARY_PATH="${DYLD_LIBRARY_PATH}:/Users/runner/work/leidenalg/leidenalg/build-deps/install/lib64/:/Users/runner/work/leidenalg/leidenalg/build-deps/install/lib/"
-            EXTRA_CMAKE_ARGS="-DCMAKE_OSX_ARCHITECTURES=${{ matrix.cmake_arch }} ${{ matrix.extra_cmake_args }}"
-          CIBW_REPAIR_WHEEL_COMMAND: >
-            DYLD_LIBRARY_PATH=$REPAIR_LIBRARY_PATH delocate-wheel --require-archs {delocate_archs} -w {dest_dir} -v {wheel}
-      - uses: actions/upload-artifact at v4
-        with:
-          name: wheels-macos-${{ matrix.wheel_arch }}
-          path: ./wheelhouse/*.whl
-
-  build_wheel_win:
-    name: Build wheels on Windows (${{ matrix.cmake_arch }})
-    runs-on: windows-2022
-    strategy:
-      fail-fast: false
-      matrix:
-        include:
-          - cmake_arch: Win32
-            wheel_arch: win32
-          - cmake_arch: x64
-            wheel_arch: win_amd64
-
-    steps:
-      - uses: actions/checkout at v4
-        with:
-          submodules: true
-          fetch-depth: 0
-
-      - uses: actions/setup-python at v5
-        name: Install Python
-        with:
-          python-version: '3.8'
-
-      - name: Cache installed C core
-        id: cache-c-core
-        uses: actions/cache at v3
-        with:
-          path: build-deps
-          key: C-core-cache-${{ runner.os }}-${{ matrix.cmake_arch }}-llvm${{ env.LLVM_VERSION }}-${{ hashFiles('scripts/build_igraph.sh') }}-${{ hashFiles('scripts/build_libleidenalg.sh') }}
-
-      - 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 ninja
-
-      - name: Build wheels
-        uses: pypa/cibuildwheel at v2.16.2
-        env:
-          CIBW_BEFORE_BUILD: "{package}/scripts/build_igraph.bat &&
-                              {package}/scripts/build_libleidenalg.bat &&
-                              pip install delvewheel"
-          CIBW_BUILD: "*-${{ matrix.wheel_arch }}"
-          CIBW_TEST_COMMAND: "cd /d {project} && python -m unittest -v"
-          CIBW_SKIP: "cp36-* pp*"
-          CIBW_ENVIRONMENT: >
-            LIB="D:/a/leidenalg/leidenalg/build-deps/install/lib;$LIB"
-            INCLUDE="D:/a/leidenalg/leidenalg/build-deps/install/include/;$INCLUDE"
-            PATH="D:/a/leidenalg/leidenalg/build-deps/install/bin;$PATH"
-            EXTRA_CMAKE_ARGS="-A ${{ matrix.cmake_arch }}"
-          CIBW_REPAIR_WHEEL_COMMAND: "delvewheel repair -w {dest_dir} {wheel}"
-      - uses: actions/upload-artifact at v4
-        with:
-          name: wheels-win-${{ matrix.wheel_arch }}
-          path: ./wheelhouse/*.whl
-
-  build_sdist:
-    name: Build sdist
-    runs-on: ubuntu-latest
-    steps:
-      - uses: actions/checkout at v4
-        with:
-          submodules: true
-          fetch-depth: 0
-
-      - uses: actions/setup-python at v5
-        name: Install Python
-        with:
-          python-version: '3.8'
-
-      - name: Install pypa/build
-        run: pip3 install build
-
-      - name: Build sdist
-        run: |
-          python3 -m build --sdist
-
-      - uses: actions/upload-artifact at v4
-        with:
-          name: wheels-sdist
-          path: dist/*.tar.gz
-
-  upload_pypi:
-    needs: [build_wheel_linux, build_wheel_linux_aarch64, build_wheel_macos, build_wheel_win, build_sdist]
-    runs-on: ubuntu-latest
-    # upload to PyPI on every push from the master branch
-    if: github.event_name == 'push' &&
-        startsWith(github.ref, 'refs/tags')
-    steps:
-      - uses: actions/download-artifact at v4
-        with:
-          pattern: wheels-*
-          merge-multiple: true
-          path: dist
-
-      # Upload tagged versions to production PyPI
-      - name: Publish distribution 📦 to PyPI
-        uses: pypa/gh-action-pypi-publish at release/v1
-        with:
-          password: ${{ secrets.PYPI_API_TOKEN }}
\ No newline at end of file


=====================================
CHANGELOG
=====================================
@@ -1,3 +1,7 @@
+0.11.0
+- Update to libleidenalg 0.12.0
+- Update to igraph 1.0
+
 0.10.2
 - Also allow python-igraph >= 0.11
 - Upgrade C core to 0.10.8 for binary wheels


=====================================
README.rst
=====================================
@@ -39,7 +39,7 @@ Installation
 ------------
 
 In short: ``pip install leidenalg``. All major platforms are supported on
-Python>=3.6, earlier versions of Python are no longer supported. Alternatively,
+Python>=3.9, earlier versions of Python are no longer supported. Alternatively,
 you can install from Anaconda (channel ``conda-forge``).
 
 For Unix like systems it is possible to install from source. For Windows this is
@@ -55,11 +55,11 @@ that not only ``gcc`` is installed, but also ``g++``, as the ``leidenalg``
 package is programmed in ``C++``. Note that there are build scripts included in
 the ``scripts/`` directory. These are also used to build the binary wheels.
 
-1. Compile (and install) the C core of ``igraph`` (version >= 0.10). You can use
+1. Compile (and install) the C core of ``igraph`` (version >= 1.0.0). You can use
    the file ``build_igraph.sh`` (on Unix-like systems) or ``build_igraph.bat``
    (on Windows) in the ``scripts/`` directory to do this. For more details, see
    https://igraph.org/c/doc/igraph-Installation.html.
-2. Compile (and install) the C core of ``libleidenalg`` (version >= 0.10). You
+2. Compile (and install) the C core of ``libleidenalg`` (version >= 0.12). You
    can use the file ``build_libleidenalg.sh`` (on Unix-like systems) or
    ``build_libleidenalg.bat`` (on Windows) in the ``scripts/`` directory to do
    this. For more details, see https://github.com/vtraag/libleidenalg.


=====================================
build-doc.yml
=====================================
@@ -3,9 +3,9 @@ channels:
   - conda-forge
 dependencies:
   - python
-  - igraph>=0.10,<0.11
-  - libleidenalg>=0.11,<0.12
-  - python-igraph>=0.10,<0.11
+  - igraph>=1.0.0,<2
+  - libleidenalg>=0.12,<0.13
+  - python-igraph>=1.0.0,<2
   - ddt
   - sphinx
   - sphinx_rtd_theme


=====================================
doc/source/conf.py
=====================================
@@ -63,11 +63,10 @@ author = u'V.A. Traag'
 # The version info for the project you're documenting, acts as replacement for
 # |version| and |release|, also used in various other places throughout the
 # built documents.
-from pkg_resources import get_distribution
+import importlib.metadata as md
 
 # The full version, including alpha/beta/rc tags.
-release = get_distribution('leidenalg').version
-del get_distribution
+release = md.version('leidenalg')
 
 # The short X.Y version.
 version = '.'.join(release.split('.')[:2])


=====================================
doc/source/intro.rst
=====================================
@@ -23,7 +23,7 @@ That's it.
 The result ``partition`` is in this case a
 :class:`~leidenalg.ModularityVertexPartition` which is derived from the
 :mod:`igraph` type :class:`ig.VertexClustering`, see the `documentation
-<https://igraph.org/python/api/latest/igraph.clustering.VertexClustering.html>`_
+<https://python.igraph.org/en/stable/api/igraph.VertexClustering.html>`_
 for more details.
 
 Why then should you use this package rather than for example the Louvain


=====================================
pyproject.toml
=====================================
@@ -16,14 +16,13 @@ keywords=[
     "community detection",
     "clustering"
     ]
-license = {text = "GPLv3+"}
+license = "GPL-3.0-or-later"
 classifiers = [
     "Development Status :: 4 - Beta",
     "Environment :: Console",
     "Intended Audience :: End Users/Desktop",
     "Intended Audience :: Developers",
     "Intended Audience :: Science/Research",
-    "License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)",
     "Operating System :: MacOS :: MacOS X",
     "Operating System :: Microsoft :: Windows",
     "Operating System :: POSIX",
@@ -34,7 +33,7 @@ classifiers = [
     "Topic :: Sociology"
 ]
 dependencies = [
-    "igraph >= 0.10.0,< 0.12",
+    "igraph >= 1.0.0,< 2.0",
 ]
 dynamic = ["version"]
 


=====================================
scripts/build_igraph.bat
=====================================
@@ -1,6 +1,6 @@
 @echo off
 
-set IGRAPH_VERSION=0.10.8
+set IGRAPH_VERSION=1.0.0
 
 set ROOT_DIR=%cd%
 echo Using root dir %ROOT_DIR%


=====================================
scripts/build_igraph.sh
=====================================
@@ -1,4 +1,4 @@
-IGRAPH_VERSION=0.10.4
+IGRAPH_VERSION=1.0.0
 
 ROOT_DIR=`pwd`
 echo "Using root dir ${ROOT_DIR}"
@@ -15,7 +15,7 @@ if [ ! -d "igraph" ]; then
   echo ""
   echo "Cloning igraph into ${ROOT_DIR}/build-deps/src/igraph"
   # Clone repository if it does not exist yet
-  git clone --branch ${IGRAPH_VERSION} https://github.com/igraph/igraph.git --single-branch
+  git clone --depth 1 --branch ${IGRAPH_VERSION} https://github.com/igraph/igraph.git --single-branch
 fi
 
 # Make sure the git repository points to the correct version
@@ -50,12 +50,13 @@ cmake ${ROOT_DIR}/build-deps/src/igraph \
   -DIGRAPH_USE_INTERNAL_GMP=ON \
   -DIGRAPH_WARNINGS_AS_ERRORS=OFF \
   -DCMAKE_BUILD_TYPE=Release \
+  -DBUILD_TESTING=OFF \
   ${EXTRA_CMAKE_ARGS}
 
 echo ""
 echo "Build igraph"
-cmake --build .
+cmake --build . --config Release
 
 echo ""
 echo "Install igraph to ${ROOT_DIR}/build-deps/install/"
-cmake --build . --target install
+cmake --build . --target install --config Release


=====================================
scripts/build_libleidenalg.bat
=====================================
@@ -1,6 +1,6 @@
 @echo off
 
-set LIBLEIDENALG_VERSION="0.11.0"
+set LIBLEIDENALG_VERSION="0.12.0"
 
 set ROOT_DIR=%cd%
 echo Using root dir %ROOT_DIR%
@@ -14,7 +14,7 @@ if not exist "libleidenalg\" (
   echo.
   echo Cloning libleidenalg into %ROOT_DIR%\build-deps\src\libleidenalg
   REM Clone repository if it does not exist yet
-  git clone --depth 1 --branch %libleidenalg_VERSION% https://github.com/vtraag/libleidenalg.git
+  git clone --branch %libleidenalg_VERSION% https://github.com/vtraag/libleidenalg.git
 )
 
 REM Make sure the git repository points to the correct version


=====================================
scripts/build_libleidenalg.sh
=====================================
@@ -1,4 +1,4 @@
-LIBLEIDENALG_VERSION=0.11.0
+LIBLEIDENALG_VERSION=0.12.0
 
 ROOT_DIR=`pwd`
 echo "Using root dir ${ROOT_DIR}"
@@ -45,8 +45,8 @@ cmake ${ROOT_DIR}/build-deps/src/libleidenalg \
 
 echo ""
 echo "Build libleidenalg"
-cmake --build .
+cmake --build . --config Release
 
 echo ""
 echo "Install libleidenalg to ${ROOT_DIR}/build-deps/install/"
-cmake --build . --target install
+cmake --build . --target install --config Release


=====================================
setup.py
=====================================
@@ -57,7 +57,7 @@ setup(
                   define_macros=macros,
                   libraries = ['libleidenalg', 'igraph'],
                   include_dirs=['include', 'build-deps/install/include'],
-                  library_dirs=['build-deps/install/lib']
+                  library_dirs=['build-deps/install/lib', 'build-deps/install/lib64'],
         )
     ],
     cmdclass=cmdclass


=====================================
src/leidenalg/Optimiser.py
=====================================
@@ -4,7 +4,7 @@ from collections import namedtuple
 from math import log, sqrt
 
 class Optimiser(object):
-  """ Class for doing community detection using the Leiden algorithm.
+  r""" Class for doing community detection using the Leiden algorithm.
 
   The Leiden algorithm [1] derives from the Louvain algorithm [2]. The Louvain
   algorithm has an elegant formulation. It consists of two phases: (1) move
@@ -24,19 +24,19 @@ class Optimiser(object):
   algorithm that cannot be translated well in this framework: when merging
   subcommunities in the refinement procedure, it does not consider whether they
   are sufficiently well connected to the rest of the community. This
-  implementation therefore does not guarantee subpartition :math:`\gamma`-density.
+  implementation therefore does not guarantee subpartition :math:`\\gamma`-density.
   However, all other guarantees still hold:
 
   After each iteration
-    1. :math:`\gamma`-separation
-    2. :math:`\gamma`-connectivity
+    1. :math:`\\gamma`-separation
+    2. :math:`\\gamma`-connectivity
 
   After a stable iteration
     3. Node optimality
     4. Some subsets are locally optimally assigned
 
   Asymptotically
-    5. Uniform :math:`\gamma`-density
+    5. Uniform :math:`\\gamma`-density
     6. Subset optimality
 
   The optimiser class provides a number of different methods for optimising a
@@ -82,6 +82,8 @@ class Optimiser(object):
     Nodes will only move to alternative communities that improve the given
     quality function.
 
+    The default is :attr:`leidenalg.ALL_NEIGH_COMMS`.
+
     Notes
     -------
     This attribute should be set to one of the following values
@@ -119,6 +121,8 @@ class Optimiser(object):
     Nodes will only move to alternative communities that improve the given
     quality function.
 
+    The default is :attr:`leidenalg.ALL_NEIGH_COMMS`.
+
     Notes
     -------
     This attribute should be set to one of the following values
@@ -151,6 +155,7 @@ class Optimiser(object):
   @property
   def optimise_routine(self):
     """ Determine the routine to use for *optimising* a partition.
+    The default is :attr:`leidenalg.MOVE_NODES`.
 
     Notes
     -------
@@ -173,16 +178,17 @@ class Optimiser(object):
   @property
   def refine_routine(self):
     """ Determine the routine to use for *refining* a partition.
+    The default is :attr:`leidenalg.MERGE_NODES`.
 
     Notes
     -------
     This attribute should be set to one of the following values
 
     * :attr:`leidenalg.MOVE_NODES`
-      Use :func:`move_nodes`.
+      Use :func:`move_nodes_constrained`.
 
     * :attr:`leidenalg.MERGE_NODES`
-      Use :func:`merge_nodes`.
+      Use :func:`merge_nodes_constrained`.
     """
     return _c_leiden._Optimiser_get_refine_routine(self._optimiser)
 
@@ -285,6 +291,11 @@ class Optimiser(object):
     itr = 0
     diff = 0
     continue_iteration = itr < n_iterations or n_iterations < 0
+
+    if is_membership_fixed is not None:
+      # Make sure it is a list
+      is_membership_fixed = list(is_membership_fixed)
+
     while continue_iteration:
       diff_inc = _c_leiden._Optimiser_optimise_partition(
               self._optimiser,
@@ -302,7 +313,7 @@ class Optimiser(object):
     return diff
 
   def optimise_partition_multiplex(self, partitions, layer_weights=None, n_iterations=2, is_membership_fixed=None):
-    """ Optimise the given partitions simultaneously.
+    r""" Optimise the given partitions simultaneously.
 
     Parameters
     ----------
@@ -343,7 +354,7 @@ class Optimiser(object):
     layer :math:`k` and the weight by :math:`\\lambda_k`, the overall quality
     is then
 
-    .. math:: Q = \sum_k \\lambda_k Q_k.
+    .. math:: Q = \\sum_k \\lambda_k Q_k.
 
     This is particularly useful for graphs containing negative links. When
     separating the graph in two graphs, the one containing only the positive


=====================================
src/leidenalg/VertexPartition.py
=====================================
@@ -5,7 +5,7 @@ from .functions import _get_py_capsule
 class MutableVertexPartition(_ig.VertexClustering):
   """ Contains a partition of a graph, derives from
   :class:`ig.VertexClustering`. Please see the `documentation
-  <https://igraph.org/python/api/latest/igraph.clustering.VertexClustering.html>`_
+  <https://python.igraph.org/en/stable/api/igraph.VertexClustering.html>`_
   of :class:`ig.VertexClustering` for more details about its functionality.
 
   This class contains the basic implementation for optimising a partition.
@@ -385,7 +385,7 @@ class MutableVertexPartition(_ig.VertexClustering):
     return _c_leiden._MutableVertexPartition_weight_from_comm(self._partition, v, comm)
 
 class ModularityVertexPartition(MutableVertexPartition):
-  """ Implements modularity. This quality function is well-defined only for positive edge weights.
+  r""" Implements modularity. This quality function is well-defined only for positive edge weights.
 
   Notes
   -----
@@ -410,7 +410,7 @@ class ModularityVertexPartition(MutableVertexPartition):
   Note that for directed graphs a slightly different formulation is used, as
   proposed by Leicht and Newman [2]:
 
-  .. math:: Q = \\frac{1}{m} \\sum_{ij} \\left(A_{ij} - \\frac{k_i^\mathrm{out} k_j^\mathrm{in}}{m} \\right)\\delta(\\sigma_i, \\sigma_j),
+  .. math:: Q = \\frac{1}{m} \\sum_{ij} \\left(A_{ij} - \\frac{k_i^\\mathrm{out} k_j^\\mathrm{in}}{m} \\right)\\delta(\\sigma_i, \\sigma_j),
 
   where :math:`k_i^\\mathrm{out}` and :math:`k_i^\\mathrm{in}` refers to
   respectively the outdegree and indegree of node :math:`i`, and :math:`A_{ij}`
@@ -758,7 +758,7 @@ class RBERVertexPartition(LinearResolutionParameterVertexPartition):
     return new_partition
 
 class RBConfigurationVertexPartition(LinearResolutionParameterVertexPartition):
-  """ Implements Reichardt and Bornholdt's Potts model with a configuration null model.
+  r""" Implements Reichardt and Bornholdt's Potts model with a configuration null model.
   This quality function is well-defined only for positive edge weights.
   This quality function uses a linear resolution parameter.
 
@@ -785,7 +785,7 @@ class RBConfigurationVertexPartition(LinearResolutionParameterVertexPartition):
   Note that for directed graphs a slightly different formulation is used, as
   proposed by Leicht and Newman [2]:
 
-  .. math:: Q = \\sum_{ij} \\left(A_{ij} - \\gamma \\frac{k_i^\mathrm{out} k_j^\mathrm{in}}{m} \\right)\\delta(\\sigma_i, \\sigma_j),
+  .. math:: Q = \\sum_{ij} \\left(A_{ij} - \\gamma \\frac{k_i^\\mathrm{out} k_j^\\mathrm{in}}{m} \\right)\\delta(\\sigma_i, \\sigma_j),
 
   where :math:`k_i^\\mathrm{out}` and :math:`k_i^\\mathrm{in}` refers to
   respectively the outdegree and indegree of node :math:`i`, and :math:`A_{ij}`


=====================================
src/leidenalg/python_optimiser_interface.cpp
=====================================
@@ -83,7 +83,7 @@ extern "C"
       size_t nb_is_membership_fixed = PyList_Size(py_is_membership_fixed);
       if (nb_is_membership_fixed != n)
       {
-        PyErr_SetString(PyExc_ValueError, "Node size vector not the same size as the number of nodes.");
+        PyErr_SetString(PyExc_ValueError, "Membership fixed vector not the same size as the number of nodes.");
         return NULL;
       }
 
@@ -188,7 +188,7 @@ extern "C"
       size_t nb_is_membership_fixed = PyList_Size(py_is_membership_fixed);
       if (nb_is_membership_fixed != n)
       {
-        PyErr_SetString(PyExc_TypeError, "Node size vector not the same size as the number of nodes.");
+        PyErr_SetString(PyExc_TypeError, "Membership fixed vector not the same size as the number of nodes.");
         return NULL;
       }
 
@@ -270,7 +270,7 @@ extern "C"
       size_t nb_is_membership_fixed = PyList_Size(py_is_membership_fixed);
       if (nb_is_membership_fixed != n)
       {
-        PyErr_SetString(PyExc_TypeError, "Node size vector not the same size as the number of nodes.");
+        PyErr_SetString(PyExc_TypeError, "Membership fixed vector not the same size as the number of nodes.");
         return NULL;
       }
 
@@ -346,7 +346,7 @@ extern "C"
       size_t nb_is_membership_fixed = PyList_Size(py_is_membership_fixed);
       if (nb_is_membership_fixed != n)
       {
-        PyErr_SetString(PyExc_TypeError, "Node size vector not the same size as the number of nodes.");
+        PyErr_SetString(PyExc_TypeError, "Membership fixed vector not the same size as the number of nodes.");
         return NULL;
       }
 



View it on GitLab: https://salsa.debian.org/med-team/python-leidenalg/-/commit/de0c8afc403cc6a4aa9894621327344f4c47762e

-- 
View it on GitLab: https://salsa.debian.org/med-team/python-leidenalg/-/commit/de0c8afc403cc6a4aa9894621327344f4c47762e
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/20251101/f4905e2d/attachment-0001.htm>


More information about the debian-med-commit mailing list