From 560c979a2113af40c1ea6482b06f31895e17f301 Mon Sep 17 00:00:00 2001 From: Sofus Rose Date: Tue, 28 Nov 2017 12:25:04 -0500 Subject: [PATCH] Fixed issue where lutFunc wouldn't vectorize a Python function over the array. --- openlut/LUT.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openlut/LUT.py b/openlut/LUT.py index 91754ef..8a70cee 100644 --- a/openlut/LUT.py +++ b/openlut/LUT.py @@ -41,8 +41,8 @@ class LUT(Transform) : if dims == 1 : lut = LUT(dims=dims, size=size, title=title, iRange=iRange) - #Use fast function sampling if the function is a C++ function. - vFunc = lambda arr: olo.gam(arr, func) if isinstance(func, types.BuiltinFunctionType) else np.vectorize(func, otypes=[np.float32]) + #Use fast C++ function sampling if the function is a C++ function. + vFunc = lambda arr: olo.gam(arr, func) if isinstance(func, types.BuiltinFunctionType) else np.vectorize(func, otypes=[np.float32])(arr) lut.array = vFunc(lut.array) return lut