James McCool commited on
Commit
c982556
·
1 Parent(s): 8566545

Enhance database loading logic for NBA and NFL projections

Browse files

Updated the logic for loading projections from the database based on the selected site (Draftkings or Fanduel) for both NBA and NFL sports. This change improves the accuracy of the projections loaded into the session state.

Files changed (1) hide show
  1. app.py +8 -2
app.py CHANGED
@@ -882,9 +882,15 @@ if selected_tab == 'Data Load':
882
  elif proj_options == 'Paydirt DB':
883
  if st.button("Load from Database"):
884
  if sport_var == 'NBA':
885
- projections_file = init_nba_baselines(type_var, site_var, slate_var3)[0]
 
 
 
886
  elif sport_var == 'NFL':
887
- projections_file = init_nfl_baselines(type_var, site_var, slate_var3)[0]
 
 
 
888
  st.session_state['db_projections_file'] = projections_file
889
  st.session_state['projections_loaded'] = True
890
  if 'projections_df' in st.session_state:
 
882
  elif proj_options == 'Paydirt DB':
883
  if st.button("Load from Database"):
884
  if sport_var == 'NBA':
885
+ if site_var == 'Draftkings':
886
+ projections_file = init_nba_baselines(type_var, site_var, slate_var3)[0]
887
+ elif site_var == 'Fanduel':
888
+ projections_file = init_nba_baselines(type_var, site_var, slate_var3)[1]
889
  elif sport_var == 'NFL':
890
+ if site_var == 'Draftkings':
891
+ projections_file = init_nfl_baselines(type_var, site_var, slate_var3)[0]
892
+ elif site_var == 'Fanduel':
893
+ projections_file = init_nfl_baselines(type_var, site_var, slate_var3)[1]
894
  st.session_state['db_projections_file'] = projections_file
895
  st.session_state['projections_loaded'] = True
896
  if 'projections_df' in st.session_state: