"""
Main demo eats a config and executes training job.

@author <NAME>
@date 22 Jan 2022
@contact <EMAIL>
"""

import sys
from argparse import ArgumentParser
from yaml import safe_load as yml_safeload

if __name__ == '__main__':
    parser = ArgumentParser(description="desc")
    parser.add_argument('-c', '--config-path', help='Path to config file',
                        default='default_config.yml')
    inputs = parser.parse_args(sys.argv[1:])
    
    # Load config
    config = open(inputs.config_path, 'r')
    config = yml_safeload(config.read())
    
    # Execute training job with the given config
    Trainer = AlternatingMinimizer(config)
    Trainer.train()
    
    # Export data products
    
    
    # Done
    exit()