Esempio n. 1
0
                   configspec=input_spec,
                   stringify=True)
val = Validator()
results = config.validate(val)
if results == True:
    print 'Inputs validation succeeded.'
else:
    errors = flatten_errors(config, results)
    for section_list, key, _ in errors:
        if key is not None:
            msg = 'The "%s" key in the section "%s" failed validation'
            print msg % (key, ', '.join(section_list))
        else:
            print 'The following section was missing %s '.join(section_list)
    raise ValueError("Invalid input data")
print "Simulation inputs :"
pp = pprint.PrettyPrinter(indent=4)
in_data = {}
in_data.update(config)
pp.pprint(in_data)

panel = Panel(**config["Panels"])
tank = Tank(**config["Tank"])
print tank
house = House(**config["House"])
scenario = Scenario(house, panel, tank)
scenario.loop(**config["Scenario"])

scenario.post(sim_dir)
house.post(sim_dir)