dpinney / omf

The Open Modeling Framework for smart grid cost-benefit analysis.
https://omf.coop
GNU General Public License v2.0
112 stars 60 forks source link

Remove duplicated information from saved models. #254

Closed dpinney closed 10 years ago

dpinney commented 10 years ago

Data in our store must be unique. We can't have one piece of data in two places. Issues of duplication we need to fix:

  1. Models have the user (creator) and the model name in both allInputData.json and in the path where the model is stored. It needs to be just in the path. Fixing this will probably require edits to some bits of web.py and the metaModel.
dpinney commented 10 years ago

Rewrites needed:

  1. renderTemplate:
inJson = json.load(open(pJoin(modelDir,"allInputData.json")))
modelPath, modelName = pSplit(modelDir)
deepPath, user = pSplit(modelPath)
inJson["modelName"] = modelName
inJson["user"] = user
allInputData = json.dumps(inJson)
  1. special renderTemplate in other models.
  2. web.py /newModel/ /runModel/, etc.
dpinney commented 10 years ago

Fixed in d9f5c241b438ca67bba1e00022422a686a177440 and 6dc2aa1554c6d699679d318714fbf64feaa45d4a