def espei_occupancies_to_dfttk(occupancies):
    """Convert a ESPEI configuration, e.g. [[0.5, 0.5], 1.0] to DFTTK's configuration [[0.5, 0.5], [1.0]]"""

    dfttk_occupancies = []
    for subl in occupancies:
        if isinstance(subl, float):
            # this sublattice is an endmember, e.g. 1.0 occupancy
            dfttk_occupancies.append([1.0])
        else:
            # this sublattice is an interacting sublattice, e.g. [0.5, 0.5]
            dfttk_occupancies.append([f for f in subl])
    return dfttk_occupancies