Commit c4d89122 authored by Peter Eastman's avatar Peter Eastman
Browse files

Specified units for some new methods

parent 814aae45
...@@ -431,7 +431,7 @@ class SwigInputBuilder: ...@@ -431,7 +431,7 @@ class SwigInputBuilder:
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') and returnType not in ('void', 'int', 'std::string', 'const std::string &'): elif methName.startswith('get') and returnType not in ('void', 'int', 'bool', 'std::string', 'const std::string &'):
s = 'do not know how to add units to %s %s::%s' \ s = 'do not know how to add units to %s %s::%s' \
% (returnType, shortClassName, methName) % (returnType, shortClassName, methName)
raise Exception(s) raise Exception(s)
......
...@@ -172,6 +172,7 @@ STEAL_OWNERSHIP = {("Platform", "registerPlatform") : [0], ...@@ -172,6 +172,7 @@ STEAL_OWNERSHIP = {("Platform", "registerPlatform") : [0],
UNITS = { UNITS = {
("*", "getConstraintTolerance") : (None, ()), ("*", "getConstraintTolerance") : (None, ()),
("*", "getCutoffDistance") : ("unit.nanometers", ()), ("*", "getCutoffDistance") : ("unit.nanometers", ()),
("*", "getSwitchingDistance") : ("unit.nanometers", ()),
("*", "getDefaultCollisionFrequency") : ("1/unit.picosecond", ()), ("*", "getDefaultCollisionFrequency") : ("1/unit.picosecond", ()),
("*", "getDefaultPeriodicBoxVectors") ("*", "getDefaultPeriodicBoxVectors")
: (None, ('unit.nanometer', 'unit.nanometer', 'unit.nanometer')), : (None, ('unit.nanometer', 'unit.nanometer', 'unit.nanometer')),
......
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