How to use the xlwings.arg function in xlwings

To help you get started, we’ve selected a few xlwings examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github pymedphys / pymedphys / packages / pymedphys_xlwings / src / pymedphys_xlwings / xlwings / dicom.py View on Github external
@xw.arg("dicom_path")
@xw.arg("depth_adjust")
@xw.arg("depth_lookup")
@xw.arg("averaging_distance")
@xw.ret(expand="table")
def inplane_profile(dicom_path, depth_adjust, depth_lookup, averaging_distance=0):
    dicom_path_found = wildcard_file_resolution(dicom_path)

    ds = pydicom.read_file(dicom_path_found, force=True)

    inplane, inplane_dose, _, _ = extract_profiles(
        ds, depth_adjust, depth_lookup, averaging_distance
    )

    return np.vstack([inplane, inplane_dose]).T
github pymedphys / pymedphys / packages / pymedphys_xlwings / src / pymedphys_xlwings / xlwings / numpy.py View on Github external
@xw.arg("values", np.array, ndim=2)
@xw.ret(expand="table")
def npravel(values):
    return np.expand_dims(np.ravel(values.T), axis=1)
github pymedphys / pymedphys / packages / pymedphys_xlwings / src / pymedphys_xlwings / xlwings / dicom.py View on Github external
@xw.arg("depth_lookup")
@xw.arg("averaging_distance")
@xw.ret(expand="table")
def crossplane_profile(dicom_path, depth_adjust, depth_lookup, averaging_distance=0):
    dicom_path_found = wildcard_file_resolution(dicom_path)

    ds = pydicom.read_file(dicom_path_found, force=True)

    _, _, crossplane, crossplane_dose = extract_profiles(
        ds, depth_adjust, depth_lookup, averaging_distance
    )

    return np.vstack([crossplane, crossplane_dose]).T
github alpha-miner / Finance-Python / excel / pyfin.py View on Github external
@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'):
    x = scb(strikes,
            volatilites,
            forward,
github pymedphys / pymedphys / packages / pymedphys_xlwings / src / pymedphys_xlwings / xlwings / interpolate.py View on Github external
@xw.arg("points", np.array, ndim=2)
@xw.arg("values", np.array, ndim=1)
@xw.arg("points_new", np.array, ndim=2)
@xw.ret(expand="table")
def nd_linear_interpolation(points, values, points_new):
    func = interpolate.LinearNDInterpolator(points, values)

    values_new = func(points_new)

    return np.expand_dims(values_new, axis=1)