def step(x: float, objective: str, upper: float, lower: float, **kwargs):
    """
    Transform values using a step transformer (threshold)
    :param x: Input value
    :param objective: 'maximize', 'minimize' or 'range'
    :param upper: Upper bound for transforming values ('range' and 'maximize' only)
    :param lower: Lower bound for transforming values ('range' and 'minimize' only)
    :param kwargs:
    :return:
    """
    if objective == 'maximize':
        if x >= upper:
            y = 1.0
        else:
            y = 0.0

    elif objective == 'minimize':
        if x <= lower:
            y = 1.0
        else:
            y = 0.0

    elif objective == 'range':
        if lower <= x <= upper:
            y = 1.0
        else:
            y = 0.0

    else:
        print("linThresh objective must be either \'minimize\' or \'maximize\' or \'range\'")
        raise
    return y