Commit 4ca69ecc authored by Peter Eastman's avatar Peter Eastman
Browse files

Fixed Python API builder to handle CustomIntegrator

parent 50154b8b
...@@ -42,6 +42,7 @@ ...@@ -42,6 +42,7 @@
#include "openmm/CustomExternalForce.h" #include "openmm/CustomExternalForce.h"
#include "openmm/CustomGBForce.h" #include "openmm/CustomGBForce.h"
#include "openmm/CustomHbondForce.h" #include "openmm/CustomHbondForce.h"
#include "openmm/CustomIntegrator.h"
#include "openmm/CustomNonbondedForce.h" #include "openmm/CustomNonbondedForce.h"
#include "openmm/Force.h" #include "openmm/Force.h"
#include "openmm/GBSAOBCForce.h" #include "openmm/GBSAOBCForce.h"
......
...@@ -392,12 +392,13 @@ class SwigInputBuilder: ...@@ -392,12 +392,13 @@ class SwigInputBuilder:
key=(shortClassName, methName) key=(shortClassName, methName)
#print "key %s %s \n" % (shortClassName, methName) #print "key %s %s \n" % (shortClassName, methName)
addText='' addText=''
returnType = getText("type", memberNode)
if key in self.configModule.UNITS: if key in self.configModule.UNITS:
valueUnits=self.configModule.UNITS[key] valueUnits=self.configModule.UNITS[key]
elif ("*", methName) in self.configModule.UNITS: elif ("*", methName) in self.configModule.UNITS:
valueUnits=self.configModule.UNITS[("*", methName)] valueUnits=self.configModule.UNITS[("*", methName)]
elif methName.startswith('get'): elif methName.startswith('get') and returnType not in ('void', 'int', 'std::string'):
s = 'do not know how to add units to %s::%s' \ s = 'do not know how to add units to %s::%s' \
% (shortClassName, methName) % (shortClassName, methName)
raise Exception(s) raise Exception(s)
......
...@@ -102,6 +102,7 @@ SKIP_METHODS = [('State',), ...@@ -102,6 +102,7 @@ SKIP_METHODS = [('State',),
('IntegrateVariableLangevinStepKernel',), ('IntegrateVariableLangevinStepKernel',),
('IntegrateVariableVerletStepKernel',), ('IntegrateVariableVerletStepKernel',),
('IntegrateVerletStepKernel',), ('IntegrateVerletStepKernel',),
('IntegrateCustomStepKernel',),
('Kernel',), ('Kernel',),
('KernelFactory',), ('KernelFactory',),
('KernelImpl',), ('KernelImpl',),
...@@ -187,6 +188,7 @@ UNITS = { ...@@ -187,6 +188,7 @@ UNITS = {
("*", "getErrorTolerance") : (None, ()), ("*", "getErrorTolerance") : (None, ()),
("*", "getEwaldErrorTolerance") : (None, ()), ("*", "getEwaldErrorTolerance") : (None, ()),
("*", "getFriction") : ("1/unit.picosecond", ()), ("*", "getFriction") : ("1/unit.picosecond", ()),
("*", "getGlobalVariable") : (None, ()),
("*", "getIntegrator") : (None, ()), ("*", "getIntegrator") : (None, ()),
("*", "getMapParameters") : (None, ()), ("*", "getMapParameters") : (None, ()),
("*", "getName") : (None, ()), ("*", "getName") : (None, ()),
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment