Unverified Commit c36c76ca authored by Peter Eastman's avatar Peter Eastman Committed by GitHub
Browse files

Fixed return type of getTabulatedFunction() (#3565)

parent aafb8b5b
...@@ -125,6 +125,7 @@ def getClassMethodList(classNode, skipMethods): ...@@ -125,6 +125,7 @@ def getClassMethodList(classNode, skipMethods):
for memberNode in findNodes(section, "memberdef", kind="function", prot="public"): for memberNode in findNodes(section, "memberdef", kind="function", prot="public"):
methDefinition = getText("definition", memberNode) methDefinition = getText("definition", memberNode)
shortMethDefinition=stripOpenmmPrefix(methDefinition) shortMethDefinition=stripOpenmmPrefix(methDefinition)
shortMethDefinition = shortMethDefinition.replace(' &', '&')
methName=shortMethDefinition.split()[-1] methName=shortMethDefinition.split()[-1]
if (shortClassName, methName) in skipMethods: continue if (shortClassName, methName) in skipMethods: continue
numParams=len(findNodes(memberNode, 'param')) numParams=len(findNodes(memberNode, 'param'))
......
...@@ -466,6 +466,7 @@ class TestAPIUnits(unittest.TestCase): ...@@ -466,6 +466,7 @@ class TestAPIUnits(unittest.TestCase):
force.addPerParticleParameter('m') force.addPerParticleParameter('m')
force.addParticle([1, 2, 3]) force.addParticle([1, 2, 3])
force.addParticle([1*coulombs, 2*kilocalories_per_mole*angstroms**2, 3*kilocalories_per_mole*angstroms**3]) force.addParticle([1*coulombs, 2*kilocalories_per_mole*angstroms**2, 3*kilocalories_per_mole*angstroms**3])
force.addTabulatedFunction('f', Continuous1DFunction([1,2,3,4,5], 0.0, 2.0))
self.assertEqual(force.getNumParticles(), 2) self.assertEqual(force.getNumParticles(), 2)
charge, sigma, epsilon = force.getParticleParameters(0) charge, sigma, epsilon = force.getParticleParameters(0)
...@@ -495,6 +496,8 @@ class TestAPIUnits(unittest.TestCase): ...@@ -495,6 +496,8 @@ class TestAPIUnits(unittest.TestCase):
force.setNonbondedMethod(CustomNonbondedForce.CutoffPeriodic) force.setNonbondedMethod(CustomNonbondedForce.CutoffPeriodic)
self.assertTrue(force.usesPeriodicBoundaryConditions()) self.assertTrue(force.usesPeriodicBoundaryConditions())
self.assertIs(type(force.getTabulatedFunction(0)), Continuous1DFunction)
def testCustomManyParticleForce(self): def testCustomManyParticleForce(self):
""" Tests the CustomManyParticleForce API features """ """ Tests the CustomManyParticleForce API features """
force = CustomManyParticleForce(3, force = CustomManyParticleForce(3,
......
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