import yaml


def loadfile(f):
    """Loads a YAML file containing several documents into a list of objects

    :param f: string containing the path to the file to load
    :return: list of loaded objects
    """
    try:
        return list(yaml.safe_load_all(open(f)))
    except Exception as e:
        print('Exception caught loading', f, e)
        raise