Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
@xw.func
@xw.ret(expand='table')
@xw.arg('strikes', np.array, dim=1)
@xw.arg('volatilites', np.array, dim=1)
def sabrCalibration(strikes,
volatilites,
forward,
expiryTime,
intialAlpha,
initialBeta,
initialNu,
initialRho,
isFixedAlpha=False,
isFixedBeta=False,
isFixedNu=False,
isFixedRho=False,
method='trf'):
@xw.func
def sviVolatility(strike, forward, expiry, a, b, sigma, rho, m):
return svi(strike, forward, expiry, a, b, sigma, rho, m)
@xw.func
@xw.arg('x', pd.DataFrame, index=False, header=False)
@xw.ret(index=False, header=False)
def CORREL2(x):
"""Like CORREL, but as array formula for more than 2 data sets"""
return x.corr()
@xw.func
@xw.arg("filepath")
@xw.arg("index")
@xw.ret(expand="table")
def mephysto(filepath, index):
filepath_found = wildcard_file_resolution(filepath)
(axis, reading, scan_curvetype, scan_depth) = load_single_item(
filepath_found, int(index)
)
second_column_header = ["Reading"]
if scan_curvetype == "PDD":
first_column_header = ["Depth Profile", "Depth (mm)"]
second_column_header = [None] + second_column_header
elif scan_curvetype == "INPLANE_PROFILE":
@xw.func
@xw.arg("values", np.array, ndim=2)
@xw.arg("repeats")
@xw.ret(expand="table")
def nprepeat(values, repeats):
return np.expand_dims(np.repeat(values, repeats), axis=1)