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
4b46bee6
Commit
4b46bee6
authored
Aug 12, 2015
by
peastman
Browse files
Merge pull request #1092 from rmcgibbo/windows-tests
Fix three tests on windows
parents
8a762772
dbfc3024
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
2 deletions
+7
-2
wrappers/python/tests/TestAmberPrmtopFile.py
wrappers/python/tests/TestAmberPrmtopFile.py
+1
-0
wrappers/python/tests/TestCheckpointReporter.py
wrappers/python/tests/TestCheckpointReporter.py
+4
-2
wrappers/python/tests/TestPdbxFile.py
wrappers/python/tests/TestPdbxFile.py
+2
-0
No files found.
wrappers/python/tests/TestAmberPrmtopFile.py
View file @
4b46bee6
...
...
@@ -315,6 +315,7 @@ class TestAmberPrmtopFile(unittest.TestCase):
fname
=
tempfile
.
mktemp
(
suffix
=
'.dcd'
)
simulation
.
reporters
.
append
(
DCDReporter
(
fname
,
1
))
# This is an explicit test for the bugs in issue #850
simulation
.
step
(
5
)
del
simulation
os
.
remove
(
fname
)
def
testChamber
(
self
):
...
...
wrappers/python/tests/TestCheckpointReporter.py
View file @
4b46bee6
import
os
import
unittest
import
tempfile
import
numpy
as
np
...
...
@@ -18,7 +19,7 @@ class TestCheckpointReporter(unittest.TestCase):
self
.
simulation
.
context
.
setPositions
(
pdb
.
positions
)
def
test_1
(
self
):
file
=
tempfile
.
NamedTemporaryFile
()
file
=
tempfile
.
NamedTemporaryFile
(
delete
=
False
)
self
.
simulation
.
reporters
.
append
(
app
.
CheckpointReporter
(
file
,
1
))
self
.
simulation
.
step
(
1
)
...
...
@@ -27,9 +28,10 @@ class TestCheckpointReporter(unittest.TestCase):
# now set the positions into junk...
self
.
simulation
.
context
.
setPositions
(
np
.
random
.
random
(
positions
.
shape
))
# then reload the right positions from the checkpoint
file
.
close
()
with
open
(
file
.
name
,
'rb'
)
as
f
:
self
.
simulation
.
context
.
loadCheckpoint
(
f
.
read
())
file
.
close
(
)
os
.
unlink
(
file
.
name
)
newPositions
=
self
.
simulation
.
context
.
getState
(
getPositions
=
True
).
getPositions
(
asNumpy
=
True
).
_value
np
.
testing
.
assert_array_equal
(
positions
,
newPositions
)
...
...
wrappers/python/tests/TestPdbxFile.py
View file @
4b46bee6
...
...
@@ -70,6 +70,7 @@ class TestPdbxFile(unittest.TestCase):
# There should only be 10 frames (0 through 9)
self
.
assertRaises
(
IndexError
,
lambda
:
pdb
.
getPositions
(
frame
=
10
))
self
.
assertIs
(
pdb
.
topology
.
getPeriodicBoxVectors
(),
None
)
del
sim
os
.
unlink
(
'test.cif'
)
def
assertAlmostEqualVec
(
self
,
vec1
,
vec2
,
*
args
,
**
kwargs
):
...
...
@@ -111,6 +112,7 @@ class TestPdbxFile(unittest.TestCase):
self
.
assertAlmostEqualVec
(
parm
.
topology
.
getPeriodicBoxVectors
()[
2
],
pdb
.
topology
.
getPeriodicBoxVectors
()[
2
],
places
=
5
)
del
sim
os
.
unlink
(
'test.cif'
)
if
__name__
==
'__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