Skip to content

Commit 9a95820

Browse files
committed
Change terminology in _[dis]connect_surface_sites
1 parent 6b1e3f3 commit 9a95820

1 file changed

Lines changed: 13 additions & 13 deletions

File tree

rmgpy/molecule/draw.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1665,27 +1665,27 @@ def _connect_surface_sites(self):
16651665
sites = [a for a in self.molecule.atoms if a.is_surface_site()]
16661666
if len(sites) > 4:
16671667
return
1668-
for atom1 in sites:
1669-
other_sites = [a for a in sites if a != atom1]
1668+
for site1 in sites:
1669+
other_sites = [a for a in sites if a != site1]
16701670
if not other_sites: break
16711671
# connect to the nearest site
1672-
atom2 = min(other_sites, key=lambda a: len(find_shortest_path(atom1, a)))
1673-
bond = atom1.bonds.get(atom2)
1672+
site2 = min(other_sites, key=lambda a: len(find_shortest_path(site1, a)))
1673+
bond = site1.bonds.get(site2)
16741674
if bond is None:
1675-
bond = Bond(atom1, atom2, 1)
1676-
atom1.bonds[atom2] = bond
1677-
atom2.bonds[atom1] = bond
1675+
bond = Bond(site1, site2, 1)
1676+
site1.bonds[site2] = bond
1677+
site2.bonds[site1] = bond
16781678

16791679
def _disconnect_surface_sites(self):
16801680
"""
16811681
Removes all bonds between atoms that are surface sites.
16821682
"""
1683-
for atom1 in self.molecule.atoms:
1684-
if atom1.is_surface_site():
1685-
for atom2 in list(atom1.bonds.keys()): # make a list copy so we can delete from the dict
1686-
if atom2.is_surface_site():
1687-
del atom1.bonds[atom2]
1688-
del atom2.bonds[atom1]
1683+
for site1 in self.molecule.atoms:
1684+
if site1.is_surface_site():
1685+
for site2 in list(site1.bonds.keys()): # make a list copy so we can delete from the dict
1686+
if site2.is_surface_site():
1687+
del site1.bonds[site2]
1688+
del site2.bonds[site1]
16891689

16901690

16911691
################################################################################

0 commit comments

Comments
 (0)