def main(argv): # buffer hack sys.stdout = Unbuffered(sys.stdout) path = 'local/config.yml' if len(argv) >= 1: path = argv[0] try: cc.loadConfig(path) except IOError as ioe: print("{0}".format(ioe)) for experiment in cc.cfg['experiments']: # load configuration into global var and run it cc.loadExperiment(experiment) if cc.cfg['model'] == 'rnn': if cc.cfg['grid']: # REMOVEME: hardcoded grid for ratio grid = [ [1, 1, 1], # [1,1,2], # [1,2,1], # [2,1,1], # [1,2,2], # [2,1,2], [2, 2, 1] ] cc.exp['grid'] = {} import rnn.rnn reload(rnn.rnn) comment = '[GRID][RATIO={}][A549][TDGRUGRU] performing grid search for ratio' for ratios in grid: cc.exp['params']['rnn']['comment'] = comment.format( ':'.join([str(x) for x in ratios])) cc.exp['grid']['ratios'] = ratios print(cc.cfg, cc.exp) rnn.rnn.run() else: import rnn.rnn reload(rnn.rnn) print(cc.cfg, cc.exp) rnn.rnn.run() elif cc.cfg['model'] == 'dnn': import rnn.dnn reload(rnn.dnn) print(cc.cfg, cc.exp) rnn.dnn.run() else: raise Exception('Run: unknown model')
def initConfigs(self): self.configs = {} self.configs["wf"] = loadConfig("wf") self.configs["sc"] = dict([(k, dict([(int(kk), vv) for kk, vv in v.items()])) for k, v in loadConfig("sc").items()])
def main(argv): # buffer hack sys.stdout = Unbuffered(sys.stdout) path = 'local/config.yml' if len(argv) >= 1: path = argv[0] try: cc.loadConfig(path) except IOError as ioe: print("{0}".format(ioe)) for experiment in cc.cfg['experiments']: # load configuration into global var and run it cc.loadExperiment(experiment) if cc.cfg['model'] == 'rnn': if cc.cfg['grid']: # REMOVEME: hardcoded grid for ratio grid = [ [1,1,1], # [1,1,2], # [1,2,1], # [2,1,1], # [1,2,2], # [2,1,2], [2,2,1] ] cc.exp['grid'] = {} import rnn.rnn reload(rnn.rnn) comment = '[GRID][RATIO={}][A549][TDGRUGRU] performing grid search for ratio' for ratios in grid: cc.exp['params']['rnn']['comment'] = comment.format(':'.join([str(x) for x in ratios])) cc.exp['grid']['ratios'] = ratios print(cc.cfg,cc.exp) rnn.rnn.run() else: import rnn.rnn reload(rnn.rnn) print(cc.cfg,cc.exp) rnn.rnn.run() elif cc.cfg['model'] == 'dnn': import rnn.dnn reload(rnn.dnn) print(cc.cfg,cc.exp) rnn.dnn.run() else: raise Exception('Run: unknown model')
def main(): """ =========================================================================== logmappper-agent **Main** function =========================================================================== Aqui un ejemplo de documentacion Formatos: *cursiva* ``code = True`` **Args**: * config: configuration object **Returns**: None """ args = processArguments() config = cfg.loadConfig(args.configfilename, args.resetconfig) logMapperAgentConfig = cfg.loadLogMapperAgentConfig(config) logging_util.configureLogger(logMapperAgentConfig.logFilePath) logger.info("Start LogMapper Agent") cfg.printConfig(config) control.initApplication(config) control.startApplicationTask(config) control.mainLoop(config) control.stopApplicationTask(config) logger.info("Finish LogMapper Agent")
def cacheBuiltin(): global builtin builtin = {} commandList = config.loadConfig("src/lib/builtin_commands.json")['commands'] for c in commandList: builtin[c['command']] = createCommand(c) return builtin
def main(argv): fileConfig = "config.json" try: opts, args = getopt.getopt(argv, "vhc:", ["version", "help", "config="]) if opts != None and args != None: for opt, arg in opts: if opt in ("-v", "--version"): print info.botabout() sys.exit() elif opt in ("-h", "--help"): print help_message sys.exit() elif opt in ("-c", "--config"): fileConfig = arg except getopt.GetoptError: print help_message sys.exit(2) print " Starting up {0}".format(info.botaboutshort()) print "===========================" print "Using '{0}' as the configuration file...\n".format(fileConfig) config = loadConfig(fileConfig) commandcore.cacheBuiltin() general = generalConfig(config) server = serverConfig(config) channels = channelcore.loadChannels(config) bots = {} for c in channels.values(): bots[c.name] = ChatBot(general, server, c) thread.start_new_thread(bots[c.name].run, ()) while True: time.sleep(1)
""" readers = cfg.getReaders(config) for readerName in readers: readerConfig = cfg.loadReaderConfig(config, readerName) if readerConfig.enable: mapperThread = mapper.MapperThread(readerConfig, th.OperationMode.NORMAL) mapperThread.start() def startRegister(config): agentConfig = cfg.loadLogMapperAgentConfig(config) j = get.getAgent(config) r = ds.saveData(agentConfig.masterHost, agentConfig.masterPort, lmkey.DATATYPE_AGENT, j) return str(r) #%% if __name__ == '__main__': print('Start module execution:') logging.basicConfig(level=logging.DEBUG, format='%(asctime)s - %(levelname)s - %(message)s', datefmt='%H:%M:%S') cfg.createDefaultConfigfile() config=cfg.loadConfig() commandDefinition = StartCommand("start", "sta", "Help") commandDefinition.parseArgs("start register") response = commandDefinition.execute(config) print(str(response)) print("End module execution")
import db import math import numpy as np import pandas as pd import matplotlib.pyplot as plt from rdkit import Chem from rdkit.Chem import Descriptors from sklearn.feature_selection import VarianceThreshold import pylab from config import config as cc cc.loadConfig('../local/config.yml') # data = db.getTarget_206_1977() # data = db.getTarget_206_1977_features_wide() # data = db.getTarget_geminin() # data = db.getTarget_a549() data = db.getTarget_206_1977_features_computed() ''' duplicates = {} for datum in data: if datum[0] in duplicates: duplicates[datum[0]].append(datum[1]) else: duplicates[datum[0]] = [datum[1]]
#! /usr/bin/env python import sys sys.path.insert(0, '../') from config import config as cc cc.loadConfig('../local/config.yml') import db.db as db import pandas as pd import numpy as np from rdkit import Chem from rdkit.Chem import Descriptors from rdkit.Chem import MACCSkeys from sets import Set LELIMIT = 10000 SICHO_RIPTORS = Set(['MinAbsPartialCharge','HeavyAtomMolWt','MaxAbsPartialCharge','MinAbsEStateIndex','Chi3n','HallKierAlpha','PEOE_VSA1','PEOE_VSA10','PEOE_VSA11','PEOE_VSA12','PEOE_VSA13','PEOE_VSA14','PEOE_VSA2','PEOE_VSA3','PEOE_VSA6','PEOE_VSA8','PEOE_VSA9','SMR_VSA1','SMR_VSA10','SMR_VSA3','SMR_VSA6','SMR_VSA9','SlogP_VSA10','SlogP_VSA3','SlogP_VSA4','SlogP_VSA6','TPSA','EState_VSA3','EState_VSA5','EState_VSA7','EState_VSA8','VSA_EState9','NHOHCount','NumAliphaticHeterocycles','NumAromaticHeterocycles','MolLogP','fr_Ar_COO','fr_C_O','fr_Imine','fr_NH1','fr_Ndealkylation2','fr_amide','fr_aryl_methyl','fr_ester','fr_ether','fr_furan','fr_imidazole','fr_methoxy','fr_piperzine','fr_pyridine','fr_sulfide','fr_thiazole','fr_urea']) DOWNLOAD_TABLE = 'output.stitch_120ls_400lf_907d' DOWNLOAD_COLS = ['smiles'] DOWNLOAD_QUERY = 'SELECT distinct {} FROM {} LIMIT {} OFFSET {}' SEND_TABLE = 'output.stitch_smiles_maccs' # DOWNLOAD_TABLE = 'output.target_geminin_deduplicated' # DOWNLOAD_COLS = ['molregno','canonical_smiles','is_testing','standard_value_min','standard_value_max','standard_value_count','standard_value_std','standard_value_relative_std','standard_value_median'] # SEND_TABLE = 'output.target_geminin_deduplicated_rdkit_maccs'