1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69
|
Description: SyntaxWarnings: Invalid escape sequences.
As seen at least with Python 3.13, a number of Python entities
descriptions are raising warnings, caught in pytest's summary:
.
leidenalg/VertexPartition.py:388
/build/reproducible-path/python-leidenalg-0.10.2/.pybuild/cpython3_3.13_leidenalg/build/leidenalg/VertexPartition.py:388: SyntaxWarning: invalid escape sequence '\m'
""" Implements modularity. This quality function is well-defined only for positive edge weights.
.
leidenalg/VertexPartition.py:761
/build/reproducible-path/python-leidenalg-0.10.2/.pybuild/cpython3_3.13_leidenalg/build/leidenalg/VertexPartition.py:761: SyntaxWarning: invalid escape sequence '\m'
""" Implements Reichardt and Bornholdt's Potts model with a configuration null model.
.
leidenalg/Optimiser.py:7
/build/reproducible-path/python-leidenalg-0.10.2/.pybuild/cpython3_3.13_leidenalg/build/leidenalg/Optimiser.py:7: SyntaxWarning: invalid escape sequence '\g'
""" Class for doing community detection using the Leiden algorithm.
.
leidenalg/Optimiser.py:305
/build/reproducible-path/python-leidenalg-0.10.2/.pybuild/cpython3_3.13_leidenalg/build/leidenalg/Optimiser.py:305: SyntaxWarning: invalid escape sequence '\s'
""" Optimise the given partitions simultaneously.
.
This change declares the classes and function descriptions as raw
strings, to avoid tripping the invalid escape sequence.
Author: Étienne Mollier <emollier@debian.org>
Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1085929
Forwarded: https://github.com/vtraag/leidenalg/pull/194
Last-Update: 2024-12-06
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- python-leidenalg.orig/src/leidenalg/Optimiser.py
+++ python-leidenalg/src/leidenalg/Optimiser.py
@@ -4,7 +4,7 @@
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
@@ -302,7 +302,7 @@
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
----------
--- python-leidenalg.orig/src/leidenalg/VertexPartition.py
+++ python-leidenalg/src/leidenalg/VertexPartition.py
@@ -385,7 +385,7 @@
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
-----
@@ -758,7 +758,7 @@
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.
|