python-networkx/python-networkx-abc.patch
2018-10-31 19:20:23 -06:00

78 lines
2.9 KiB
Diff

--- networkx/algorithms/approximation/kcomponents.py.orig 2018-09-19 12:30:34.000000000 -0600
+++ networkx/algorithms/approximation/kcomponents.py 2018-10-30 14:18:27.433887139 -0600
@@ -5,7 +5,8 @@
# All rights reserved.
# BSD license.
import itertools
-from collections import defaultdict, Mapping
+from collections import defaultdict
+from collections.abc import Mapping
import networkx as nx
from networkx.exception import NetworkXError
--- networkx/algorithms/lowest_common_ancestors.py.orig 2018-09-19 12:30:34.000000000 -0600
+++ networkx/algorithms/lowest_common_ancestors.py 2018-10-30 14:16:43.362693490 -0600
@@ -10,7 +10,8 @@
#
# Author: Alex Roper <aroper@umich.edu>
"""Algorithms for finding the lowest common ancestor of trees and DAGs."""
-from collections import defaultdict, Mapping, Set
+from collections import defaultdict
+from collections.abc import Mapping, Set
from itertools import chain, count
import networkx as nx
--- networkx/classes/coreviews.py.orig 2018-09-19 12:30:34.000000000 -0600
+++ networkx/classes/coreviews.py 2018-10-30 14:19:56.696337812 -0600
@@ -10,7 +10,7 @@
# Dan Schult(dschult@colgate.edu)
"""
"""
-from collections import Mapping
+from collections.abc import Mapping
import networkx as nx
__all__ = ['AtlasView', 'AdjacencyView', 'MultiAdjacencyView',
--- networkx/classes/graph.py.orig 2018-09-19 12:30:34.000000000 -0600
+++ networkx/classes/graph.py 2018-10-30 14:19:28.369829478 -0600
@@ -20,7 +20,7 @@ For directed graphs see DiGraph and Mult
from __future__ import division
import warnings
from copy import deepcopy
-from collections import Mapping
+from collections.abc import Mapping
import networkx as nx
from networkx.classes.coreviews import AtlasView, AdjacencyView
--- networkx/classes/reportviews.py.orig 2018-09-19 12:30:34.000000000 -0600
+++ networkx/classes/reportviews.py 2018-10-30 14:15:16.365203491 -0600
@@ -92,7 +92,7 @@ EdgeDataView
The argument `nbunch` restricts edges to those incident to nodes in nbunch.
"""
-from collections import Mapping, Set, Iterable
+from collections.abc import Mapping, Set, Iterable
import networkx as nx
__all__ = ['NodeView', 'NodeDataView',
--- networkx/drawing/nx_pylab.py.orig 2018-09-19 12:30:34.000000000 -0600
+++ networkx/drawing/nx_pylab.py 2018-10-30 14:21:36.159610430 -0600
@@ -371,7 +371,7 @@ def draw_networkx_nodes(G, pos,
draw_networkx_labels()
draw_networkx_edge_labels()
"""
- import collections
+ import collections.abc
try:
import matplotlib.pyplot as plt
import numpy as np
@@ -397,7 +397,7 @@ def draw_networkx_nodes(G, pos,
except ValueError:
raise nx.NetworkXError('Bad value in node positions.')
- if isinstance(alpha, collections.Iterable):
+ if isinstance(alpha, collections.abc.Iterable):
node_color = apply_alpha(node_color, alpha, nodelist, cmap, vmin, vmax)
alpha = None