Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SyntaxWarnings: Invalid escape sequences. #194

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

emollier
Copy link

@emollier emollier commented Dec 6, 2024

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.

This has been initially reported as Debian bug #1085929.

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.

This has been initially reported as [Debian bug #1085929].

[Debian bug #1085929]: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1085929

Signed-off-by: Étienne Mollier <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant