import string


def generate_condition(pots, temperature, tolerance=0.001):
    """Create a json object that contains the information for one
    of the custom conditions, so that you can stick it into a list

    :pots: list of float (length should match number of compositions)
    :temperature: float
    :tolerance: float
    :returns: dict
    """
    settings = dict()
    settings["param_chem_pot"] = dict()
    for ix, mu in enumerate(pots):
        label = string.ascii_lowercase[ix]
        settings["param_chem_pot"][label] = mu
    settings["temperature"] = temperature
    settings["tolerance"] = tolerance

    return settings