Skip to content

Commit

Permalink
Update mtgo_tracker.py
Browse files Browse the repository at this point in the history
  • Loading branch information
cderickson committed Jun 7, 2023
1 parent 2bf0703 commit 033d3f9
Showing 1 changed file with 21 additions and 21 deletions.
42 changes: 21 additions & 21 deletions mtgo_tracker.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
display_index = 0
ln_per_page = 20
curr_data = pd.DataFrame()
debug_str = 'Version 13\n\n'
debug_str = 'Version 14\n\n'

def save(exit):
global ask_to_save
Expand Down Expand Up @@ -682,7 +682,7 @@ def get_all_data(fp_logs,fp_drafts,copy):
parsed_data = modo.get_all_data(initial,mtime)
debug_str += f'Parsed GameLog: {i}\n'
except Exception as error:
debug_str += f'Error while parsing GameLog: {i}: {error.message}\n'
debug_str += f'Error while parsing GameLog: {i}: {str(error)}\n'
error_count += 1
continue
if parsed_data[0][0] in SKIP_FILES:
Expand Down Expand Up @@ -3722,9 +3722,9 @@ def tree_setup(*argv):
opp_mull_rate = 0.0
turn_rate = 0.0
else:
hero_mull_rate =round((i.P1_Mulls.sum()/total_n),2)
opp_mull_rate = round((i.P2_Mulls.sum()/total_n),2)
turn_rate = round((i.Turns.sum()/total_n),2)
hero_mull_rate =round((pd.to_numeric(i.P1_Mulls, errors='coerce').sum()/total_n),2)
opp_mull_rate = round((pd.to_numeric(i.P2_Mulls, errors='coerce').sum()/total_n),2)
turn_rate = round((pd.to_numeric(i.Turns, errors='coerce').sum()/total_n),2)
tree1data.append([wins,
losses,
win_rate,
Expand All @@ -3751,9 +3751,9 @@ def tree_setup(*argv):
opp_mull_rate = 0.0
turn_rate = 0.0
else:
hero_mull_rate =round((i[(i.P1_Subarch == deck) & (i.P2_Subarch == opp_deck)].P1_Mulls.sum()/total_n),2)
opp_mull_rate = round((i[(i.P1_Subarch == deck) & (i.P2_Subarch == opp_deck)].P2_Mulls.sum()/total_n),2)
turn_rate = round((i[(i.P1_Subarch == deck) & (i.P2_Subarch == opp_deck)].Turns.sum()/total_n),2)
hero_mull_rate =round((pd.to_numeric(i[(i.P1_Subarch == deck) & (i.P2_Subarch == opp_deck)].P1_Mulls, errors='coerce').sum()/total_n),2)
opp_mull_rate = round((pd.to_numeric(i[(i.P1_Subarch == deck) & (i.P2_Subarch == opp_deck)].P2_Mulls, errors='coerce').sum()/total_n),2)
turn_rate = round((pd.to_numeric(i[(i.P1_Subarch == deck) & (i.P2_Subarch == opp_deck)].Turns, errors='coerce').sum()/total_n),2)
tree2data.append([wins,
losses,
win_rate,
Expand All @@ -3780,9 +3780,9 @@ def tree_setup(*argv):
opp_mull_rate = 0.0
turn_rate = 0.0
else:
hero_mull_rate =round((i[(i.P1_Subarch == deck)].P1_Mulls.sum()/total_n),2)
opp_mull_rate = round((i[(i.P1_Subarch == deck)].P2_Mulls.sum()/total_n),2)
turn_rate = round((i[(i.P1_Subarch == deck)].Turns.sum()/total_n),2)
hero_mull_rate =round((pd.to_numeric(i[(i.P1_Subarch == deck)].P1_Mulls, errors='coerce').sum()/total_n),2)
opp_mull_rate = round((pd.to_numeric(i[(i.P1_Subarch == deck)].P2_Mulls, errors='coerce').sum()/total_n),2)
turn_rate = round((pd.to_numeric(i[(i.P1_Subarch == deck)].Turns, errors='coerce').sum()/total_n),2)
tree3data.append([wins,
losses,
win_rate,
Expand All @@ -3809,9 +3809,9 @@ def tree_setup(*argv):
opp_mull_rate = 0.0
turn_rate = 0.0
else:
hero_mull_rate =round((i[(i.P2_Subarch == opp_deck)].P1_Mulls.sum()/total_n),2)
opp_mull_rate = round((i[(i.P2_Subarch == opp_deck)].P2_Mulls.sum()/total_n),2)
turn_rate = round((i[(i.P2_Subarch == opp_deck)].Turns.sum()/total_n),2)
hero_mull_rate =round((pd.to_numeric(i[(i.P2_Subarch == opp_deck)].P1_Mulls, errors='coerce').sum()/total_n),2)
opp_mull_rate = round((pd.to_numeric(i[(i.P2_Subarch == opp_deck)].P2_Mulls, errors='coerce').sum()/total_n),2)
turn_rate = round((pd.to_numeric(i[(i.P2_Subarch == opp_deck)].Turns, errors='coerce').sum()/total_n),2)
tree4data.append([wins,
losses,
win_rate,
Expand Down Expand Up @@ -5556,13 +5556,13 @@ def debug():
txt.write(f"MAIN_WINDOW_SIZE: {MAIN_WINDOW_SIZE}\n")
txt.write("\n")

txt.write("INPUT_OPTIONS:\n")
for i in INPUT_OPTIONS:
txt.write(f'{i}:\n')
for j in INPUT_OPTIONS[i]:
txt.write(f'{j}\n')
txt.write('\n')
txt.write("\n")
# txt.write("INPUT_OPTIONS:\n")
# for i in INPUT_OPTIONS:
# txt.write(f'{i}:\n')
# for j in INPUT_OPTIONS[i]:
# txt.write(f'{j}\n')
# txt.write('\n')
# txt.write("\n")

txt.write(f"PARSED_FILE_DICT ({str(len(PARSED_FILE_DICT))} files):\n")
for i in PARSED_FILE_DICT:
Expand Down

0 comments on commit 033d3f9

Please sign in to comment.