mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-16 02:38:02 +00:00
add sorting by implementation percentage to PerSetTracking.py
-skipped Un* sets (they only were counting the 5 basic lands anyway) -added commented out options to skip other worthless sets (including MBS, which should be removed once we start adding cards/when mtg-data.txt has info for it.)
This commit is contained in:
@@ -68,6 +68,11 @@ currentImplemented = []
|
|||||||
total = 0
|
total = 0
|
||||||
percentage = 0
|
percentage = 0
|
||||||
for currentSet in setCodes :
|
for currentSet in setCodes :
|
||||||
|
if currentSet == 'UNH' or currentSet == 'UGL' : continue #skip Unhinged and Unglued since they are only counting basic lands anyway
|
||||||
|
#if currentSet == 'VG1' or currentSet == 'VG2' or currentSet == 'VG3' : continue
|
||||||
|
#if currentSet == 'VG4' or currentSet == 'VGO' or currentSet == 'VG ' : continue
|
||||||
|
#if currentSet == 'SDC' or currentSet == 'AST' or currentSet == 'DKM' : continue
|
||||||
|
#if currentSet == 'ATH' or currentSet == 'MBS' : continue
|
||||||
for card in mtgDataCards.keys() :
|
for card in mtgDataCards.keys() :
|
||||||
if mtgDataCards[card].count(currentSet) > 0 :
|
if mtgDataCards[card].count(currentSet) > 0 :
|
||||||
if card in forgeCards :
|
if card in forgeCards :
|
||||||
@@ -75,7 +80,7 @@ for currentSet in setCodes :
|
|||||||
else :
|
else :
|
||||||
currentMissing.append(card)
|
currentMissing.append(card)
|
||||||
total = len(currentMissing)+len(currentImplemented)
|
total = len(currentMissing)+len(currentImplemented)
|
||||||
percentage = 100
|
percentage = 0
|
||||||
if total > 0 :
|
if total > 0 :
|
||||||
percentage = (float(len(currentImplemented))/float(total))*100
|
percentage = (float(len(currentImplemented))/float(total))*100
|
||||||
|
|
||||||
@@ -98,7 +103,7 @@ for currentSet in setCodes :
|
|||||||
del currentImplemented[:]
|
del currentImplemented[:]
|
||||||
|
|
||||||
#UNTESTED sort sets by percentage completed
|
#UNTESTED sort sets by percentage completed
|
||||||
#totalData = sorted(totalData,key=lambda entry: entry[3],reverse=True)
|
totalDataList = sorted(totalData.items(), key=lambda (key,entry): entry[3], reverse=True)
|
||||||
#UNTESTED
|
#UNTESTED
|
||||||
|
|
||||||
totalPercentage = 0
|
totalPercentage = 0
|
||||||
@@ -107,11 +112,11 @@ totalImplemented = 0
|
|||||||
fullTotal = 0
|
fullTotal = 0
|
||||||
with open(sys.path[0] + os.sep + "PerSetTracking Results" + os.sep + "CompleteStats.txt", "w") as statsfile:
|
with open(sys.path[0] + os.sep + "PerSetTracking Results" + os.sep + "CompleteStats.txt", "w") as statsfile:
|
||||||
statsfile.write("Set: Implemented (Missing) / Total = Percentage Implemented\n")
|
statsfile.write("Set: Implemented (Missing) / Total = Percentage Implemented\n")
|
||||||
for dataKey in sorted(totalData.keys()) :
|
for k,dataKey in totalDataList :
|
||||||
totalImplemented += totalData[dataKey][0]
|
totalImplemented += dataKey[0]
|
||||||
totalMissing += totalData[dataKey][1]
|
totalMissing += dataKey[1]
|
||||||
fullTotal += totalData[dataKey][2]
|
fullTotal += dataKey[2]
|
||||||
statsfile.write(dataKey + ": " + str(totalData[dataKey][0]) + " (" + str(totalData[dataKey][1]) + ") / " + str(totalData[dataKey][2]) + " = " + str(round(totalData[dataKey][3], 2)) + "%\n")
|
statsfile.write(k + ": " + str(dataKey[0]) + " (" + str(dataKey[1]) + ") / " + str(dataKey[2]) + " = " + str(round(dataKey[3], 2)) + "%\n")
|
||||||
totalPercentage = totalImplemented / fullTotal
|
totalPercentage = totalImplemented / fullTotal
|
||||||
statsfile.write("\n")
|
statsfile.write("\n")
|
||||||
statsfile.write("Total over all sets: " + str(totalImplemented) + " (" + str(totalMissing) + ") / " + str(fullTotal))
|
statsfile.write("Total over all sets: " + str(totalImplemented) + " (" + str(totalMissing) + ") / " + str(fullTotal))
|
||||||
|
|||||||
Reference in New Issue
Block a user