Commit
·
d72caf0
1
Parent(s):
a37f146
feat: reorganization
Browse files
app.py
CHANGED
|
@@ -270,17 +270,17 @@ def usatt_rating_analyzer(file_obj):
|
|
| 270 |
peak_rating,
|
| 271 |
n_competitions_played,
|
| 272 |
n_matches_played,
|
| 273 |
-
|
| 274 |
-
|
| 275 |
-
|
| 276 |
-
most_frequent_opponents,
|
| 277 |
best_wins,
|
| 278 |
biggest_upsets,
|
|
|
|
| 279 |
highest_rated_opponent,
|
| 280 |
-
rating_over_time_fig,
|
| 281 |
match_with_longest_game,
|
| 282 |
-
|
| 283 |
-
|
|
|
|
| 284 |
)
|
| 285 |
|
| 286 |
|
|
@@ -296,12 +296,22 @@ with gr.Blocks() as demo:
|
|
| 296 |
3. Under 'Tournaments' or 'Leagues', click *Download Tournament/League Match History*.
|
| 297 |
## Usage
|
| 298 |
1. Simply add your tournament/league match history CSV file and click the "{analyze_btn_title}" button.
|
|
|
|
|
|
|
|
|
|
| 299 |
""")
|
| 300 |
with gr.Row():
|
| 301 |
with gr.Column():
|
| 302 |
input_file = gr.File(label='USATT Results File', file_types=['file'])
|
| 303 |
btn = gr.Button(analyze_btn_title)
|
| 304 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 305 |
with gr.Group():
|
| 306 |
with gr.Row():
|
| 307 |
with gr.Column():
|
|
@@ -316,31 +326,48 @@ with gr.Blocks() as demo:
|
|
| 316 |
with gr.Row():
|
| 317 |
with gr.Column():
|
| 318 |
rating_over_time_plot = gr.Plot(show_label=False)
|
| 319 |
-
with gr.Column():
|
| 320 |
-
matches_per_comp_plot = gr.Plot(show_label=False)
|
| 321 |
|
| 322 |
with gr.Row():
|
| 323 |
with gr.Column():
|
| 324 |
-
|
| 325 |
with gr.Column():
|
| 326 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 327 |
|
| 328 |
with gr.Row():
|
| 329 |
with gr.Column():
|
| 330 |
-
most_frequent_opponents_gdf = gr.Dataframe(label="Most frequent opponents", max_rows=5)
|
| 331 |
best_wins_gdf = gr.Dataframe(label="Best wins (matches won sorted by opponent post-competition rating)",
|
| 332 |
max_rows=5)
|
| 333 |
biggest_upsets_gdf = gr.Dataframe(label="Biggest upsets (matches won sorted by rating - opponent post-competition rating)",
|
| 334 |
max_rows=5)
|
| 335 |
-
highest_rated_opponent_gdf = gr.Dataframe(label="Best opponent", max_rows=1)
|
| 336 |
|
| 337 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 338 |
|
| 339 |
with gr.Row():
|
| 340 |
with gr.Column():
|
| 341 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 342 |
with gr.Column():
|
| 343 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 344 |
|
| 345 |
inputs = [input_file]
|
| 346 |
outputs = [
|
|
@@ -348,17 +375,17 @@ with gr.Blocks() as demo:
|
|
| 348 |
peak_rating_box,
|
| 349 |
num_comps_box,
|
| 350 |
num_matches_box,
|
| 351 |
-
|
| 352 |
-
|
| 353 |
-
|
| 354 |
-
most_frequent_opponents_gdf,
|
| 355 |
best_wins_gdf,
|
| 356 |
biggest_upsets_gdf,
|
|
|
|
| 357 |
highest_rated_opponent_gdf,
|
| 358 |
-
rating_over_time_plot,
|
| 359 |
match_longest_game_gdf,
|
| 360 |
-
|
| 361 |
-
|
|
|
|
| 362 |
]
|
| 363 |
|
| 364 |
btn.click(usatt_rating_analyzer, inputs=inputs, outputs=outputs)
|
|
|
|
| 270 |
peak_rating,
|
| 271 |
n_competitions_played,
|
| 272 |
n_matches_played,
|
| 273 |
+
rating_over_time_fig,
|
| 274 |
+
opponent_rating_distr_fig,
|
| 275 |
+
opponent_rating_dist_over_time_fig,
|
|
|
|
| 276 |
best_wins,
|
| 277 |
biggest_upsets,
|
| 278 |
+
most_frequent_opponents,
|
| 279 |
highest_rated_opponent,
|
|
|
|
| 280 |
match_with_longest_game,
|
| 281 |
+
opponent_name_word_cloud_fig,
|
| 282 |
+
competition_name_word_cloud_fig,
|
| 283 |
+
matches_per_competition_fig,
|
| 284 |
)
|
| 285 |
|
| 286 |
|
|
|
|
| 296 |
3. Under 'Tournaments' or 'Leagues', click *Download Tournament/League Match History*.
|
| 297 |
## Usage
|
| 298 |
1. Simply add your tournament/league match history CSV file and click the "{analyze_btn_title}" button.
|
| 299 |
+
|
| 300 |
+
---
|
| 301 |
+
|
| 302 |
""")
|
| 303 |
with gr.Row():
|
| 304 |
with gr.Column():
|
| 305 |
input_file = gr.File(label='USATT Results File', file_types=['file'])
|
| 306 |
btn = gr.Button(analyze_btn_title)
|
| 307 |
|
| 308 |
+
gr.Markdown("""<br />
|
| 309 |
+
|
| 310 |
+
## Overview
|
| 311 |
+
|
| 312 |
+
<br />
|
| 313 |
+
""")
|
| 314 |
+
|
| 315 |
with gr.Group():
|
| 316 |
with gr.Row():
|
| 317 |
with gr.Column():
|
|
|
|
| 326 |
with gr.Row():
|
| 327 |
with gr.Column():
|
| 328 |
rating_over_time_plot = gr.Plot(show_label=False)
|
|
|
|
|
|
|
| 329 |
|
| 330 |
with gr.Row():
|
| 331 |
with gr.Column():
|
| 332 |
+
opponent_rating_dist_plot = gr.Plot(show_label=False)
|
| 333 |
with gr.Column():
|
| 334 |
+
opponent_rating_dist_over_time_plot = gr.Plot(show_label=False)
|
| 335 |
+
|
| 336 |
+
gr.Markdown("""<br />
|
| 337 |
+
|
| 338 |
+
## Best Matches
|
| 339 |
+
|
| 340 |
+
<br />
|
| 341 |
+
""")
|
| 342 |
|
| 343 |
with gr.Row():
|
| 344 |
with gr.Column():
|
|
|
|
| 345 |
best_wins_gdf = gr.Dataframe(label="Best wins (matches won sorted by opponent post-competition rating)",
|
| 346 |
max_rows=5)
|
| 347 |
biggest_upsets_gdf = gr.Dataframe(label="Biggest upsets (matches won sorted by rating - opponent post-competition rating)",
|
| 348 |
max_rows=5)
|
|
|
|
| 349 |
|
| 350 |
+
gr.Markdown("""<br />
|
| 351 |
+
|
| 352 |
+
## Fun Facts
|
| 353 |
+
|
| 354 |
+
<br />
|
| 355 |
+
""")
|
| 356 |
|
| 357 |
with gr.Row():
|
| 358 |
with gr.Column():
|
| 359 |
+
most_frequent_opponents_gdf = gr.Dataframe(label="Most frequent opponents", max_rows=5)
|
| 360 |
+
highest_rated_opponent_gdf = gr.Dataframe(label="Best opponent", max_rows=1)
|
| 361 |
+
match_longest_game_gdf = gr.Dataframe(label="Match with longest game", max_rows=1)
|
| 362 |
+
|
| 363 |
+
with gr.Row():
|
| 364 |
with gr.Column():
|
| 365 |
+
opponent_names_plot = gr.Plot(label="Opponent names")
|
| 366 |
+
with gr.Column():
|
| 367 |
+
comp_names_plot = gr.Plot(label="Competition names")
|
| 368 |
+
with gr.Column():
|
| 369 |
+
matches_per_comp_plot = gr.Plot(show_label=False)
|
| 370 |
+
|
| 371 |
|
| 372 |
inputs = [input_file]
|
| 373 |
outputs = [
|
|
|
|
| 375 |
peak_rating_box,
|
| 376 |
num_comps_box,
|
| 377 |
num_matches_box,
|
| 378 |
+
rating_over_time_plot,
|
| 379 |
+
opponent_rating_dist_plot,
|
| 380 |
+
opponent_rating_dist_over_time_plot,
|
|
|
|
| 381 |
best_wins_gdf,
|
| 382 |
biggest_upsets_gdf,
|
| 383 |
+
most_frequent_opponents_gdf,
|
| 384 |
highest_rated_opponent_gdf,
|
|
|
|
| 385 |
match_longest_game_gdf,
|
| 386 |
+
opponent_names_plot,
|
| 387 |
+
comp_names_plot,
|
| 388 |
+
matches_per_comp_plot,
|
| 389 |
]
|
| 390 |
|
| 391 |
btn.click(usatt_rating_analyzer, inputs=inputs, outputs=outputs)
|