def get_tols(method, tol):
    """
    quick function to set the tolerances as a dictionary depending on the method being used
    :param method: str: method to use
    :param tol: tolerance as a float
    :return:
    """
    if method in ['leastsq', 'least_squares']:
        tols = {'ftol': tol, 'xtol': tol}
    else:
        tols = {'ftol': tol}
    return tols
