def test_transform_real_shopmodel(): with open('./test/gams/real-shopmodel.gms', 'r') as in_file: gp = GamsParser(in_file) model = gp.transform() print("\nModel\n") print(model) print("\nSymbols:\n") for s in model.symbol(): print(s)
def test_transform_real_shopmodel(): with open('./test/gams/inject-datagen.inc','r') as gen_file, \ open('./test/gams/inject-datademand.inc','r') as demand_file, \ open('./test/gams/inject-siteanalysis.gms','r') as main_file: gp_main = GamsParser(main_file) gp_gen = GamsParser(gen_file) gp_demand = GamsParser(demand_file) model_main = gp_main.transform() model_gen = gp_gen.transform() model_demand = gp_gen.transform() model = model_main + model_gen + model_demand print("\nModel\n") print(model) print("\nSymbols:\n") for s in model.symbol(): print(s)
def test_transform_equation_def(): with open('./test/gams/equation-basic.gms', 'r') as in_file: gp = GamsParser(in_file) parse_tree = gp.parse() print(parse_tree.pretty()) model = gp.transform() print("\nModel\n") print(model) print("\nSymbols:\n") for s in model.symbol(): print(s)
def test_transform_model_siteanalysis(): with open('./test/gams/real-siteanalysis.gms', 'r') as in_file: gp = GamsParser(in_file) model = gp.transform() print("\nModel\n") print(model) print("\nSymbols:\n") for s in model.symbol(): print(s) dm = model.toJSON() #print("\nmodel.toJSON\n") #print(dm) print("\nmodel.toDict Hack\n") m = model.toDict() scrub_meta(m) pprint.pprint(m)