Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
tsoc
openmm
Commits
53de9f14
Commit
53de9f14
authored
Apr 19, 2020
by
YevChern
Browse files
Allow rounding errors in constrain distance comparison
parent
250e8699
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
14 deletions
+35
-14
wrappers/python/tests/TestCharmmFiles.py
wrappers/python/tests/TestCharmmFiles.py
+35
-14
No files found.
wrappers/python/tests/TestCharmmFiles.py
View file @
53de9f14
...
@@ -432,56 +432,77 @@ class TestCharmmFiles(unittest.TestCase):
...
@@ -432,56 +432,77 @@ class TestCharmmFiles(unittest.TestCase):
system_openmm
=
forcefield
.
createSystem
(
topology
,
constraints
=
None
,
rigidWater
=
True
,
nonbondedMethod
=
PME
,
system_openmm
=
forcefield
.
createSystem
(
topology
,
constraints
=
None
,
rigidWater
=
True
,
nonbondedMethod
=
PME
,
nonbondedCutoff
=
8
*
angstroms
)
nonbondedCutoff
=
8
*
angstroms
)
self
.
assertEqual
(
self
.
assertEqual
(
sorted
(
system_charmm
.
getConstraintParameters
(
i
)
for
i
in
range
(
system_charmm
.
getNumConstraints
())),
sorted
(
system_charmm
.
getConstraintParameters
(
i
)[:
2
]
for
i
in
range
(
system_charmm
.
getNumConstraints
())),
sorted
(
system_charmm
.
getConstraintParameters
(
j
)
for
j
in
range
(
system_charmm
.
getNumConstraints
())))
sorted
(
system_openmm
.
getConstraintParameters
(
j
)[:
2
]
for
j
in
range
(
system_openmm
.
getNumConstraints
())))
for
i
in
range
(
system_charmm
.
getNumConstraints
()):
self
.
assertAlmostEqual
(
system_charmm
.
getConstraintParameters
(
i
)[
2
],
system_openmm
.
getConstraintParameters
(
i
)[
2
],
delta
=
1e-7
*
nanometers
)
system_charmm
=
psf
.
createSystem
(
params
,
constraints
=
HBonds
,
rigidWater
=
False
,
nonbondedMethod
=
PME
,
system_charmm
=
psf
.
createSystem
(
params
,
constraints
=
HBonds
,
rigidWater
=
False
,
nonbondedMethod
=
PME
,
nonbondedCutoff
=
8
*
angstroms
)
nonbondedCutoff
=
8
*
angstroms
)
system_openmm
=
forcefield
.
createSystem
(
topology
,
constraints
=
HBonds
,
rigidWater
=
False
,
nonbondedMethod
=
PME
,
system_openmm
=
forcefield
.
createSystem
(
topology
,
constraints
=
HBonds
,
rigidWater
=
False
,
nonbondedMethod
=
PME
,
nonbondedCutoff
=
8
*
angstroms
)
nonbondedCutoff
=
8
*
angstroms
)
self
.
assertEqual
(
self
.
assertEqual
(
sorted
(
system_charmm
.
getConstraintParameters
(
i
)
for
i
in
range
(
system_charmm
.
getNumConstraints
())),
sorted
(
system_charmm
.
getConstraintParameters
(
i
)[:
2
]
for
i
in
range
(
system_charmm
.
getNumConstraints
())),
sorted
(
system_charmm
.
getConstraintParameters
(
j
)
for
j
in
range
(
system_charmm
.
getNumConstraints
())))
sorted
(
system_openmm
.
getConstraintParameters
(
j
)[:
2
]
for
j
in
range
(
system_openmm
.
getNumConstraints
())))
for
i
in
range
(
system_charmm
.
getNumConstraints
()):
self
.
assertAlmostEqual
(
system_charmm
.
getConstraintParameters
(
i
)[
2
],
system_openmm
.
getConstraintParameters
(
i
)[
2
],
delta
=
1e-7
*
nanometers
)
system_charmm
=
psf
.
createSystem
(
params
,
constraints
=
HBonds
,
rigidWater
=
True
,
nonbondedMethod
=
PME
,
system_charmm
=
psf
.
createSystem
(
params
,
constraints
=
HBonds
,
rigidWater
=
True
,
nonbondedMethod
=
PME
,
nonbondedCutoff
=
8
*
angstroms
)
nonbondedCutoff
=
8
*
angstroms
)
system_openmm
=
forcefield
.
createSystem
(
topology
,
constraints
=
HBonds
,
rigidWater
=
True
,
nonbondedMethod
=
PME
,
system_openmm
=
forcefield
.
createSystem
(
topology
,
constraints
=
HBonds
,
rigidWater
=
True
,
nonbondedMethod
=
PME
,
nonbondedCutoff
=
8
*
angstroms
)
nonbondedCutoff
=
8
*
angstroms
)
self
.
assertEqual
(
self
.
assertEqual
(
sorted
(
system_charmm
.
getConstraintParameters
(
i
)
for
i
in
range
(
system_charmm
.
getNumConstraints
())),
sorted
(
system_charmm
.
getConstraintParameters
(
i
)[:
2
]
for
i
in
range
(
system_charmm
.
getNumConstraints
())),
sorted
(
system_charmm
.
getConstraintParameters
(
j
)
for
j
in
range
(
system_charmm
.
getNumConstraints
())))
sorted
(
system_openmm
.
getConstraintParameters
(
j
)[:
2
]
for
j
in
range
(
system_openmm
.
getNumConstraints
())))
for
i
in
range
(
system_charmm
.
getNumConstraints
()):
self
.
assertAlmostEqual
(
system_charmm
.
getConstraintParameters
(
i
)[
2
],
system_openmm
.
getConstraintParameters
(
i
)[
2
],
delta
=
1e-7
*
nanometers
)
system_charmm
=
psf
.
createSystem
(
params
,
constraints
=
AllBonds
,
rigidWater
=
False
,
nonbondedMethod
=
PME
,
system_charmm
=
psf
.
createSystem
(
params
,
constraints
=
AllBonds
,
rigidWater
=
False
,
nonbondedMethod
=
PME
,
nonbondedCutoff
=
8
*
angstroms
)
nonbondedCutoff
=
8
*
angstroms
)
system_openmm
=
forcefield
.
createSystem
(
topology
,
constraints
=
AllBonds
,
rigidWater
=
False
,
nonbondedMethod
=
PME
,
system_openmm
=
forcefield
.
createSystem
(
topology
,
constraints
=
AllBonds
,
rigidWater
=
False
,
nonbondedMethod
=
PME
,
nonbondedCutoff
=
8
*
angstroms
)
nonbondedCutoff
=
8
*
angstroms
)
self
.
assertEqual
(
self
.
assertEqual
(
sorted
(
system_charmm
.
getConstraintParameters
(
i
)
for
i
in
range
(
system_charmm
.
getNumConstraints
())),
sorted
(
system_charmm
.
getConstraintParameters
(
i
)[:
2
]
for
i
in
range
(
system_charmm
.
getNumConstraints
())),
sorted
(
system_charmm
.
getConstraintParameters
(
j
)
for
j
in
range
(
system_charmm
.
getNumConstraints
())))
sorted
(
system_openmm
.
getConstraintParameters
(
j
)[:
2
]
for
j
in
range
(
system_openmm
.
getNumConstraints
())))
for
i
in
range
(
system_charmm
.
getNumConstraints
()):
self
.
assertAlmostEqual
(
system_charmm
.
getConstraintParameters
(
i
)[
2
],
system_openmm
.
getConstraintParameters
(
i
)[
2
],
delta
=
1e-7
*
nanometers
)
system_charmm
=
psf
.
createSystem
(
params
,
constraints
=
AllBonds
,
rigidWater
=
True
,
nonbondedMethod
=
PME
,
system_charmm
=
psf
.
createSystem
(
params
,
constraints
=
AllBonds
,
rigidWater
=
True
,
nonbondedMethod
=
PME
,
nonbondedCutoff
=
8
*
angstroms
)
nonbondedCutoff
=
8
*
angstroms
)
system_openmm
=
forcefield
.
createSystem
(
topology
,
constraints
=
AllBonds
,
rigidWater
=
True
,
nonbondedMethod
=
PME
,
system_openmm
=
forcefield
.
createSystem
(
topology
,
constraints
=
AllBonds
,
rigidWater
=
True
,
nonbondedMethod
=
PME
,
nonbondedCutoff
=
8
*
angstroms
)
nonbondedCutoff
=
8
*
angstroms
)
self
.
assertEqual
(
self
.
assertEqual
(
sorted
(
system_charmm
.
getConstraintParameters
(
i
)
for
i
in
range
(
system_charmm
.
getNumConstraints
())),
sorted
(
system_charmm
.
getConstraintParameters
(
i
)[:
2
]
for
i
in
range
(
system_charmm
.
getNumConstraints
())),
sorted
(
system_charmm
.
getConstraintParameters
(
j
)
for
j
in
range
(
system_charmm
.
getNumConstraints
())))
sorted
(
system_openmm
.
getConstraintParameters
(
j
)[:
2
]
for
j
in
range
(
system_openmm
.
getNumConstraints
())))
for
i
in
range
(
system_charmm
.
getNumConstraints
()):
self
.
assertAlmostEqual
(
system_charmm
.
getConstraintParameters
(
i
)[
2
],
system_openmm
.
getConstraintParameters
(
i
)[
2
],
delta
=
1e-7
*
nanometers
)
system_charmm
=
psf
.
createSystem
(
params
,
constraints
=
HAngles
,
rigidWater
=
False
,
nonbondedMethod
=
PME
,
system_charmm
=
psf
.
createSystem
(
params
,
constraints
=
HAngles
,
rigidWater
=
False
,
nonbondedMethod
=
PME
,
nonbondedCutoff
=
8
*
angstroms
)
nonbondedCutoff
=
8
*
angstroms
)
system_openmm
=
forcefield
.
createSystem
(
topology
,
constraints
=
HAngles
,
rigidWater
=
False
,
nonbondedMethod
=
PME
,
system_openmm
=
forcefield
.
createSystem
(
topology
,
constraints
=
HAngles
,
rigidWater
=
False
,
nonbondedMethod
=
PME
,
nonbondedCutoff
=
8
*
angstroms
)
nonbondedCutoff
=
8
*
angstroms
)
self
.
assertEqual
(
self
.
assertEqual
(
sorted
(
system_charmm
.
getConstraintParameters
(
i
)
for
i
in
range
(
system_charmm
.
getNumConstraints
())),
sorted
(
system_charmm
.
getConstraintParameters
(
i
)[:
2
]
for
i
in
range
(
system_charmm
.
getNumConstraints
())),
sorted
(
system_charmm
.
getConstraintParameters
(
j
)
for
j
in
range
(
system_charmm
.
getNumConstraints
())))
sorted
(
system_openmm
.
getConstraintParameters
(
j
)[:
2
]
for
j
in
range
(
system_openmm
.
getNumConstraints
())))
for
i
in
range
(
system_charmm
.
getNumConstraints
()):
self
.
assertAlmostEqual
(
system_charmm
.
getConstraintParameters
(
i
)[
2
],
system_openmm
.
getConstraintParameters
(
i
)[
2
],
delta
=
1e-7
*
nanometers
)
system_charmm
=
psf
.
createSystem
(
params
,
constraints
=
HAngles
,
rigidWater
=
True
,
nonbondedMethod
=
PME
,
system_charmm
=
psf
.
createSystem
(
params
,
constraints
=
HAngles
,
rigidWater
=
True
,
nonbondedMethod
=
PME
,
nonbondedCutoff
=
8
*
angstroms
)
nonbondedCutoff
=
8
*
angstroms
)
system_openmm
=
forcefield
.
createSystem
(
topology
,
constraints
=
HAngles
,
rigidWater
=
True
,
nonbondedMethod
=
PME
,
system_openmm
=
forcefield
.
createSystem
(
topology
,
constraints
=
HAngles
,
rigidWater
=
True
,
nonbondedMethod
=
PME
,
nonbondedCutoff
=
8
*
angstroms
)
nonbondedCutoff
=
8
*
angstroms
)
self
.
assertEqual
(
self
.
assertEqual
(
sorted
(
system_charmm
.
getConstraintParameters
(
i
)
for
i
in
range
(
system_charmm
.
getNumConstraints
())),
sorted
(
system_charmm
.
getConstraintParameters
(
i
)[:
2
]
for
i
in
range
(
system_charmm
.
getNumConstraints
())),
sorted
(
system_charmm
.
getConstraintParameters
(
j
)
for
j
in
range
(
system_charmm
.
getNumConstraints
())))
sorted
(
system_openmm
.
getConstraintParameters
(
j
)[:
2
]
for
j
in
range
(
system_openmm
.
getNumConstraints
())))
for
i
in
range
(
system_charmm
.
getNumConstraints
()):
self
.
assertAlmostEqual
(
system_charmm
.
getConstraintParameters
(
i
)[
2
],
system_openmm
.
getConstraintParameters
(
i
)[
2
],
delta
=
1e-7
*
nanometers
)
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
unittest
.
main
()
unittest
.
main
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment