Commit b4607862 authored by Robert McGibbon's avatar Robert McGibbon
Browse files

convert numpy arrays to lists in stripUnits

parent 73f7c14e
...@@ -5,6 +5,7 @@ try: ...@@ -5,6 +5,7 @@ try:
except: except:
pass pass
import sys
import math import math
RMIN_PER_SIGMA=math.pow(2, 1/6.0) RMIN_PER_SIGMA=math.pow(2, 1/6.0)
RVDW_PER_SIGMA=math.pow(2, 1/6.0)/2.0 RVDW_PER_SIGMA=math.pow(2, 1/6.0)/2.0
...@@ -273,6 +274,9 @@ def stripUnits(args): ...@@ -273,6 +274,9 @@ def stripUnits(args):
""" """
newArgList=[] newArgList=[]
for arg in args: for arg in args:
if 'numpy' in sys.modules and isinstance(arg, numpy.ndarray):
arg = arg.tolist()
if unit.is_quantity(arg): if unit.is_quantity(arg):
# JDC: Ugly workaround for OpenMM using 'bar' for fundamental pressure unit. # JDC: Ugly workaround for OpenMM using 'bar' for fundamental pressure unit.
if arg.unit.is_compatible(unit.bar): if arg.unit.is_compatible(unit.bar):
......
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