Beispiel #1
0
def main():

    hisLogCount = int(ELOCal.getHisLogCount()[0][0])
    today_date = date.today().strftime("%-m/%-d/%Y")

    if ELOCal.getLastLogDate(hisLogCount)[0][0] in today_date:
        ELOCal.log("HEU: Historic ELOs updated today. Exiting Historic ELO Update Call")
        return

    ELOs, historicELOs = ELOCal.getELOs(), ELOCal.getHistoricELOs(hisLogCount)

    historicLogEntry = [
        today_date
    ]

    for ELO in ELOs[1::]:
        historicLogEntry.append(ELO[1])

    historicELOs[len(historicELOs)-1] = historicLogEntry
    historicELOs.append(["=TODAY()", "=TRANSPOSE($C$3:$C$19)"])

    ELOCal.debugPrint("HEU: New Historic ELO List", historicELOs)

    ELOCal.updateCells(
        values=historicELOs,
        sheetRange=ELOCal.HIS_ELO_Range.format(str(ELOCal.HIS_LOG_OFFSET + len(historicELOs))),
        dataType="USER_ENTERED"
    )

    ELOCal.log("HEU: Historic ELOs Logged")
Beispiel #2
0
def main(logCount=None):
    if not logCount:
        logCount = ELOCal.getLogCount()[0][0]

    processedLog = ELOCal.getLog(processed=True, newLogCount=logCount)

    for result in processedLog:
        winner, loser = result[0], result[1]

        ELOCal.calcWLStreak(winner, loser)

    streaks = ELOCal.buildStreakListForSheet()

    ELOCal.updateCells(
        values=streaks,
        sheetRange=ELOCal.streak_Range
    )
Beispiel #3
0
def main():
    accumulativeDiff = False
    currentLog, winsLosses, ELOs = ELOCal.getLog(), ELOCal.getWL(
    ), ELOCal.getELOs()

    unLoggedIndexes = ELOCal.cleanEmptyIndexes(currentLog)

    if accumulativeDiff:
        for pIndex in ELOs:
            pIndex[2] = 0

    for index in unLoggedIndexes:
        ELOs = ELOCal.correctExpectedInt(
            ELOCal.calcHTHELO(ELOs,
                              index[0],
                              index[1],
                              accumulativeDiff=accumulativeDiff))

        winsLosses = ELOCal.updateWinLossTable(winsLosses, index[0], index[1])

    ELOCal.debugPrint("MU: Updated ELOs", ELOs)

    logCount = int(ELOCal.getLogCount()[0][0]) + ELOCal.P_LOG_Range_Offset + 1

    if currentLog[0][0] != '':
        blankLog = [['', '']] * 100

        writeToRange = ELOCal.UP_LOG_Range.format(
            str(logCount), str(len(unLoggedIndexes) + logCount))

        # BLANK LOG OVER UNPROCESSED GAMES
        ELOCal.updateCells(values=blankLog,
                           sheetRange=ELOCal.LOG_Range,
                           dataType="USER_ENTERED")

        # WRITE NEW PROCESSED GAMES
        ELOCal.updateCells(values=unLoggedIndexes,
                           sheetRange=writeToRange,
                           dataType="USER_ENTERED")

        # UPDATE WINS AND LOSSES IN PRIMARY SHEET
        ELOCal.updateCells(values=winsLosses, sheetRange=ELOCal.WL_Range)

        # UPDATE ELOs
        ELOCal.updateCells(values=ELOs, sheetRange=ELOCal.ELO_Range)

    updateVSResults.main()
    winStreakUpdate.main()
    historicELOUpdate.main()

    ELOCal.log("Complete")
Beispiel #4
0
def main(logCount=None):
    if not logCount:
        logCount = ELOCal.getLogCount()[0][0]

    ELOCal.debugPrint("UVR: Found Log Count", logCount)

    processedLog = ELOCal.getLog(processed=True, newLogCount=logCount)

    ELOCal.debugPrint("UVR: Processed Log", processedLog)

    for result in processedLog:
        vsDict[result[0]]["wins"][vsDict[result[1]]["index"]] = vsDict[
            result[0]]["wins"][vsDict[result[1]]["index"]] + 1

    vsResults = []

    for name in ELOCal.nameList:
        vsResults.append(vsDict[name]["wins"])

    ELOCal.debugPrint("UVR: vs List Results", vsResults)

    ELOCal.updateCells(values=vsResults, sheetRange=ELOCal.vs_Result_Range)
Beispiel #5
0
def main():
    ELOs, winsLosses = ELOCal.getELOs(), ELOCal.getWL()

    batchUpdatedELOS = ELOCal.calcBatchELOs(ELOs, winsLosses)

    ELOCal.updateCells(values=batchUpdatedELOS, sheetRange=ELOCal.ELO_Range)