Skip to content

Commit 34398b7

Browse files
authored
Merge pull request networkx#61 from Lamaun/master
Now runs with networkx v2.4
2 parents 8a6b683 + 8a1b975 commit 34398b7

File tree

3 files changed

+8
-10
lines changed

3 files changed

+8
-10
lines changed

.travis.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,9 @@ sudo: false # Now the build will be running on the new container based platform
33
language: python
44

55
python:
6-
- 2.7
7-
- 3.2
8-
- 3.3
9-
- 3.4
10-
- "pypy"
6+
- 3.6
7+
- 3.7
8+
- 3.8
119
- "pypy3"
1210

1311
cache:

nxmetis/__init__.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ def node_nested_dissection(G, weight='weight', options=None):
127127
if len(G) == 0:
128128
return []
129129

130-
vwgt = [G.node[u].get(weight, 1) for u in G]
130+
vwgt = [G.nodes[u].get(weight, 1) for u in G]
131131
if all(w == 1 for w in vwgt):
132132
vwgt = None
133133

@@ -227,11 +227,11 @@ def partition(G, nparts, node_weight='weight', node_size='size',
227227

228228
xadj, adjncy = _convert_graph(G)
229229

230-
vwgt = [G.node[u].get(node_weight, 1) for u in G]
230+
vwgt = [G.nodes[u].get(node_weight, 1) for u in G]
231231
if all(w == 1 for w in vwgt):
232232
vwgt = None
233233

234-
vsize = [G.node[u].get(node_size, 1) for u in G]
234+
vsize = [G.nodes[u].get(node_size, 1) for u in G]
235235
if all(w == 1 for w in vsize):
236236
vsize = None
237237

@@ -298,7 +298,7 @@ def vertex_separator(G, weight='weight', options=None):
298298
if len(G) == 0:
299299
return [], [], []
300300

301-
vwgt = [G.node[u].get(weight, 1) for u in G]
301+
vwgt = [G.nodes[u].get(weight, 1) for u in G]
302302
if all(w == 1 for w in vwgt):
303303
vwgt = None
304304

nxmetis/tests/test_metis.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def setUp(self):
2424
self.node_list = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j',
2525
1, 2, 3, 4, 5, 6]
2626
self.G = nx.Graph()
27-
self.G.add_path(self.node_list)
27+
nx.add_path(self.G,self.node_list)
2828
self.G.add_edge(self.node_list[-1], self.node_list[0])
2929

3030
def test_node_nested_dissection_unweighted(self):

0 commit comments

Comments
 (0)