James McCool commited on
Commit
181beb3
·
1 Parent(s): d92d150

Update sport selection options in app.py to include 'NAS'

Browse files

- Modified the sport selection dropdown to replace 'TENNIS' with 'NAS' and adjusted related position selection logic accordingly. This change enhances the app's functionality by accommodating the new sport option.

Files changed (1) hide show
  1. app.py +8 -2
app.py CHANGED
@@ -122,7 +122,7 @@ with tab1:
122
  sport_options, date_options = st.columns(2)
123
  parse_type = 'Manual'
124
  with sport_options:
125
- sport_select = st.selectbox("Select Sport", ['MLB', 'MMA', 'GOLF', 'NBA', 'NHL', 'WNBA', 'TENNIS'], key='sport_select')
126
  type_var = st.selectbox("Select Game Type", ['Classic', 'Showdown'], key='type_var')
127
  try:
128
  contest_names, curr_info = grab_contest_names(db, sport_select, type_var)
@@ -506,7 +506,7 @@ with tab2:
506
  pos_select = st.multiselect("Select your position(s)", ['All the same position', 'So', 'Yeah', 'Idk'], key='pos_select')
507
  elif sport_select == 'GOLF':
508
  pos_select = st.multiselect("Select your position(s)", ['All the same position', 'So', 'Yeah', 'Idk'], key='pos_select')
509
- elif sport_select == 'TENNIS':
510
  pos_select = st.multiselect("Select your position(s)", ['All the same position', 'So', 'Yeah', 'Idk'], key='pos_select')
511
  submitted = st.form_submit_button("Submit")
512
  if submitted:
@@ -532,6 +532,8 @@ with tab2:
532
  hold_frame = player_exp_comp.copy()
533
  if sport_select == 'GOLF':
534
  hold_frame['Pos'] = 'G'
 
 
535
  else:
536
  hold_frame['Pos'] = hold_frame['Player'].map(st.session_state['map_dict']['pos_map'])
537
  player_exp_comp.insert(1, 'Pos', hold_frame['Pos'])
@@ -548,6 +550,8 @@ with tab2:
548
  hold_frame = st.session_state['player_frame'].copy()
549
  if sport_select == 'GOLF':
550
  hold_frame['Pos'] = 'G'
 
 
551
  else:
552
  hold_frame['Pos'] = hold_frame['Player'].map(st.session_state['map_dict']['pos_map'])
553
  st.session_state['player_frame'].insert(1, 'Pos', hold_frame['Pos'])
@@ -566,6 +570,8 @@ with tab2:
566
  hold_frame = st.session_state['player_frame'].copy()
567
  if sport_select == 'GOLF':
568
  hold_frame['Pos'] = 'G'
 
 
569
  else:
570
  hold_frame['Pos'] = hold_frame['Player'].map(st.session_state['map_dict']['pos_map'])
571
  st.session_state['player_frame'].insert(1, 'Pos', hold_frame['Pos'])
 
122
  sport_options, date_options = st.columns(2)
123
  parse_type = 'Manual'
124
  with sport_options:
125
+ sport_select = st.selectbox("Select Sport", ['MLB', 'MMA', 'GOLF', 'NBA', 'NHL', 'WNBA', 'NAS'], key='sport_select')
126
  type_var = st.selectbox("Select Game Type", ['Classic', 'Showdown'], key='type_var')
127
  try:
128
  contest_names, curr_info = grab_contest_names(db, sport_select, type_var)
 
506
  pos_select = st.multiselect("Select your position(s)", ['All the same position', 'So', 'Yeah', 'Idk'], key='pos_select')
507
  elif sport_select == 'GOLF':
508
  pos_select = st.multiselect("Select your position(s)", ['All the same position', 'So', 'Yeah', 'Idk'], key='pos_select')
509
+ elif sport_select == 'NAS':
510
  pos_select = st.multiselect("Select your position(s)", ['All the same position', 'So', 'Yeah', 'Idk'], key='pos_select')
511
  submitted = st.form_submit_button("Submit")
512
  if submitted:
 
532
  hold_frame = player_exp_comp.copy()
533
  if sport_select == 'GOLF':
534
  hold_frame['Pos'] = 'G'
535
+ elif sport_select == 'NAS':
536
+ hold_frame['Pos'] = 'C'
537
  else:
538
  hold_frame['Pos'] = hold_frame['Player'].map(st.session_state['map_dict']['pos_map'])
539
  player_exp_comp.insert(1, 'Pos', hold_frame['Pos'])
 
550
  hold_frame = st.session_state['player_frame'].copy()
551
  if sport_select == 'GOLF':
552
  hold_frame['Pos'] = 'G'
553
+ elif sport_select == 'NAS':
554
+ hold_frame['Pos'] = 'NAS'
555
  else:
556
  hold_frame['Pos'] = hold_frame['Player'].map(st.session_state['map_dict']['pos_map'])
557
  st.session_state['player_frame'].insert(1, 'Pos', hold_frame['Pos'])
 
570
  hold_frame = st.session_state['player_frame'].copy()
571
  if sport_select == 'GOLF':
572
  hold_frame['Pos'] = 'G'
573
+ elif sport_select == 'NAS':
574
+ hold_frame['Pos'] = 'NAS'
575
  else:
576
  hold_frame['Pos'] = hold_frame['Player'].map(st.session_state['map_dict']['pos_map'])
577
  st.session_state['player_frame'].insert(1, 'Pos', hold_frame['Pos'])