Exemplo n.º 1
0
from information_boards import productivity_summary_fpath
from information_boards import shiftProDur_dpath, shiftProDur_prefix
from information_boards import AM2, AM5
from information_boards import SEC3600, SEC60
from information_boards import ALL_DUR, ALL_FARE, ALL_NUM
from information_boards import AP_DUR, AP_FARE, AP_QUEUE, AP_NUM
from information_boards import NS_DUR, NS_FARE, NS_QUEUE, NS_NUM
#
from taxi_common.file_handling_functions import check_dir_create, check_path_exist, get_all_files
from taxi_common.multiprocess import init_multiprocessor, put_task, end_multiprocessor
from taxi_common.log_handling_functions import get_logger
#
import csv, gzip
import time, datetime

logger = get_logger()


def run():
    for dpath in [productivity_dpath, shiftProDur_dpath]:
        check_dir_create(dpath)
    #
    # init_multiprocessor(11)
    # count_num_jobs = 0
    # for y in xrange(9, 11):
    #     for m in xrange(1, 13):
    #         yymm = '%02d%02d' % (y, m)
    #         if yymm in ['0912', '1010']:
    #             continue
    #         # process_file(yymm)
    #         # put_task(productive_duration, [yymm])
Exemplo n.º 2
0
'''
#
from community_analysis import tfZ_TP_dpath, tfZ_TP_prefix
from community_analysis import dpaths, prefixs
from community_analysis import SIGINIFICANCE_LEVEL, MIN_PICKUP_RATIO
#
from taxi_common.file_handling_functions import check_dir_create, get_all_files, get_fn_only, check_path_exist, save_pickle_file
from taxi_common.log_handling_functions import get_logger
from taxi_common.multiprocess import init_multiprocessor, put_task, end_multiprocessor
#
import pandas as pd
import numpy as np
import statsmodels.api as sm
from traceback import format_exc

logger = get_logger()


def run():
    ir = 'influenceGraph'
    # for tm in ['spendingTime', 'roamingTime']:
    for tm in ['spendingTime']:
        for year in ['2009', '2010', '2011', '2012']:
            check_dir_create(dpaths[tm, year, ir])

    yyyy = '20%02d' % 9
    for tfZ_TP_fn in get_all_files(tfZ_TP_dpath,
                                   '%s%s*.csv' % (tfZ_TP_prefix, yyyy)):
        tfZ_TP_fpath = '%s/%s' % (tfZ_TP_dpath, tfZ_TP_fn)
        process_file(tfZ_TP_fpath)