def read_file(filepath):
    """Open and read file contents.

    Parameters
    ----------
    filepath : str
        path to a file

    Returns
    -------
    str
        contents of file

    Raises
    ------
    IOError
        if file does not exist
    """
    file_data = None
    with open(filepath, "r") as f:
        file_data = f.read()
    return file_data