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
0665e20b
"platforms/vscode:/vscode.git/clone" did not exist on "ff88ddadca8ed8a67946efda9550253745401fe4"
Commit
0665e20b
authored
Apr 22, 2013
by
Peter Eastman
Browse files
Fixed bugs in serializing State from Python
parent
282c6f2c
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
0 deletions
+7
-0
wrappers/python/src/swig_doxygen/swig_lib/python/extend.i
wrappers/python/src/swig_doxygen/swig_lib/python/extend.i
+1
-0
wrappers/python/src/swig_doxygen/swig_lib/python/pythoncode.i
...pers/python/src/swig_doxygen/swig_lib/python/pythoncode.i
+6
-0
No files found.
wrappers/python/src/swig_doxygen/swig_lib/python/extend.i
View file @
0665e20b
...
@@ -338,6 +338,7 @@ Parameters:
...
@@ -338,6 +338,7 @@ Parameters:
forces
=
[]
forces
=
[]
kineticEnergy
=
0.0
kineticEnergy
=
0.0
potentialEnergy
=
0.0
potentialEnergy
=
0.0
params
=
{}
types
=
0
types
=
0
try
:
try
:
positions
=
pythonState
.
getPositions
()
.
value_in_unit
(
unit
.
nanometers
)
positions
=
pythonState
.
getPositions
()
.
value_in_unit
(
unit
.
nanometers
)
...
...
wrappers/python/src/swig_doxygen/swig_lib/python/pythoncode.i
View file @
0665e20b
...
@@ -192,6 +192,8 @@ class State(_object):
...
@@ -192,6 +192,8 @@ class State(_object):
See the following for details:
See the following for details:
https://simtk.org/home/python_units
https://simtk.org/home/python_units
"""
"""
if
self
.
_eK0
is
None
:
raise
TypeError
(
'
Energy
was
not
requested
in
getState
()
call
,
so
it
is
not
available
.'
)
return
self
.
_eK0
*
unit
.
kilojoule_per_mole
return
self
.
_eK0
*
unit
.
kilojoule_per_mole
def
getPotentialEnergy
(
self
)
:
def
getPotentialEnergy
(
self
)
:
...
@@ -201,11 +203,15 @@ class State(_object):
...
@@ -201,11 +203,15 @@ class State(_object):
See the following for details:
See the following for details:
https://simtk.org/home/python_units
https://simtk.org/home/python_units
"""
"""
if
self
.
_eP0
is
None
:
raise
TypeError
(
'
Energy
was
not
requested
in
getState
()
call
,
so
it
is
not
available
.'
)
return
self
.
_eP0
*
unit
.
kilojoule_per_mole
return
self
.
_eP0
*
unit
.
kilojoule_per_mole
def
getParameters
(
self
)
:
def
getParameters
(
self
)
:
"""Get a map containing the values of all parameters.
"""Get a map containing the values of all parameters.
"""
"""
if
self
.
_paramMap
is
None
:
raise
TypeError
(
'
Parameters
were
not
requested
in
getState
()
call
,
so
are
not
available
.'
)
return
self
.
_paramMap
return
self
.
_paramMap
...
...
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