Skip to content

Commit b0e0807

Browse files
authored
improve performance of is_independent (#1037)
* improve performance of is_independence, suggested by Cal * address Cal comment
1 parent f90c448 commit b0e0807

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

mbuild/compound.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1337,9 +1337,9 @@ def is_independent(self):
13371337
else:
13381338
# Cover the other cases
13391339
bond_graph_dict = self.root.bond_graph._adj
1340-
for particle in self:
1340+
for particle in self.particles():
13411341
for neigh in bond_graph_dict[particle]:
1342-
if neigh not in self:
1342+
if neigh not in self.particles():
13431343
return False
13441344
return True
13451345

0 commit comments

Comments
 (0)