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
f1599c79
Commit
f1599c79
authored
Jul 05, 2014
by
John Chodera (MSKCC)
Browse files
Changed platform used in UTF-8 test.
parent
7c81f1b7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
5 deletions
+7
-5
wrappers/python/tests/TestBytes.py
wrappers/python/tests/TestBytes.py
+7
-5
No files found.
wrappers/python/tests/TestBytes.py
View file @
f1599c79
...
@@ -8,7 +8,8 @@ class TestBytes(unittest.TestCase):
...
@@ -8,7 +8,8 @@ class TestBytes(unittest.TestCase):
system
.
addParticle
(
1.0
)
system
.
addParticle
(
1.0
)
refPositions
=
[(
0
,
0
,
0
)]
refPositions
=
[(
0
,
0
,
0
)]
context
=
mm
.
Context
(
system
,
mm
.
VerletIntegrator
(
0
))
platform
=
mm
.
Platform
.
getPlatformByName
(
'Reference'
)
context
=
mm
.
Context
(
system
,
mm
.
VerletIntegrator
(
0
),
platform
)
context
.
setPositions
(
refPositions
)
context
.
setPositions
(
refPositions
)
chk
=
context
.
createCheckpoint
()
chk
=
context
.
createCheckpoint
()
# check that the return value of createCheckpoint is of type bytes (non-unicode)
# check that the return value of createCheckpoint is of type bytes (non-unicode)
...
@@ -23,14 +24,15 @@ class TestBytes(unittest.TestCase):
...
@@ -23,14 +24,15 @@ class TestBytes(unittest.TestCase):
assert
newPositions
==
refPositions
assert
newPositions
==
refPositions
# try encoding the checkpoint in utf-8. OpenMM should be able to handle this too
# try encoding the checkpoint in utf-8. OpenMM should be able to handle this too
# JDC: TRAVIS DEBUG
# JDC: TRAVIS DEBUG
BEGIN
print
"chk = "
print
"chk = "
print
chk
print
chk
print
"chk.decode('utf-8') = "
print
"chk.decode('utf-8') = "
print
chk
.
decode
(
'utf-8'
)
print
chk
.
decode
(
'utf-8'
)
#context.setPositions([(12345, 12345, 123451)])
# JDC: TRAVIS DEBUG END
#context.loadCheckpoint(chk.decode('utf-8'))
context
.
setPositions
([(
12345
,
12345
,
123451
)])
#newPositions = context.getState(getPositions=True).getPositions()._value
context
.
loadCheckpoint
(
chk
.
decode
(
'utf-8'
))
newPositions
=
context
.
getState
(
getPositions
=
True
).
getPositions
().
_value
assert
newPositions
==
refPositions
assert
newPositions
==
refPositions
...
...
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