Commit 7ba1a10c authored by Peter Eastman's avatar Peter Eastman
Browse files

Merge branch 'master' of https://github.com/SimTk/openmm

parents c698141a 7253aca3
......@@ -64,6 +64,14 @@ using namespace OpenMM;
%include OpenMM_headers.i
%pythoncode %{
# when we import * from the python module, we only want to import the
# actual classes, and not the swigregistration methods, which have already
# been called, and are now unneeded by the user code, and only pollute the
# namespace
__all__ = [k for k in locals().keys() if not k.endswith('_swigregister')]
%}
/*
%extend OpenMM::XmlSerializer {
%template(XmlSerializer_serialize_AndersenThermostat) XmlSerializer::serialize<AndersenThermostat>;
......
......@@ -5,6 +5,7 @@ try:
except:
pass
import sys
import math
RMIN_PER_SIGMA=math.pow(2, 1/6.0)
RVDW_PER_SIGMA=math.pow(2, 1/6.0)/2.0
......@@ -273,14 +274,15 @@ def stripUnits(args):
"""
newArgList=[]
for arg in args:
if unit.is_quantity(arg):
if 'numpy' in sys.modules and isinstance(arg, numpy.ndarray):
arg = arg.tolist()
elif unit.is_quantity(arg):
# JDC: Ugly workaround for OpenMM using 'bar' for fundamental pressure unit.
if arg.unit.is_compatible(unit.bar):
arg = arg / unit.bar
else:
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):
newKeys = stripUnits(arg.keys())
newValues = stripUnits(arg.values())
......
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