Commit fa22ad71 authored by Georgios Dagkakis's avatar Georgios Dagkakis

script to update models to new instance added

parent f70f2c8b
'''
Created on 3 Feb 2015
@author: GDang
'''
import json
newInstance=open('NewInstance.json', "r")
modelOldInstance=open('ModelOldInstance.json', "r")
newInstanceData=newInstance.read()
modelOldInstanceData=modelOldInstance.read()
newInstanceJSON=json.loads(newInstanceData)
modelOldInstanceJSON=json.loads(modelOldInstanceData)
modelGraph=modelOldInstanceJSON['graph']
modelInput=modelOldInstanceJSON['input']
modelGeneral=modelOldInstanceJSON['general']
updatedModelJSON=newInstanceJSON
updatedModelJSON['graph']=modelGraph
updatedModelJSON['input']=modelInput
updatedModelJSON['general']=modelGeneral
updatedModelJSON['result']={"result_list": []}
updatedModelJSONString=json.dumps(updatedModelJSON, indent=5)
updatedModel=open('UpdatedModel.json', mode='w')
updatedModel.write(updatedModelJSONString)
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment