import csv


def read_layout(layout):
    """
    Reads out a layout from .csv and puts it in a dictionary
    Args:
        layout(str): filename of the .csv
    Returns:
        pts(dict): A dictionary with all the relevant information from the .csv
    """
    pts = {}
    with open(layout) as csvfile:
        readCSV = csv.reader(csvfile, delimiter=',')
        for row in readCSV:
            if row[0][0] == 'D':
                pts[row[0]] = float(row[1]), float(row[2])
            if row[0][0] == 'T':
                pts[row[0]] = row[1], row[2]
            if row[0][0] == 'U':
                pts[row[0]] = int(row[1]), int(row[2])
    return pts