import yaml


def _yaml_to_dict(yaml_filename):
    """Reads and stores a yaml file as a dictionary

    Args:
        yaml_filename (str):
            The filename of the yaml file to read.

    Returns:
        input_dict (dict):
            The result of reading the yaml file and translating
            its structure into a dictionary.

    """

    try:
        # Open the yaml file and import the contents into a
        # dictionary with the same structure
        with open(yaml_filename) as fp:
            input_dict = yaml.load(fp, Loader=yaml.FullLoader)

    except:
        raise ValueError("Could not open file %s" % (yaml_filename))

    return input_dict