vtraag / leidenalg

Implementation of the Leiden algorithm for various quality functions to be used with igraph in Python.
GNU General Public License v3.0
566 stars 76 forks source link

A bunch of strings are broken #173

Closed flying-sheep closed 3 months ago

flying-sheep commented 3 months ago

Python 3.12 displays some warnings for instances where code contains string literals with non-existing escape sequences (e.g. if you write "\s" instead of r"\s or "\\s"):

../../../../../opt/hostedtoolcache/Python/3.12.2/x64/lib/python3.12/site-packages/leidenalg/VertexPartition.py:388
  /opt/hostedtoolcache/Python/3.12.2/x64/lib/python3.12/site-packages/leidenalg/VertexPartition.py:388: SyntaxWarning: invalid escape sequence '\m'
    """ Implements modularity. This quality function is well-defined only for positive edge weights.

../../../../../opt/hostedtoolcache/Python/3.12.2/x64/lib/python3.12/site-packages/leidenalg/VertexPartition.py:761
  /opt/hostedtoolcache/Python/3.12.2/x64/lib/python3.12/site-packages/leidenalg/VertexPartition.py:761: SyntaxWarning: invalid escape sequence '\m'
    """ Implements Reichardt and Bornholdt's Potts model with a configuration null model.

../../../../../opt/hostedtoolcache/Python/3.12.2/x64/lib/python3.12/site-packages/leidenalg/Optimiser.py:7
  /opt/hostedtoolcache/Python/3.12.2/x64/lib/python3.12/site-packages/leidenalg/Optimiser.py:7: SyntaxWarning: invalid escape sequence '\g'
    """ Class for doing community detection using the Leiden algorithm.

../../../../../opt/hostedtoolcache/Python/3.12.2/x64/lib/python3.12/site-packages/leidenalg/Optimiser.py:305
  /opt/hostedtoolcache/Python/3.12.2/x64/lib/python3.12/site-packages/leidenalg/Optimiser.py:305: SyntaxWarning: invalid escape sequence '\s'
    """ Optimise the given partitions simultaneously.

../../../../../opt/hostedtoolcache/Python/3.12.2/x64/lib/python3.12/enum.py:272: 24 warnings
  /opt/hostedtoolcache/Python/3.12.2/x64/lib/python3.12/enum.py:272: PytestDeprecationWarning: A private pytest class or function was used.
    enum_member._value_ = enum_class._member_type_(*args)
vtraag commented 3 months ago

Thanks for the report! Should be fixed now.