Commit 12daada5 authored by Peter Eastman's avatar Peter Eastman
Browse files

Fixed error in wrapping of arguments that are maps

parent 470c9b7f
......@@ -18,6 +18,7 @@ See https://simtk.org/home/pyopenmm for details"
%include "std_string.i"
%include "std_iostream.i"
%include "std_map.i"
%include "std_pair.i"
%include "std_vector.i"
namespace std {
......@@ -28,6 +29,7 @@ namespace std {
%template(vectorii) vector < vector<int> >;
%template(vectorpairii) vector< pair<int,int> >;
%template(vectorstring) vector<string>;
%template(mapstringstring) map<string,string>;
};
%include "windows.i"
......
......@@ -257,6 +257,17 @@ def stripUnits(args):
arg=arg.value_in_unit_system(unit.md_unit_system)
# JDC: End workaround.
#arg=arg.value_in_unit_system(unit.md_unit_system)
elif isinstance(arg, dict):
newArg = {}
for key in arg:
newKey = key
newValue = arg[key]
if not _is_string(newKey):
newKey = stripUnits(newKey)
if not _is_string(newValue):
newValue = stripUnits(newValue)
newArg[newKey] = newValue
arg = newArg
elif not _is_string(arg):
try:
iter(arg)
......
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