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
ad0ee95f
Commit
ad0ee95f
authored
Aug 10, 2017
by
peastman
Committed by
GitHub
Aug 10, 2017
Browse files
Merge pull request #1870 from peastman/getintegrator
Context.getIntegrator() returns the original Python object
parents
18a7cac0
e735f14b
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
1 deletion
+20
-1
wrappers/python/src/swig_doxygen/swigInputConfig.py
wrappers/python/src/swig_doxygen/swigInputConfig.py
+2
-1
wrappers/python/src/swig_doxygen/swig_lib/python/extend.i
wrappers/python/src/swig_doxygen/swig_lib/python/extend.i
+10
-0
wrappers/python/src/swig_doxygen/swig_lib/python/pythoncode.i
...pers/python/src/swig_doxygen/swig_lib/python/pythoncode.i
+8
-0
No files found.
wrappers/python/src/swig_doxygen/swigInputConfig.py
View file @
ad0ee95f
...
@@ -90,6 +90,7 @@ SKIP_METHODS = [('State', 'getPositions'),
...
@@ -90,6 +90,7 @@ SKIP_METHODS = [('State', 'getPositions'),
(
'UpdateTimeKernel'
,),
(
'UpdateTimeKernel'
,),
(
'VdwInfo'
,),
(
'VdwInfo'
,),
(
'WcaDispersionInfo'
,),
(
'WcaDispersionInfo'
,),
(
'Context'
,
'getIntegrator'
),
(
'Context'
,
'createCheckpoint'
),
(
'Context'
,
'createCheckpoint'
),
(
'Context'
,
'loadCheckpoint'
),
(
'Context'
,
'loadCheckpoint'
),
(
'CudaPlatform'
,),
(
'CudaPlatform'
,),
...
@@ -111,6 +112,7 @@ SKIP_METHODS = [('State', 'getPositions'),
...
@@ -111,6 +112,7 @@ SKIP_METHODS = [('State', 'getPositions'),
(
'LocalCoordinatesSite'
,
'getOriginWeights'
,
0
),
(
'LocalCoordinatesSite'
,
'getOriginWeights'
,
0
),
(
'LocalCoordinatesSite'
,
'getXWeights'
,
0
),
(
'LocalCoordinatesSite'
,
'getXWeights'
,
0
),
(
'LocalCoordinatesSite'
,
'getYWeights'
,
0
),
(
'LocalCoordinatesSite'
,
'getYWeights'
,
0
),
(
'CompoundIntegrator'
,
'getIntegrator'
),
]
]
# The build script assumes method args that are non-const references are
# The build script assumes method args that are non-const references are
...
@@ -147,7 +149,6 @@ STEAL_OWNERSHIP = {("Platform", "registerPlatform") : [0],
...
@@ -147,7 +149,6 @@ STEAL_OWNERSHIP = {("Platform", "registerPlatform") : [0],
(
"CustomManyParticleForce"
,
"addTabulatedFunction"
)
:
[
1
],
(
"CustomManyParticleForce"
,
"addTabulatedFunction"
)
:
[
1
],
(
"CustomCVForce"
,
"addTabulatedFunction"
)
:
[
1
],
(
"CustomCVForce"
,
"addTabulatedFunction"
)
:
[
1
],
(
"CustomCVForce"
,
"addCollectiveVariable"
)
:
[
1
],
(
"CustomCVForce"
,
"addCollectiveVariable"
)
:
[
1
],
(
"CompoundIntegrator"
,
"addIntegrator"
)
:
[
0
],
}
}
...
...
wrappers/python/src/swig_doxygen/swig_lib/python/extend.i
View file @
ad0ee95f
...
@@ -6,6 +6,9 @@
...
@@ -6,6 +6,9 @@
%
extend
OpenMM
::
Context
{
%
extend
OpenMM
::
Context
{
%
pythoncode
%
{
%
pythoncode
%
{
def
getIntegrator
(
self
)
:
return
self
.
_integrator
def
getState
(
self
,
getPositions
=
False
,
getVelocities
=
False
,
def
getState
(
self
,
getPositions
=
False
,
getVelocities
=
False
,
getForces
=
False
,
getEnergy
=
False
,
getParameters
=
False
,
getForces
=
False
,
getEnergy
=
False
,
getParameters
=
False
,
getParameterDerivatives
=
False
,
enforcePeriodicBox
=
False
,
groups
=-
1
)
:
getParameterDerivatives
=
False
,
enforcePeriodicBox
=
False
,
groups
=-
1
)
:
...
@@ -202,6 +205,13 @@ Parameters:
...
@@ -202,6 +205,13 @@ Parameters:
%
}
%
}
}
}
%
extend
OpenMM
::
CompoundIntegrator
{
%
pythoncode
%
{
def
getIntegrator
(
self
,
index
)
:
return
self
.
_integrators
[
index
]
%
}
}
%
extend
OpenMM
::
System
{
%
extend
OpenMM
::
System
{
%
pythoncode
%
{
%
pythoncode
%
{
def
__getstate__
(
self
)
:
def
__getstate__
(
self
)
:
...
...
wrappers/python/src/swig_doxygen/swig_lib/python/pythoncode.i
View file @
ad0ee95f
...
@@ -28,6 +28,14 @@ from simtk.openmm.vec3 import Vec3
...
@@ -28,6 +28,14 @@ from simtk.openmm.vec3 import Vec3
self
.
_integrator
=
args
[
1
]
self
.
_integrator
=
args
[
1
]
%
}
%
}
%
pythonappend
OpenMM
::
CompoundIntegrator
::
CompoundIntegrator
%
{
self
.
_integrators
=
[]
%
}
%
pythonprepend
OpenMM
::
CompoundIntegrator
::
addIntegrator
%
{
self
.
_integrators
.
append
(
integrator
)
%
}
%
pythonprepend
OpenMM
::
AmoebaAngleForce
::
addAngle
%
{
%
pythonprepend
OpenMM
::
AmoebaAngleForce
::
addAngle
%
{
try
:
try
:
length
=
args
[
3
]
length
=
args
[
3
]
...
...
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