Skip to content

Commit 3c8c773

Browse files
Merge pull request #75 from OMaraLab/hotfix-solver-errror-message
error message hotfix, made polyconf scripts executable
2 parents d48eca0 + a3cd16a commit 3c8c773

13 files changed

+3
-245
lines changed

polyconf/polyconf/Polymer.py

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -192,9 +192,6 @@ def extend(self, monomer, n, nn, names, joins, ortho=[1,1,1],
192192
any dummy atoms.
193193
194194
"""
195-
# TODO I renamed the atoms in the manuscript, so I guess I gotta fix that here
196-
# cool.
197-
# love that for me.
198195

199196
Q = self.polymer.select_atoms(f"resid {n} and name {names['Q']}").positions[-1]
200197
S = self.polymer.select_atoms(f"resid {n} and name {names['S']}").positions[-1]
@@ -238,14 +235,6 @@ def extend(self, monomer, n, nn, names, joins, ortho=[1,1,1],
238235

239236
u_r2 = u_r1.atoms.rotateby(theta,axis=k,point=V1)
240237

241-
# R= u_.select_atoms('resid '+str(nn)+' and name '+names['R']).positions[0]
242-
# S= u_.select_atoms('resid '+str(nn)+' and name '+names['S']).positions[0]
243-
# RS=S-R
244-
# RS_n=np.linalg.norm(RS)
245-
# ortho_n=np.linalg.norm(ortho)
246-
# check = degrees(np.arccos(np.dot(RS,ortho)/(RS_n * ortho_n)))
247-
# if abs(check)>1: print('linear check =' ,check)
248-
249238
u_r1=u_r2
250239

251240
# combine extended polymer into new universe
@@ -421,7 +410,6 @@ def dihedral_solver(self,pairlist,dummies='X*',cutoff=0.7,backwards_only=True):
421410
resolved and no clashes detected
422411
:rtype: bool
423412
"""
424-
# TODO stepback isn't working right, it's not stepping back far enough
425413
steps=len(pairlist)
426414
tries={x:0 for x in range(0,steps)} # how many steps around the dihedral have we tried? resets to zero if you step backwards
427415
fails={x:0 for x in range(0,steps)} # how many times have we had to step backwards at this monomer? the more times, the further back we step
@@ -461,7 +449,7 @@ def dihedral_solver(self,pairlist,dummies='X*',cutoff=0.7,backwards_only=True):
461449
done=True
462450
if failed or i<0: # hard coded to detect failure if you stop at i<=0 because detecting this automatically wasn't working
463451
print('Could not reach a valid conformation')
464-
print('Perhaps you should try building a pseudolinear geometry with .extend(linearize=True) or randomising all dihedrals with shuffler(), and then try solving a conformation again')
452+
print('Perhaps you should try building a pseudolinear geometry with .extend(linearise=True) or randomising a subset of the dihedrals with shuffler(), and then try solving a conformation again')
465453
return True
466454
else:
467455
return False

polyconf_examples/01a_build_PEI_with_extend.py

100644100755
File mode changed.

polyconf_examples/01b_build_PEI_with_linear_extend.py

100644100755
File mode changed.

polyconf_examples/01c_build_PEI_then_solve.py

100644100755
File mode changed.

polyconf_examples/01d_build_PEI_conformation.py

100644100755
File mode changed.

polyconf_examples/01e_build_PEI_conformation_ensemble.py

100644100755
File mode changed.

polyconf_examples/02a_build_PMMA_isotactic.py

100644100755
File mode changed.

polyconf_examples/02b_build_PMMA_syndiotactic.py

100644100755
File mode changed.

polyconf_examples/02c_build_PMMA_atactic.py

100644100755
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@
5151
dh += [sidechains[i]]
5252

5353
print('attempting to solve initial conformation')
54+
print('the random seed in this example script has been chosen specifically so that this process fails')
55+
print('this is expected and is part of the tutorial')
5456

5557
PMMA_atactic.dihedral_solver(dh,dummies=dummies,cutoff=1.1)
5658

polyconf_examples/02d_build_PMMA_atactic_with_linear_extend.py

100644100755
File mode changed.

0 commit comments

Comments
 (0)