def resultMerger(itemType, region, mode="hybrid"):
    tempList = getParameterListFromJson(itemType, region)
    modeList = ["roll", "expand"]
    paramList = [(a, *b) for a, b in itertools.product(modeList, tempList)]
    for param in paramList:
        resultmerge(param)
    return 0
def matlabUpdateMain(itemType , region,mode="hybrid"):
    tempList = getParameterListFromJson(itemType,region)
    #modeList = ["expand","roll"]
    modeList = ["roll", "expand"]
    paramList = [(a,*b) for a,b in itertools.product(modeList,tempList)]
    for param in paramList:
        matlabUpdate(param)
    return 0
def merger(itemType , region,mode="hybrid"):
    tempList = getParameterListFromJson(itemType,region,mode = "plot")
    modeList = ["roll"]
    paramList = [(a,*b) for a,b in itertools.product(modeList,tempList)]

    cpuCount = multiprocessing.cpu_count()
    #print(cpuCount)
    pool = multiprocessing.Pool(processes=cpuCount)
    pool.map(relabelAndPlot,paramList)
    #for param in paramList:
    #    relabelAndPlot(param)
    return 0
Beispiel #4
0
def zstatPlot(itemType, region):
    start = time.time()
    tempList = getParameterListFromJson(itemType, region)
    modeList = ["expand", "roll"]
    paramList = [(*a, b) for a, b in itertools.product(tempList, modeList)]

    cpuCount = multiprocessing.cpu_count()
    pool = multiprocessing.Pool(processes=cpuCount - 1)
    pool.map(errorPlot, paramList)

    end = time.time()
    elapsed = end - start
    print("time used: " + str(elapsed))
Beispiel #5
0
def updateRaw(itemType, region):
    #sdList = [1.5,1.75,2,2.5]
    #dayList = [30,50,60,90,120]
    indexList = getItemNameFromJson(itemType, region)
    if "bond" not in itemType:
        extractRaw(indexList, itemType + region)
        print("extractRaw done")
    paramList = getParameterListFromJson(itemType, region)
    #paramList = (("0175.HK",2,30,"stockHK"),("0175.HK",2,60,"stockHK"),("0175.HK",2,90,"stockHK"),("0175.HK",2,120,"stockHK"))
    #print(paramList)
    for param in paramList:
        processRaw(param, itemType + region)

    print("processRaw done")
    return 0
Beispiel #6
0
def callPlotly(itemType, region):

    start = time.time()
    tempList = getParameterListFromJson(itemType, region)
    modeList = ["expand", "roll"]
    plotType = ["normal", "z"]
    paramList = [(*a, b, c)
                 for a, b, c in itertools.product(tempList, modeList, plotType)
                 ]

    #for param in paramList:
    #    indexPlotMode(param)
    cpuCount = multiprocessing.cpu_count()
    pool = multiprocessing.Pool(processes=cpuCount - 1)
    pool.map(indexPlotMode, paramList)

    end = time.time()
    elapsed = end - start
    print("time used: " + str(elapsed))
    return 0
Beispiel #7
0
def matlabBatch(itemType, region, mode="hybrid"):
    start = time.time()
    #sdList = [1.5,1.75,2,2.5]
    #dayList = [30,50,60,90,120]
    #indexList = getItemNameFromJson(itemType,region)
    tempList = getParameterListFromJson(itemType, region)
    modeList = ["roll", "expand"]
    paramList = [(a, *b) for a, b in itertools.product(modeList, tempList)]
    #withTypeList = [(n,s,d,itemType + region) for n, s, d in paramList]
    #paramList = (("2319.HK",2,30,"stockHK"),("2319.HK",2,60,"stockHK"))
    cpuCount = multiprocessing.cpu_count()
    #print(cpuCount)
    pool = multiprocessing.Pool(processes=cpuCount)
    pool.map(matlabRun, paramList)
    #for params in paramList:
    #    matlabRun(params)
    end = time.time()
    elapsed = end - start
    print("time used: " + str(elapsed))
    return 0