James McCool commited on
Commit
3b75b70
·
1 Parent(s): 10ea178

Refactor sport selection logic in app.py to utilize stacking_sports variable, enhancing maintainability and consistency in user options.

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -1125,7 +1125,7 @@ with tab2:
1125
  max_salary = st.number_input("Max acceptable salary?", value=100000, min_value=1000, step=100)
1126
  max_finish_percentile = st.number_input("Max acceptable finish percentile?", value=.50, min_value=0.005, step=.001)
1127
  min_lineup_edge = st.number_input("Min acceptable Lineup Edge?", value=-.5, min_value=-1.00, step=.001)
1128
- if sport_var in ['NFL', 'MLB', 'NHL', 'LOL']:
1129
  stack_include_toggle = st.selectbox("Include specific stacks?", options=['All Stacks', 'Specific Stacks'], index=0)
1130
  stack_selections = st.multiselect("If Specific Stacks, Which to include?", options=sorted(list(set(st.session_state['stack_dict'].values()))), default=[])
1131
 
@@ -1188,7 +1188,7 @@ with tab2:
1188
  player_remove = st.multiselect("Remove players?", options=sorted(list(player_names)), default=[])
1189
  team_include = st.multiselect("Include teams?", options=sorted(list(set(st.session_state['projections_df']['team'].unique()))), default=[])
1190
  team_remove = st.multiselect("Remove teams?", options=sorted(list(set(st.session_state['projections_df']['team'].unique()))), default=[])
1191
- if sport_var in ['NFL', 'MLB', 'NHL', 'LOL']:
1192
  size_include = st.multiselect("Include sizes?", options=sorted(list(set(st.session_state['working_frame']['Size'].unique()))), default=[])
1193
  else:
1194
  size_include = []
 
1125
  max_salary = st.number_input("Max acceptable salary?", value=100000, min_value=1000, step=100)
1126
  max_finish_percentile = st.number_input("Max acceptable finish percentile?", value=.50, min_value=0.005, step=.001)
1127
  min_lineup_edge = st.number_input("Min acceptable Lineup Edge?", value=-.5, min_value=-1.00, step=.001)
1128
+ if sport_var in stacking_sports:
1129
  stack_include_toggle = st.selectbox("Include specific stacks?", options=['All Stacks', 'Specific Stacks'], index=0)
1130
  stack_selections = st.multiselect("If Specific Stacks, Which to include?", options=sorted(list(set(st.session_state['stack_dict'].values()))), default=[])
1131
 
 
1188
  player_remove = st.multiselect("Remove players?", options=sorted(list(player_names)), default=[])
1189
  team_include = st.multiselect("Include teams?", options=sorted(list(set(st.session_state['projections_df']['team'].unique()))), default=[])
1190
  team_remove = st.multiselect("Remove teams?", options=sorted(list(set(st.session_state['projections_df']['team'].unique()))), default=[])
1191
+ if sport_var in stacking_sports:
1192
  size_include = st.multiselect("Include sizes?", options=sorted(list(set(st.session_state['working_frame']['Size'].unique()))), default=[])
1193
  else:
1194
  size_include = []