def get_gaps(bands):
    """Calculate gaps from bands

    Parameters
    ----------
    bands : array_like of array_like of float
        Energy bands of model

    Returns
    -------
    gaps list of float
        Energy gaps of model
    """
    if not len(bands):
        return None
    b = bands[0]
    gaps = [[0, b[0]]]
    for i in range(0, len(bands) - 1):
        gaps.append([bands[i][1], bands[i + 1][0]])
    return gaps