コード例 #1
0
ファイル: RunInterface.py プロジェクト: liangjj/scSuperSolver
    def makeRun(self, baseConfig, runData):
        """Make a new run of config files from the base config and runData.

        runData is a list of tuples which contain a label and a dict.
        Labels are used to name generated configs and their specified output 
        files.  The dicts are key-value pairs for data to modify in the
        base config.  Return a list of the names of config files generated.

        """
        configNames = []
        baseConfigFullPath = os.path.join(self.path, baseConfig)
        for label, labelData in runData:
            newConfig = FileDict(baseConfigFullPath)
            newConfigFullPath = os.path.join(self.path, label + "_config")
            labelData.update({"outputLogName" : label + "_out.fd",
                              "errorLogName" : label + "_error",
                              "debugLogName" : label + "_debug"})
            for key, value in labelData.items():
                newConfig.setGlobal(str(key), str(value))
            configNames.append(newConfigFullPath)
            newConfig.writeToFile(newConfigFullPath)
        return configNames
コード例 #2
0
    def makeRun(self, baseConfig, runData):
        """Make a new run of config files from the base config and runData.

        runData is a list of tuples which contain a label and a dict.
        Labels are used to name generated configs and their specified output 
        files.  The dicts are key-value pairs for data to modify in the
        base config.  Return a list of the names of config files generated.

        """
        configNames = []
        baseConfigFullPath = os.path.join(self.path, baseConfig)
        for label, labelData in runData:
            newConfig = FileDict(baseConfigFullPath)
            newConfigFullPath = os.path.join(self.path, label + "_config")
            labelData.update({
                "outputLogName": label + "_out.fd",
                "errorLogName": label + "_error",
                "debugLogName": label + "_debug"
            })
            for key, value in labelData.items():
                newConfig.setGlobal(str(key), str(value))
            configNames.append(newConfigFullPath)
            newConfig.writeToFile(newConfigFullPath)
        return configNames