summaryrefslogtreecommitdiff
path: root/networkx/readwrite/json_graph
diff options
context:
space:
mode:
authorthegreathippo <thegreathippo@gmail.com>2016-04-26 18:02:14 -0400
committerthegreathippo <thegreathippo@gmail.com>2016-04-26 18:02:14 -0400
commit64902cb38713787585344cee5d9e5d89e51e2aeb (patch)
treec47baa7ad9c96f8ad3d20be298ed7bb88c431879 /networkx/readwrite/json_graph
parent5dc97ba830c48bc485250d3a1239ec69ee9dfedf (diff)
downloadnetworkx-64902cb38713787585344cee5d9e5d89e51e2aeb.tar.gz
Remove attr_dict calls to graph's add_node; replace with **.
Combing through the code for any point where it pushes a dictionary to the add_node method rather than keywords; augmenting these arguments with ** to turn them into keyword arguments.
Diffstat (limited to 'networkx/readwrite/json_graph')
-rw-r--r--networkx/readwrite/json_graph/adjacency.py2
-rw-r--r--networkx/readwrite/json_graph/tests/test_node_link.py2
2 files changed, 2 insertions, 2 deletions
diff --git a/networkx/readwrite/json_graph/adjacency.py b/networkx/readwrite/json_graph/adjacency.py
index 5d99dda3..7fb0f8ef 100644
--- a/networkx/readwrite/json_graph/adjacency.py
+++ b/networkx/readwrite/json_graph/adjacency.py
@@ -145,7 +145,7 @@ def adjacency_graph(data, directed=False, multigraph=True, attrs=_attrs):
node_data = d.copy()
node = node_data.pop(id_)
mapping.append(node)
- graph.add_node(node, attr_dict=node_data)
+ graph.add_node(node, **node_data)
for i, d in enumerate(data['adjacency']):
source = mapping[i]
for tdata in d:
diff --git a/networkx/readwrite/json_graph/tests/test_node_link.py b/networkx/readwrite/json_graph/tests/test_node_link.py
index 4c5f4c20..217a8340 100644
--- a/networkx/readwrite/json_graph/tests/test_node_link.py
+++ b/networkx/readwrite/json_graph/tests/test_node_link.py
@@ -60,7 +60,7 @@ class TestNodeLink:
except NameError:
q = "qualité"
G = nx.Graph()
- G.add_node(1, {q:q})
+ G.add_node(1, **{q:q})
s = node_link_data(G)
output = json.dumps(s, ensure_ascii=False)
data = json.loads(output)