make xlwings optional
import numpy as np
from scipy import interpolate
+try:
import xlwings as xw
+ HAS_XLWINGS = True
+except ImportError:
+ HAS_XLWINGS = False
from ...libutils import get_imports
IMPORTS = get_imports(globals())
+if HAS_XLWINGS:
@xw.func
@xw.arg('x', np.array, ndim=1)
@xw.arg('y', np.array, ndim=1)
@@ -44,7 +49,6 @@ def linear_interpolation(x, y, xnew, fill_value=None):
return np.expand_dims(ynew, axis=1)
-
@xw.func
@xw.arg('points', np.array, ndim=2)
@xw.arg('values', np.array, ndim=1)
@@ -57,14 +61,12 @@ def nd_linear_interpolation(points, values, points_new):
return np.expand_dims(values_new, axis=1)
-
@xw.func
@xw.arg('values', np.array, ndim=2)
@xw.ret(expand='table')
def npravel(values):
return np.expand_dims(np.ravel(values.T), axis=1)
-
@xw.func
@xw.arg('values', np.array, ndim=2)
@xw.arg('repeats')
