James McCool commited on
Commit
cadb059
·
1 Parent(s): 7907e2d

Removing stint_stats returns and prints.

Browse files
Files changed (1) hide show
  1. src/streamlit_app.py +9 -10
src/streamlit_app.py CHANGED
@@ -116,7 +116,6 @@ def init_baselines(data_req: str):
116
  'Passes', 'Alt Assists', 'FT Assists', 'Assists', 'Stl', 'Blk', 'Tov', 'PF', 'DD', 'TD', 'Fantasy', 'FD_Fantasy', 'FPPM',
117
  'Rebound%', 'Assists/Pass', 'Touch_per_min', 'Fantasy/Touch', 'FD Fantasy/Touch', 'team_score', 'opp_score', 'spread'], axis=1)
118
  game_rot = None
119
- stint_stats = None
120
  timestamp = gamelog_table['Date'].max()
121
  elif data_req == 'all':
122
  collection = db["gamelog"]
@@ -213,7 +212,7 @@ def init_baselines(data_req: str):
213
  except Exception:
214
  pass # Silently continue if stint stats unavailable
215
 
216
- return gamelog_table, game_rot, stint_stats.head(10), timestamp
217
 
218
  @st.cache_data(show_spinner=False)
219
  def seasonlong_build(data_sample):
@@ -331,7 +330,7 @@ if selected_tab == 'Gamelogs':
331
  with col1:
332
  if st.button("Reset Data", key='reset1'):
333
  st.cache_data.clear()
334
- gamelog_table, game_rot, stint_stats, timestamp = init_baselines('gamelogs')
335
  basic_cols = ['Player', 'Pos', 'Team', 'Opp', 'Season', 'Date', 'Matchup', 'Min']
336
  basic_season_cols = ['Pos', 'Team', 'Min']
337
  data_cols = ['team_score', 'opp_score', 'spread', 'Touches', 'Pts', 'FGM', 'FGA', 'FG%', 'FG3M',
@@ -350,7 +349,7 @@ if selected_tab == 'Gamelogs':
350
  total_players = indv_players.Player.values.tolist()
351
  total_dates = gamelog_table.Date.values.tolist()
352
 
353
- gamelog_table, game_rot, stint_stats, timestamp = init_baselines('gamelogs')
354
  indv_teams = gamelog_table.drop_duplicates(subset='Team')
355
  total_teams = indv_teams.Team.values.tolist()
356
  indv_players = gamelog_table.drop_duplicates(subset='Player')
@@ -462,7 +461,7 @@ if selected_tab == 'Correlation Matrix':
462
  with col1:
463
  if st.button("Reset Data", key='reset2'):
464
  st.cache_data.clear()
465
- gamelog_table, game_rot, stint_stats, timestamp = init_baselines('gamelogs')
466
  basic_cols = ['Player', 'Pos', 'Team', 'Opp', 'Season', 'Date', 'Matchup', 'Min']
467
  basic_season_cols = ['Pos', 'Team', 'Min']
468
  data_cols = ['team_score', 'opp_score', 'spread', 'Touches', 'Pts', 'FGM', 'FGA', 'FG%', 'FG3M',
@@ -481,7 +480,7 @@ if selected_tab == 'Correlation Matrix':
481
  total_players = indv_players.Player.values.tolist()
482
  total_dates = gamelog_table.Date.values.tolist()
483
 
484
- gamelog_table, game_rot, stint_stats, timestamp = init_baselines('gamelogs')
485
  indv_teams = gamelog_table.drop_duplicates(subset='Team')
486
  total_teams = indv_teams.Team.values.tolist()
487
  indv_players = gamelog_table.drop_duplicates(subset='Player')
@@ -559,7 +558,7 @@ if selected_tab == 'Position vs. Opp':
559
  with col1:
560
  if st.button("Reset Data", key='reset3'):
561
  st.cache_data.clear()
562
- gamelog_table, game_rot, stint_stats, timestamp = init_baselines('gamelogs')
563
  basic_cols = ['Player', 'Pos', 'Team', 'Opp', 'Season', 'Date', 'Matchup', 'Min']
564
  basic_season_cols = ['Pos', 'Team', 'Min']
565
  data_cols = ['team_score', 'opp_score', 'spread', 'Touches', 'Pts', 'FGM', 'FGA', 'FG%', 'FG3M',
@@ -578,7 +577,7 @@ if selected_tab == 'Position vs. Opp':
578
  total_players = indv_players.Player.values.tolist()
579
  total_dates = gamelog_table.Date.values.tolist()
580
 
581
- gamelog_table, game_rot, stint_stats, timestamp = init_baselines('gamelogs')
582
  indv_teams = gamelog_table.drop_duplicates(subset='Team')
583
  total_teams = indv_teams.Team.values.tolist()
584
  indv_players = gamelog_table.drop_duplicates(subset='Player')
@@ -648,7 +647,7 @@ if selected_tab == 'Game Rotations':
648
  with col1:
649
  if st.button("Reset Data", key='reset5'):
650
  st.cache_data.clear()
651
- gamelog_table, game_rot, stint_stats, timestamp = init_baselines('all')
652
 
653
  basic_cols = ['Player', 'Pos', 'Team', 'Opp', 'Season', 'Date', 'Matchup', 'Min']
654
  basic_season_cols = ['Pos', 'Team', 'Min']
@@ -670,7 +669,7 @@ if selected_tab == 'Game Rotations':
670
  total_players = indv_players.Player.values.tolist()
671
  total_dates = gamelog_table.Date.values.tolist()
672
 
673
- gamelog_table, game_rot, stint_stats, timestamp = init_baselines('all')
674
  basic_cols = ['Player', 'Pos', 'Team', 'Team Abbr', 'Opp', 'Opp Abbr', 'Season', 'Date', 'Matchup', 'Min']
675
  basic_season_cols = ['Pos', 'Team', 'Team Abbr', 'Min']
676
  data_cols = ['team_score', 'opp_score', 'spread', 'Touches', 'Pts', 'FGM', 'FGA', 'FG%', 'FG3M',
 
116
  'Passes', 'Alt Assists', 'FT Assists', 'Assists', 'Stl', 'Blk', 'Tov', 'PF', 'DD', 'TD', 'Fantasy', 'FD_Fantasy', 'FPPM',
117
  'Rebound%', 'Assists/Pass', 'Touch_per_min', 'Fantasy/Touch', 'FD Fantasy/Touch', 'team_score', 'opp_score', 'spread'], axis=1)
118
  game_rot = None
 
119
  timestamp = gamelog_table['Date'].max()
120
  elif data_req == 'all':
121
  collection = db["gamelog"]
 
212
  except Exception:
213
  pass # Silently continue if stint stats unavailable
214
 
215
+ return gamelog_table, game_rot, timestamp
216
 
217
  @st.cache_data(show_spinner=False)
218
  def seasonlong_build(data_sample):
 
330
  with col1:
331
  if st.button("Reset Data", key='reset1'):
332
  st.cache_data.clear()
333
+ gamelog_table, game_rot, timestamp = init_baselines('gamelogs')
334
  basic_cols = ['Player', 'Pos', 'Team', 'Opp', 'Season', 'Date', 'Matchup', 'Min']
335
  basic_season_cols = ['Pos', 'Team', 'Min']
336
  data_cols = ['team_score', 'opp_score', 'spread', 'Touches', 'Pts', 'FGM', 'FGA', 'FG%', 'FG3M',
 
349
  total_players = indv_players.Player.values.tolist()
350
  total_dates = gamelog_table.Date.values.tolist()
351
 
352
+ gamelog_table, game_rot, timestamp = init_baselines('gamelogs')
353
  indv_teams = gamelog_table.drop_duplicates(subset='Team')
354
  total_teams = indv_teams.Team.values.tolist()
355
  indv_players = gamelog_table.drop_duplicates(subset='Player')
 
461
  with col1:
462
  if st.button("Reset Data", key='reset2'):
463
  st.cache_data.clear()
464
+ gamelog_table, game_rot, timestamp = init_baselines('gamelogs')
465
  basic_cols = ['Player', 'Pos', 'Team', 'Opp', 'Season', 'Date', 'Matchup', 'Min']
466
  basic_season_cols = ['Pos', 'Team', 'Min']
467
  data_cols = ['team_score', 'opp_score', 'spread', 'Touches', 'Pts', 'FGM', 'FGA', 'FG%', 'FG3M',
 
480
  total_players = indv_players.Player.values.tolist()
481
  total_dates = gamelog_table.Date.values.tolist()
482
 
483
+ gamelog_table, game_rot, timestamp = init_baselines('gamelogs')
484
  indv_teams = gamelog_table.drop_duplicates(subset='Team')
485
  total_teams = indv_teams.Team.values.tolist()
486
  indv_players = gamelog_table.drop_duplicates(subset='Player')
 
558
  with col1:
559
  if st.button("Reset Data", key='reset3'):
560
  st.cache_data.clear()
561
+ gamelog_table, game_rot, timestamp = init_baselines('gamelogs')
562
  basic_cols = ['Player', 'Pos', 'Team', 'Opp', 'Season', 'Date', 'Matchup', 'Min']
563
  basic_season_cols = ['Pos', 'Team', 'Min']
564
  data_cols = ['team_score', 'opp_score', 'spread', 'Touches', 'Pts', 'FGM', 'FGA', 'FG%', 'FG3M',
 
577
  total_players = indv_players.Player.values.tolist()
578
  total_dates = gamelog_table.Date.values.tolist()
579
 
580
+ gamelog_table, game_rot, timestamp = init_baselines('gamelogs')
581
  indv_teams = gamelog_table.drop_duplicates(subset='Team')
582
  total_teams = indv_teams.Team.values.tolist()
583
  indv_players = gamelog_table.drop_duplicates(subset='Player')
 
647
  with col1:
648
  if st.button("Reset Data", key='reset5'):
649
  st.cache_data.clear()
650
+ gamelog_table, game_rot, timestamp = init_baselines('all')
651
 
652
  basic_cols = ['Player', 'Pos', 'Team', 'Opp', 'Season', 'Date', 'Matchup', 'Min']
653
  basic_season_cols = ['Pos', 'Team', 'Min']
 
669
  total_players = indv_players.Player.values.tolist()
670
  total_dates = gamelog_table.Date.values.tolist()
671
 
672
+ gamelog_table, game_rot, timestamp = init_baselines('all')
673
  basic_cols = ['Player', 'Pos', 'Team', 'Team Abbr', 'Opp', 'Opp Abbr', 'Season', 'Date', 'Matchup', 'Min']
674
  basic_season_cols = ['Pos', 'Team', 'Team Abbr', 'Min']
675
  data_cols = ['team_score', 'opp_score', 'spread', 'Touches', 'Pts', 'FGM', 'FGA', 'FG%', 'FG3M',