Example #1
0
def executeJobForConfig(config_file,config_key,procparams,sourceDb, targetDb, targetTable):
	procConfig = loadConfigForKey(config_key,config_file, sourceDb, targetDb, targetTable)
	
	updateEmailContent(SOURCE, '{} - {}'.format(procConfig['sourceDb'], procConfig['procName']))
	updateEmailContent(TARGET, '{} - {}'.format(procConfig['targetDb'], procConfig['targetTable']))
	logging.info('Config to execute: {} with SourceDbConnString: "{}", TargetDbConnString: "{}"'.format(
		procConfig['key'], procConfig['sourceDbConnectionString'], procConfig['targetDbConnectionString']))
	
	paramsForInsertStmt = getParamsToBeUsedInInsert(procConfig['columnMappings'],procparams)
	logging.info('paramsForInsertStmt:: {}'.format(paramsForInsertStmt))
	logging.info('config_file:: {} config_key:: {} procparams:: {}'.format(config_file,config_key,procparams))
	fileNames = downloadDataToFile(procConfig, procparams)
	currentTimeStamp = time.strftime(timeFormat)
	for fileName in fileNames:
		loader.sys.argv = ['-configkey', config_key,'-configFile',config_file,'-f', fileName, '-t', currentTimeStamp, '-p', paramsForInsertStmt]
		loader.main(targetDb, targetTable)
Example #2
0
                 "quinella", "quinellaOdds",
                 "wide_1", "wideOdds_1",
                 "wide_2", "wideOdds_2",
                 "wide_3", "wideOdds_3",
                 "trifecta", "trifectaOdds",
                 "trio", "trioOdds"]

    # データのうち、教師データとして使う割合(残りをテストデータとして用いる)
    train_data_ratio = 1

    # --------------------------------

    # main

    # 過去のレース結果をdfとして取得
    the_merged_df = loader.main()
    # dfをソート
    the_merged_df = the_merged_df.sort_values(["date", "venue", "raceNumber"])
    # print(the_merged_df["exhibitionTime_1"])

    # 学習に使う特徴量、ラベルを用意
    fv_label_df, fv_label_odds_df = make_df_for_analyze(the_merged_df, fv_list, column_list_label, odds_list)
    pd.set_option("display.max_columns", 500)

    # labelのカラムをcsvとして書き出しておく(voterに使う)
    with open(os.path.join(current_dir, 'colum_list.csv'), "w", encoding="Shift_jis") as f:
        writer = csv.writer(f, lineterminator="\n")  # writerオブジェクトの作成 改行記号で行を区切る
        print(fv_label_df.columns)
        writer.writerow(fv_label_df.columns)

    # 学習データおよびテストデータを用意
Example #3
0
from loader import main
main()
#!/usr/bin/env python
import time
import loader
from datetime import datetime
i=0
confFile,interval=loader.parseArgs()
while True:
	while datetime.now().second==0:
		i+= 1
		print i
		t =time.time()
		loader.main(confFile)
		time.sleep(interval-0.5-(time.time()-t))
	time.sleep(0.5)
Example #5
0
 def setUp(self):
     from loader import main
     app = main({})
     from webtest import TestApp
     self.testapp = TestApp(app)
Example #6
0
import sys

import numpy as np

import loader

# TODO there is a problem if a wire (not an edge) is not connected to anything

if __name__ == '__main__':
    np.set_printoptions(suppress=True)
    np.set_printoptions(precision=3)
    np.set_printoptions(threshold=sys.maxsize)
    np.set_printoptions(linewidth=sys.maxsize)

    inputList, outputList = loader.interpret_i_o(sys.argv)

    loader.check_for_doubles(inputList, outputList)

    assumed_order_e, inputList, outputList, matrix = loader.main(
        sys.argv[1], inputList, outputList)

    if assumed_order_e:
        print(
            'Caution, not all wires given explicitly as input or output, assuming following order:'
        )
        print('Inputs: ' + str(inputList))
        print('Outputs: ' + str(outputList))
    print('_______________')
    matrix.normalize()
    print(matrix)
Example #7
0
#!/usr/bin/env python
'''
Created on Mar 11, 2016

@author: laurent
'''
import sys
if sys.argv[0].endswith("__main__.py"):
    sys.argv[0] = "python -m runtest"

# Override the loader, so we can detect fixtures
import loader
loader.main(testLoader=loader.TestLoader())