import re


def determine_scene_type(config_file):
    """Determine the scene type given a configuration file."""
    # don't parse the entire ini file, only look for scene_type
    scene_type = None
    pattern = re.compile('^\s*scene_type\s*=\s*(.*)\s*$', re.IGNORECASE)    # noqa
    with open(config_file) as f:
        for line in f:
            match = pattern.match(line)
            if match is not None:
                scene_type = match.group(1)
    if scene_type is None:
        raise RuntimeError("scene_type missing from configuration file. Is your config valid?")
    return scene_type