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
Hide 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):
...
@@ -80,11 +80,11 @@ class State(_object):
def
getPeriodicBoxVectors
(
self
,
asNumpy
=
False
)
:
def
getPeriodicBoxVectors
(
self
,
asNumpy
=
False
)
:
"""Get the three periodic box vectors if this state is from a
"""Get the three periodic box vectors if this state is from a
simulation using PBC ."""
simulation using PBC ."""
if
not
self
.
_periodicBoxVectorsList
:
if
self
.
_periodicBoxVectorsList
is
None
:
raise
TypeError
(
'
periodic
box
vectors
were
not
available
.'
)
raise
TypeError
(
'
periodic
box
vectors
were
not
available
.'
)
if
asNumpy
:
if
asNumpy
:
if
not
self
.
_periodicBoxVectorsListNumpy
:
if
self
.
_periodicBoxVectorsListNumpy
is
None
:
self
.
_periodicBoxVectorsListNumpy
=
\
self
.
_periodicBoxVectorsListNumpy
=
\
numpy
.
array
(
self
.
_periodicBoxVectorsList
)
numpy
.
array
(
self
.
_periodicBoxVectorsList
)
returnValue
=
self
.
_periodicBoxVectorsListNumpy
returnValue
=
self
.
_periodicBoxVectorsListNumpy
...
@@ -104,11 +104,11 @@ class State(_object):
...
@@ -104,11 +104,11 @@ class State(_object):
or unit.nanometer. See the following for details:
or unit.nanometer. See the following for details:
https://simtk.org/home/python_units
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
.'
)
raise
TypeError
(
'
Positions
were
not
requested
in
getState
()
call
,
so
are
not
available
.'
)
if
asNumpy
:
if
asNumpy
:
if
not
self
.
_coordListNumpy
:
if
self
.
_coordListNumpy
is
None
:
self
.
_coordListNumpy
=
numpy
.
array
(
self
.
_coordList
)
self
.
_coordListNumpy
=
numpy
.
array
(
self
.
_coordList
)
returnValue
=
self
.
_coordListNumpy
returnValue
=
self
.
_coordListNumpy
else
:
else
:
...
@@ -128,11 +128,11 @@ class State(_object):
...
@@ -128,11 +128,11 @@ class State(_object):
etc. See the following for details:
etc. See the following for details:
https://simtk.org/home/python_units
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
.'
)
raise
TypeError
(
'
Velocities
were
not
requested
in
getState
()
call
,
so
are
not
available
.'
)
if
asNumpy
:
if
asNumpy
:
if
not
self
.
_velListNumpy
:
if
self
.
_velListNumpy
is
None
:
self
.
_velListNumpy
=
numpy
.
array
(
self
.
_velList
)
self
.
_velListNumpy
=
numpy
.
array
(
self
.
_velList
)
returnValue
=
self
.
_velListNumpy
returnValue
=
self
.
_velListNumpy
else
:
else
:
...
@@ -153,11 +153,11 @@ class State(_object):
...
@@ -153,11 +153,11 @@ 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
not
self
.
_forceList
:
if
self
.
_forceList
is
None
:
raise
TypeError
(
'
Forces
were
not
requested
in
getState
()
call
,
so
are
not
available
.'
)
raise
TypeError
(
'
Forces
were
not
requested
in
getState
()
call
,
so
are
not
available
.'
)
if
asNumpy
:
if
asNumpy
:
if
not
self
.
_forceListNumpy
:
if
self
.
_forceListNumpy
is
None
:
self
.
_forceListNumpy
=
numpy
.
array
(
self
.
_forceList
)
self
.
_forceListNumpy
=
numpy
.
array
(
self
.
_forceList
)
returnValue
=
self
.
_forceListNumpy
returnValue
=
self
.
_forceListNumpy
else
:
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