James McCool commited on
Commit
69b11f3
·
1 Parent(s): 08d71e4

Enhance app.py by adding unique keys to radio button selections in Scoring Percentages, Player ROO, and Optimals sections, improving state management and ensuring consistent user interactions across tabs.

Browse files
Files changed (1) hide show
  1. app.py +7 -7
app.py CHANGED
@@ -147,8 +147,8 @@ with tab1:
147
  st.header("Scoring Percentages")
148
  with st.expander("Info and Filters"):
149
  with st.container():
150
- slate_var1 = st.radio("Which data are you loading?", ('Main Slate', 'Secondary Slate', 'All Games'))
151
- own_var1 = st.radio("How would you like to display team ownership?", ('Sum', 'Average'))
152
  st.title("Scoring Percentages")
153
  if view_var == "Simple":
154
  scoring_percentages = scoring_percentages[['Names', 'Avg Score', '8+ runs', 'Win Percentage']]
@@ -160,9 +160,9 @@ with tab2:
160
  st.header("Player ROO")
161
  with st.expander("Info and Filters"):
162
  with st.container():
163
- slate_type_var2 = st.radio("Which slate type are you loading?", ('Regular', 'Showdown'))
164
- slate_var2 = st.radio("Which slate data are you loading?", ('Main', 'Secondary', 'Auxiliary'))
165
- pos_var2 = st.radio("Which position group would you like to view?", ('All', 'Pitchers', 'Hitters'))
166
  if slate_type_var2 == 'Regular':
167
  player_roo_raw = roo_data.copy()
168
  if site_var == 'Draftkings':
@@ -208,8 +208,8 @@ with tab3:
208
  st.header("Optimals")
209
  with st.expander("Info and Filters"):
210
  with st.container():
211
- slate_type_var3 = st.radio("Which slate type are you loading?", ('Regular', 'Showdown'))
212
- slate_var3 = st.radio("Which slate data are you loading?", ('Main', 'Secondary', 'Auxiliary'))
213
 
214
  if slate_type_var3 == 'Regular':
215
  if site_var == 'Draftkings':
 
147
  st.header("Scoring Percentages")
148
  with st.expander("Info and Filters"):
149
  with st.container():
150
+ slate_var1 = st.radio("Which data are you loading?", ('Main Slate', 'Secondary Slate', 'All Games'), key='slate_var1')
151
+ own_var1 = st.radio("How would you like to display team ownership?", ('Sum', 'Average'), key='own_var1')
152
  st.title("Scoring Percentages")
153
  if view_var == "Simple":
154
  scoring_percentages = scoring_percentages[['Names', 'Avg Score', '8+ runs', 'Win Percentage']]
 
160
  st.header("Player ROO")
161
  with st.expander("Info and Filters"):
162
  with st.container():
163
+ slate_type_var2 = st.radio("Which slate type are you loading?", ('Regular', 'Showdown'), key='slate_type_var2')
164
+ slate_var2 = st.radio("Which slate data are you loading?", ('Main', 'Secondary', 'Auxiliary'), key='slate_var2')
165
+ pos_var2 = st.radio("Which position group would you like to view?", ('All', 'Pitchers', 'Hitters'), key='pos_var2')
166
  if slate_type_var2 == 'Regular':
167
  player_roo_raw = roo_data.copy()
168
  if site_var == 'Draftkings':
 
208
  st.header("Optimals")
209
  with st.expander("Info and Filters"):
210
  with st.container():
211
+ slate_type_var3 = st.radio("Which slate type are you loading?", ('Regular', 'Showdown'), key='slate_type_var3')
212
+ slate_var3 = st.radio("Which slate data are you loading?", ('Main', 'Secondary', 'Auxiliary'), key='slate_var3')
213
 
214
  if slate_type_var3 == 'Regular':
215
  if site_var == 'Draftkings':