nesticot commited on
Commit
25a170d
·
verified ·
1 Parent(s): 1c504ce

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -1
app.py CHANGED
@@ -491,7 +491,21 @@ def server(input, output, session):
491
  def player_select_ui():
492
  # Get the list of pitchers for the selected level and season
493
  if input.level_input() == '21':
494
- return ui.input_select("pitcher_id", "Select Pitcher", {806258:'Thomas White'}, selectize=True)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
495
 
496
  df_pitcher_info = scrape.get_players(sport_id=int(input.level_input()), season=int(input.year_input()), game_type = [input.type_input()]).filter(
497
  (pl.col("position").is_in(['P','TWP']))|
 
491
  def player_select_ui():
492
  # Get the list of pitchers for the selected level and season
493
  if input.level_input() == '21':
494
+
495
+ # Get game data
496
+ game_list = scrape.get_player_games_list(
497
+ sport_id=sport_id,
498
+ season=year_input,
499
+ player_id=player_input,
500
+ start_date=start_date,
501
+ end_date=end_date,
502
+ game_type=game_type
503
+ )
504
+
505
+ data_list = scrape.get_data(game_list_input=game_list[:])
506
+ df_pitcher_info = scrape.get_data_df(data_list=data_list).filter((pl.col("start_speed") >= 50)).sort('pitcher_name')
507
+ pitcher_dict = dict(zip(df_pitcher_info['pitcher_id'], df_pitcher_info['pitcher_name']))
508
+ return ui.input_select("pitcher_id", "Select Pitcher",pitcher_dict, selectize=True)
509
 
510
  df_pitcher_info = scrape.get_players(sport_id=int(input.level_input()), season=int(input.year_input()), game_type = [input.type_input()]).filter(
511
  (pl.col("position").is_in(['P','TWP']))|