Skip to content

Commit c07a8ba

Browse files
committed
- fix neighbourhood bug
1 parent e772138 commit c07a8ba

File tree

1 file changed

+4
-2
lines changed
  • src/compas/datastructures/network/core

1 file changed

+4
-2
lines changed

src/compas/datastructures/network/core/graph.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1271,10 +1271,12 @@ def neighborhood(self, key, ring=1):
12711271
if i == ring:
12721272
break
12731273
temp = []
1274-
for key in nbrs:
1275-
temp += self.neighbors(key)
1274+
for nbr in nbrs:
1275+
temp += self.neighbors(nbr)
12761276
nbrs.update(temp)
12771277
i += 1
1278+
if key in nbrs:
1279+
nbrs.remove(key)
12781280
return list(nbrs)
12791281

12801282
def neighbors_out(self, key):

0 commit comments

Comments
 (0)