Index: wflow-py/wflow/wf_DynamicFramework.py =================================================================== diff -u -rd9229c85c54e7f00de742552f494f831661c5af6 -red16c201180e894dfc6a55b953d2a14870f2d847 --- wflow-py/wflow/wf_DynamicFramework.py (.../wf_DynamicFramework.py) (revision d9229c85c54e7f00de742552f494f831661c5af6) +++ wflow-py/wflow/wf_DynamicFramework.py (.../wf_DynamicFramework.py) (revision ed16c201180e894dfc6a55b953d2a14870f2d847) @@ -529,7 +529,7 @@ return rest - def createRunId(self,intbl="intbl",logfname="wflow.log",NoOverWrite=True,model="model",modelVersion="no version",level=pcrut.logging.DEBUG): + def createRunId(self,intbl="intbl",logfname="wflow.log",NoOverWrite=True,model="model",modelVersion="no version",level=pcrut.logging.DEBUG,doSetupFramework=True): """ Create runId dir and copy table files to it Also changes the working dir to the case/runid directory @@ -569,6 +569,23 @@ self._userModel().config = self.iniFileSetUp(caseName,runId,configfile) + if doSetupFramework: + self.setupFramework() + + + + + + def setupFramework(self): + """ + Second step, after setting the log file and reading the ini file get data from config, setup + IO etc + + :return: + """ + caseName = self._userModel().caseName + runId = self._userModel().runId + self.outputFormat = int(configget(self._userModel().config,'framework','outputformat','1')) self.APIDebug = int(configget(self._userModel().config,'framework','debug',str(self.APIDebug))) @@ -691,7 +708,7 @@ checktss = configsection(self._userModel().config,"outputtss") if len(checktss) > 0: self.logger.warn("Found a outputtss section. This is NOT used anymore in this version. Please use outputtss_0 .. n") - + self.oscv = {} self.samplenamecsv = {} self.varnamecsv = {} @@ -704,24 +721,24 @@ toprint = configsection(self._userModel().config,thissection) secnr = secnr + 1 samplemapname = caseName + "/" + configget(self._userModel().config,thissection,"samplemap","None") - if "None" not in samplemapname : + if "None" not in samplemapname : try: self.samplemap = readmap(samplemapname) idd = tsformat + ":" +samplemapname self.oscv[idd] =wf_OutputTimeSeriesArea(self.samplemap,oformat=tsformat) self.logger.info("Adding " + tsformat + " output at "+ samplemapname) except: self.logger.warn("Could not read sample id-map for timeseries: " + samplemapname) - + for a in toprint: if "samplemap" not in a: - b = a.replace('self','self._userModel()') + b = a.replace('self','self._userModel()') fn = os.path.join(caseName,runId,self._userModel().config.get(thissection,a)) self.samplenamecsv[fn] = idd self.varnamecsv[fn] = b - - + + def wf_suspend(self, directory): """ Suspend the state variables to disk as .map files