Skip to content

Commit

Permalink
remove props deepcopying
Browse files Browse the repository at this point in the history
  • Loading branch information
mjohnson541 committed Sep 1, 2018
1 parent 77d8a33 commit 4107cbd
Showing 1 changed file with 0 additions and 20 deletions.
20 changes: 0 additions & 20 deletions rmgpy/molecule/group.py
Original file line number Diff line number Diff line change
Expand Up @@ -1261,11 +1261,7 @@ def specifyAtomExtensions(self,i,basename,R):
Rset = set(R)
for item in R:
grp = deepcopy(self)
for k,atm in enumerate(grp.atoms):
grp.atoms[k].props = deepcopy(self.atoms[k].props)
grpc = deepcopy(self)
for k,atm in enumerate(grpc.atoms):
grpc.atoms[k].props = deepcopy(self.atoms[k].props)
old_atom_type = grp.atoms[i].atomType
grp.atoms[i].atomType = [item]
grpc.atoms[i].atomType = list(Rset-{item})
Expand Down Expand Up @@ -1294,11 +1290,7 @@ def specifyRingExtensions(self,i,basename):
labelList = []

grp = deepcopy(self)
for k,atm in enumerate(grp.atoms):
grp.atoms[k].props = deepcopy(self.atoms[k].props)
grpc = deepcopy(self)
for k,atm in enumerate(grpc.atoms):
grpc.atoms[k].props = deepcopy(self.atoms[k].props)
grp.atoms[i].props['inRing'] = True
grpc.atoms[i].props['inRing'] = False

Expand Down Expand Up @@ -1328,11 +1320,7 @@ def specifyUnpairedExtensions(self,i,basename,Run):
Rset = set(Run)
for item in Run:
grp = deepcopy(self)
for k,atm in enumerate(grp.atoms):
grp.atoms[k].props = deepcopy(self.atoms[k].props)
grpc = deepcopy(self)
for k,atm in enumerate(grpc.atoms):
grpc.atoms[k].props = deepcopy(self.atoms[k].props)
grp.atoms[i].radicalElectrons = [item]
grpc.atoms[i].radicalElectrons = list(Rset-{item})

Expand Down Expand Up @@ -1361,8 +1349,6 @@ def specifyInternalNewBondExtensions(self,i,j,Nsplits,basename,Rbonds):
labelList = []

newgrp = deepcopy(self)
for k,atm in enumerate(newgrp.atoms):
newgrp.atoms[k].props = deepcopy(self.atoms[k].props)
newgrp.addBond(GroupBond(newgrp.atoms[i],newgrp.atoms[j],Rbonds))

atom_type_i = newgrp.atoms[i].atomType
Expand Down Expand Up @@ -1401,8 +1387,6 @@ def specifyExternalNewBondExtensions(self,i,basename,Rbonds):

GA = GroupAtom([atomTypes['R!H']])
newgrp = deepcopy(self)
for k,atm in enumerate(newgrp.atoms):
newgrp.atoms[k].props = deepcopy(self.atoms[k].props)
newgrp.addAtom(GA)
j = newgrp.atoms.index(GA)
newgrp.addBond(GroupBond(newgrp.atoms[i],newgrp.atoms[j],Rbonds))
Expand All @@ -1429,11 +1413,7 @@ def specifyBondExtensions(self,i,j,basename,Rbonds):
bdict = {1:'-',2:'=',3:'#',1.5:'-='}
for bd in Rbonds:
grp = deepcopy(self)
for k,atm in enumerate(grp.atoms):
grp.atoms[k].props = deepcopy(self.atoms[k].props)
grpc = deepcopy(self)
for k,atm in enumerate(grpc.atoms):
grpc.atoms[k].props = deepcopy(self.atoms[k].props)
grp.atoms[i].bonds[grp.atoms[j]].order = [bd]
grp.atoms[j].bonds[grp.atoms[i]].order = [bd]
grpc.atoms[i].bonds[grpc.atoms[j]].order = list(Rbset-{bd})
Expand Down

0 comments on commit 4107cbd

Please sign in to comment.