Ejemplo n.º 1
0
def load():
    global manage, f
    # 锁定
    lock.acquire()
    manage = TermTestManage()

    now = datetime.datetime.now()
    day = now.strftime(DATE_FORMAT)
    f = Flow(day, DB_NAME)

    # 加载基础维度
    fo = open(DIM_FILE, 'r')
    lines = fo.readlines()
    manage.load_dim(lines)
    fo.close()

    # 加载修正组合
    fo = open(TERM_FILE, 'r')
    lines = fo.readlines()
    manage.load(lines)
    fo.close()

    #释放
    lock.release()
Ejemplo n.º 2
0
import chronic

from core.term_test import TermTestManage
from core.flow import Flow


__author__ = 'GaoJie'
TERM_FILE = 'data/term_list.txt'
DIM_FILE = 'data/dim_list.txt'


if __name__ == '__main__':
    test_time = '2014-06-10'
    test_table = 'RTBApp'
    with chronic.Timer('create'):
        manage = TermTestManage()

        # 加载基础维度
        fo = open(DIM_FILE, 'r')
        lines = fo.readlines()
        manage.load_dim(lines)
        fo.close()
        del lines

        # 加载修正组合
        fo = open(TERM_FILE, 'r')
        lines = fo.readlines()
        manage.load(lines)
        fo.close()
        del lines
Ejemplo n.º 3
0
from core.dbget import *
from core.term_test import TermTestManage
from core.term_combiner import *


__author__ = 'GaoJie'
TERM_FILE = 'data/term_list.txt'
DIM_FILE = 'data/dim_list.txt'
DB_NAME = 'RTBApp'

if __name__ == '__main__':
    test_time = '2014-06-10'
    table_name = 'RTBApp'
    # 实际中
    total = get_sum(test_time, {}, DB_NAME, is_train=False)
    manage = TermTestManage(total)

    # 加载基础维度
    fo = open(DIM_FILE, 'r')
    lines = fo.readlines()
    manage.load_dim(lines)
    fo.close()

    # 加载修正组合
    fo = open(TERM_FILE, 'r')
    lines = fo.readlines()
    manage.load(lines)
    fo.close()

    result = []
    result_term = []