def run_spg_pattern_generator()

in src/spg/main.py [0:0]


def run_spg_pattern_generator(
        panels_config_file, walls_config_file, raster_config_file,
        project_config_file, pattern_config_file):

    if not os.path.exists(panels_config_file):
        raise ValueError("Panel config file does not exist {0}".format(panels_config_file))

    if not os.path.exists(walls_config_file):
        raise ValueError("Wall config file does not exist {0}".format(walls_config_file))

    if not os.path.exists(raster_config_file):
        raise ValueError("Raster config file does not exist {0}".format(raster_config_file))

    if not os.path.exists(project_config_file):
        raise ValueError("Project config file does not exist {0}".format(project_config_file))

    if not os.path.exists(pattern_config_file):
        raise ValueError("Pattern config file does not exist {0}".format(pattern_config_file))

    with open(panels_config_file, "r", encoding="utf-8") as handle:
        panels_config = json.load(handle)

    with open(walls_config_file, "r", encoding="utf-8") as handle:
        walls_config = json.load(handle)

    with open(raster_config_file, "r", encoding="utf-8") as handle:
        raster_config = json.load(handle)

    with open(project_config_file, "r", encoding="utf-8") as handle:
        project_config = json.load(handle)

    with open(pattern_config_file, "r", encoding="utf-8") as handle:
        pattern_config = json.load(handle)

    spg = PatternGenerator(
        panels_config, walls_config,
        raster_config, project_config, pattern_config)

    for progress in spg.generate_patterns_and_stitch_rasters():
        print(progress)