summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoss Barnowski <rossbar@berkeley.edu>2021-05-11 11:42:15 -0700
committerGitHub <noreply@github.com>2021-05-11 14:42:15 -0400
commitba73110a26e574f896fac75dba20f73fb5a9c421 (patch)
tree830fa24e4abe96355e865198324e3d243d769181
parentc1be67da1f08cf770a18fcbe199e5ecea5745ebe (diff)
downloadnetworkx-ba73110a26e574f896fac75dba20f73fb5a9c421.tar.gz
Get rid of invalid escape sequences. (#4789)
When running the test suite, there are new deprecation warnings about invalid escape sequences. This is from LaTeX math in some docstrings, which often feature backslashes. The simplest way to get rid of these warnings is to convert the docstrings into raw strings.
-rw-r--r--networkx/algorithms/community/modularity_max.py4
-rw-r--r--networkx/algorithms/similarity.py2
-rw-r--r--networkx/drawing/nx_pylab.py4
-rw-r--r--networkx/generators/classic.py2
4 files changed, 6 insertions, 6 deletions
diff --git a/networkx/algorithms/community/modularity_max.py b/networkx/algorithms/community/modularity_max.py
index eb2a7f49..cc9d5d98 100644
--- a/networkx/algorithms/community/modularity_max.py
+++ b/networkx/algorithms/community/modularity_max.py
@@ -12,7 +12,7 @@ __all__ = [
def greedy_modularity_communities(G, weight=None, resolution=1):
- """Find communities in G using greedy modularity maximization.
+ r"""Find communities in G using greedy modularity maximization.
This function uses Clauset-Newman-Moore greedy modularity maximization [2]_.
This method currently supports the Graph class.
@@ -224,7 +224,7 @@ def greedy_modularity_communities(G, weight=None, resolution=1):
def naive_greedy_modularity_communities(G, resolution=1):
- """Find communities in G using greedy modularity maximization.
+ r"""Find communities in G using greedy modularity maximization.
This implementation is O(n^4), much slower than alternatives, but it is
provided as an easy-to-understand reference implementation.
diff --git a/networkx/algorithms/similarity.py b/networkx/algorithms/similarity.py
index 0c512281..6369012d 100644
--- a/networkx/algorithms/similarity.py
+++ b/networkx/algorithms/similarity.py
@@ -1492,7 +1492,7 @@ def _n_choose_k(n, k):
def panther_similarity(G, source, k=5, path_length=5, c=0.5, delta=0.1, eps=None):
- """Returns the Panther similarity of nodes in the graph `G` to node ``v``.
+ r"""Returns the Panther similarity of nodes in the graph `G` to node ``v``.
Panther is a similarity metric that says "two objects are considered
to be similar if they frequently appear on the same paths." [1]_.
diff --git a/networkx/drawing/nx_pylab.py b/networkx/drawing/nx_pylab.py
index e88f2bce..c40b9789 100644
--- a/networkx/drawing/nx_pylab.py
+++ b/networkx/drawing/nx_pylab.py
@@ -125,7 +125,7 @@ def draw(G, pos=None, ax=None, **kwds):
def draw_networkx(G, pos=None, arrows=True, with_labels=True, **kwds):
- """Draw the graph G using Matplotlib.
+ r"""Draw the graph G using Matplotlib.
Draw the graph with Matplotlib with options for node positions,
labeling, titles, and many other drawing features.
@@ -497,7 +497,7 @@ def draw_networkx_edges(
min_source_margin=0,
min_target_margin=0,
):
- """Draw the edges of the graph G.
+ r"""Draw the edges of the graph G.
This draws only the edges of the graph G.
diff --git a/networkx/generators/classic.py b/networkx/generators/classic.py
index b89aca3d..380130b5 100644
--- a/networkx/generators/classic.py
+++ b/networkx/generators/classic.py
@@ -278,7 +278,7 @@ def circular_ladder_graph(n, create_using=None):
def circulant_graph(n, offsets, create_using=None):
- """Returns the circulant graph $Ci_n(x_1, x_2, ..., x_m)$ with $n$ nodes.
+ r"""Returns the circulant graph $Ci_n(x_1, x_2, ..., x_m)$ with $n$ nodes.
The circulant graph $Ci_n(x_1, ..., x_m)$ consists of $n$ nodes $0, ..., n-1$
such that node $i$ is connected to nodes $(i + x) \mod n$ and $(i - x) \mod n$