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
efc8cdba
Commit
efc8cdba
authored
Nov 15, 2011
by
Peter Eastman
Browse files
Fixed error when retrieving a numpy array twice
parent
f6c08a06
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
wrappers/python/src/swig_doxygen/swig_lib/python/pythoncode.i
...pers/python/src/swig_doxygen/swig_lib/python/pythoncode.i
+8
-8
No files found.
wrappers/python/src/swig_doxygen/swig_lib/python/pythoncode.i
View file @
efc8cdba
...
...
@@ -80,11 +80,11 @@ class State(_object):
def
getPeriodicBoxVectors
(
self
,
asNumpy
=
False
)
:
"""Get the three periodic box vectors if this state is from a
simulation using PBC ."""
if
not
self
.
_periodicBoxVectorsList
:
if
self
.
_periodicBoxVectorsList
is
None
:
raise
TypeError
(
'
periodic
box
vectors
were
not
available
.'
)
if
asNumpy
:
if
not
self
.
_periodicBoxVectorsListNumpy
:
if
self
.
_periodicBoxVectorsListNumpy
is
None
:
self
.
_periodicBoxVectorsListNumpy
=
\
numpy
.
array
(
self
.
_periodicBoxVectorsList
)
returnValue
=
self
.
_periodicBoxVectorsListNumpy
...
...
@@ -104,11 +104,11 @@ class State(_object):
or unit.nanometer. See the following for details:
https://simtk.org/home/python_units
"""
if
not
self
.
_coordList
:
if
self
.
_coordList
is
None
:
raise
TypeError
(
'
Positions
were
not
requested
in
getState
()
call
,
so
are
not
available
.'
)
if
asNumpy
:
if
not
self
.
_coordListNumpy
:
if
self
.
_coordListNumpy
is
None
:
self
.
_coordListNumpy
=
numpy
.
array
(
self
.
_coordList
)
returnValue
=
self
.
_coordListNumpy
else
:
...
...
@@ -128,11 +128,11 @@ class State(_object):
etc. See the following for details:
https://simtk.org/home/python_units
"""
if
not
self
.
_velList
:
if
self
.
_velList
is
None
:
raise
TypeError
(
'
Velocities
were
not
requested
in
getState
()
call
,
so
are
not
available
.'
)
if
asNumpy
:
if
not
self
.
_velListNumpy
:
if
self
.
_velListNumpy
is
None
:
self
.
_velListNumpy
=
numpy
.
array
(
self
.
_velList
)
returnValue
=
self
.
_velListNumpy
else
:
...
...
@@ -153,11 +153,11 @@ class State(_object):
See the following for details:
https://simtk.org/home/python_units
"""
if
not
self
.
_forceList
:
if
self
.
_forceList
is
None
:
raise
TypeError
(
'
Forces
were
not
requested
in
getState
()
call
,
so
are
not
available
.'
)
if
asNumpy
:
if
not
self
.
_forceListNumpy
:
if
self
.
_forceListNumpy
is
None
:
self
.
_forceListNumpy
=
numpy
.
array
(
self
.
_forceList
)
returnValue
=
self
.
_forceListNumpy
else
:
...
...
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