def minmax(x, my_min=0, my_max=1):
    """Restrict float to between a minimum and maximum value
    Parameters
    ----------
    x : float
        Value to be restricted between my_min and my_max
    my_min : float
        Minimum value accepted (default 0)
    my_max : float
        Maximum value accepted (default 1)
    
    Returns
    -------
    float
        Value between my_min...my_max
        
    """
    return min(max(x, my_min), my_max)