def read_list(filename):
    """
    Read file line by line, ignoring lines starting with '#'

    Parameters
    ----------
    filename : str or pathlib.Path

    Returns
    -------
    list
    """

    with open(filename, 'r') as f:
        lines = f.readlines()
    return [line.rstrip('\n') for line in lines if not line.startswith('#')]