Update app.py
Browse files
app.py
CHANGED
|
@@ -489,24 +489,20 @@ def server(input, output, session):
|
|
| 489 |
@render.ui
|
| 490 |
@reactive.event(input.player_button, input.year_input, input.level_input, input.type_input,ignore_none=False)
|
| 491 |
def player_select_ui():
|
|
|
|
|
|
|
| 492 |
# Get the list of pitchers for the selected level and season
|
| 493 |
if input.level_input() == '21':
|
| 494 |
year_input = int(input.year_input())
|
| 495 |
sport_id = int(input.level_input())
|
| 496 |
-
player_input = int(input.pitcher_id())
|
| 497 |
start_date = str(input.date_id()[0])
|
| 498 |
end_date = str(input.date_id()[1])
|
| 499 |
game_type = [input.type_input()]
|
| 500 |
# Get game data
|
| 501 |
-
|
| 502 |
-
sport_id=sport_id,
|
| 503 |
-
season=year_input,
|
| 504 |
-
player_id=player_input,
|
| 505 |
-
start_date=start_date,
|
| 506 |
-
end_date=end_date,
|
| 507 |
-
game_type=game_type
|
| 508 |
-
)
|
| 509 |
|
|
|
|
| 510 |
data_list = scrape.get_data(game_list_input=game_list[:])
|
| 511 |
df_pitcher_info = scrape.get_data_df(data_list=data_list).filter((pl.col("start_speed") >= 50)).sort('pitcher_name')
|
| 512 |
pitcher_dict = dict(zip(df_pitcher_info['pitcher_id'], df_pitcher_info['pitcher_name']))
|
|
|
|
| 489 |
@render.ui
|
| 490 |
@reactive.event(input.player_button, input.year_input, input.level_input, input.type_input,ignore_none=False)
|
| 491 |
def player_select_ui():
|
| 492 |
+
|
| 493 |
+
|
| 494 |
# Get the list of pitchers for the selected level and season
|
| 495 |
if input.level_input() == '21':
|
| 496 |
year_input = int(input.year_input())
|
| 497 |
sport_id = int(input.level_input())
|
| 498 |
+
# player_input = int(input.pitcher_id())
|
| 499 |
start_date = str(input.date_id()[0])
|
| 500 |
end_date = str(input.date_id()[1])
|
| 501 |
game_type = [input.type_input()]
|
| 502 |
# Get game data
|
| 503 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 504 |
|
| 505 |
+
game_list = get_schedule(year_input=[year_input], sport_id=[sport_id], game_type=[game_type]).filter((pl.col('date')>=start_date)&(pl.col('date')<=end_date))['game_id']
|
| 506 |
data_list = scrape.get_data(game_list_input=game_list[:])
|
| 507 |
df_pitcher_info = scrape.get_data_df(data_list=data_list).filter((pl.col("start_speed") >= 50)).sort('pitcher_name')
|
| 508 |
pitcher_dict = dict(zip(df_pitcher_info['pitcher_id'], df_pitcher_info['pitcher_name']))
|