James McCool commited on
Commit
cced62b
·
1 Parent(s): c626d33

Refactor contest simulation UI in Streamlit app to improve layout and user interaction. Introduced new columns for site selection and contest parameters, while removing redundant options for player and team locking. This enhances clarity and usability for users simulating contests.

Browse files
Files changed (1) hide show
  1. src/streamlit_app.py +7 -9
src/streamlit_app.py CHANGED
@@ -238,11 +238,14 @@ if selected_tab == "Contest Sims":
238
  raw_baselines = dk_raw
239
  column_names = dk_columns
240
  with st.expander("Info and Filters"):
241
- slate_data_col, sim_data_col, sim_lock_options, sim_remove_options = st.columns([1, 1, 1, 1])
 
 
 
242
  with slate_data_col:
243
  sim_slate_var1 = st.radio("Which data are you loading?", ('Main Slate', 'Secondary Slate'), key='sim_slate_var1')
244
- sim_site_var1 = st.radio("What site are you working with?", ('Draftkings', 'Fanduel'), key='sim_site_var1')
245
- with sim_data_col:
246
  contest_var1 = st.selectbox("What contest size are you simulating?", ('Small', 'Medium', 'Large'))
247
  if contest_var1 == 'Small':
248
  Contest_Size = 1000
@@ -252,6 +255,7 @@ if selected_tab == "Contest Sims":
252
  Contest_Size = 10000
253
  elif contest_var1 == 'Custom':
254
  Contest_Size = st.number_input("Insert contest size", value=100, placeholder="Type a number under 10,000...")
 
255
  strength_var1 = st.selectbox("How sharp is the field in the contest?", ('Very', 'Above Average', 'Average', 'Below Average', 'Not Very'))
256
  if strength_var1 == 'Not Very':
257
  sharp_split = 500000
@@ -263,12 +267,6 @@ if selected_tab == "Contest Sims":
263
  sharp_split = 50000
264
  elif strength_var1 == 'Very':
265
  sharp_split = 10000
266
- with sim_lock_options:
267
- player_lock_var1 = st.multiselect("Sim around specific players?", raw_baselines.Player, default=[])
268
- team_lock_var1 = st.multiselect("Sim around specific teams?", raw_baselines.Team, default=[])
269
- with sim_remove_options:
270
- player_remove_var1 = st.multiselect("Remove specific players?", raw_baselines.Player, default=[])
271
- team_remove_var1 = st.multiselect("Remove specific teams?", raw_baselines.Team, default=[])
272
 
273
  if st.button("Run Contest Sim"):
274
 
 
238
  raw_baselines = dk_raw
239
  column_names = dk_columns
240
  with st.expander("Info and Filters"):
241
+ site_data_col, slate_data_col, contest_size_col, contest_sharpness_col = st.columns([1, 1, 1, 1])
242
+ with site_data_col:
243
+ sim_site_var1 = st.radio("What site are you working with?", ('Draftkings', 'Fanduel'), key='sim_site_var1')
244
+
245
  with slate_data_col:
246
  sim_slate_var1 = st.radio("Which data are you loading?", ('Main Slate', 'Secondary Slate'), key='sim_slate_var1')
247
+
248
+ with contest_size_col:
249
  contest_var1 = st.selectbox("What contest size are you simulating?", ('Small', 'Medium', 'Large'))
250
  if contest_var1 == 'Small':
251
  Contest_Size = 1000
 
255
  Contest_Size = 10000
256
  elif contest_var1 == 'Custom':
257
  Contest_Size = st.number_input("Insert contest size", value=100, placeholder="Type a number under 10,000...")
258
+ with contest_sharpness_col:
259
  strength_var1 = st.selectbox("How sharp is the field in the contest?", ('Very', 'Above Average', 'Average', 'Below Average', 'Not Very'))
260
  if strength_var1 == 'Not Very':
261
  sharp_split = 500000
 
267
  sharp_split = 50000
268
  elif strength_var1 == 'Very':
269
  sharp_split = 10000
 
 
 
 
 
 
270
 
271
  if st.button("Run Contest Sim"):
272