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
67878bab
Commit
67878bab
authored
Mar 27, 2014
by
Robert McGibbon
Browse files
Get it working
parent
fe129ae2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
0 deletions
+18
-0
wrappers/python/src/swig_doxygen/swig_lib/python/typemaps.i
wrappers/python/src/swig_doxygen/swig_lib/python/typemaps.i
+3
-0
wrappers/python/tests/TestBytes.py
wrappers/python/tests/TestBytes.py
+15
-0
No files found.
wrappers/python/src/swig_doxygen/swig_lib/python/typemaps.i
View file @
67878bab
...
@@ -156,3 +156,6 @@
...
@@ -156,3 +156,6 @@
$
3
=
&
tempC;
$
3
=
&
tempC;
}
}
%
typemap
(
out
)
std
::
string
OpenMM
::
Context
::
createCheckpoint{
$
result
=
PyBytes_FromString
(
$
1.
c_str
())
;
}
\ No newline at end of file
wrappers/python/tests/TestBytes.py
0 → 100644
View file @
67878bab
import
unittest
import
simtk.openmm
as
mm
class
TestBytes
(
unittest
.
TestCase
):
def
test_createCheckpoint
(
self
):
# check that the return value of createCheckpoint is of type bytes (non-unicode)
system
=
mm
.
System
()
system
.
addParticle
(
1.0
)
mm
.
Context
(
system
,
mm
.
VerletIntegrator
(
0
))
chk
=
mm
.
Context
(
system
,
mm
.
VerletIntegrator
(
0
)).
createCheckpoint
()
assert
isinstance
(
chk
,
bytes
)
if
__name__
==
'__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