Spaces:
Running
Running
James McCool
commited on
Commit
·
f799298
1
Parent(s):
4d8dc24
Enhance app.py: add support for selecting slate type (Regular or Showdown) in the UI, update site selection logic to accommodate new slate types, and adjust column layout for improved user experience.
Browse files
app.py
CHANGED
@@ -290,26 +290,34 @@ with tab1:
|
|
290 |
t_stamp = f"Last Update: " + str(timestamp) + f" CST"
|
291 |
for key in st.session_state.keys():
|
292 |
del st.session_state[key]
|
293 |
-
col1, col2, col3, col4 = st.columns(
|
294 |
with col1:
|
295 |
view_var2 = st.radio("View Type", ('Simple', 'Advanced'), key='view_var2')
|
296 |
with col2:
|
|
|
|
|
297 |
site_var2 = st.radio("Site", ('Draftkings', 'Fanduel'), key='site_var2')
|
298 |
|
299 |
# Process site selection
|
300 |
if site_var2 == 'Draftkings':
|
301 |
-
|
|
|
|
|
|
|
302 |
elif site_var2 == 'Fanduel':
|
303 |
-
|
304 |
-
|
305 |
-
|
|
|
|
|
|
|
306 |
|
307 |
if slate_split == 'Main Slate':
|
308 |
raw_baselines = site_baselines[site_baselines['slate'] == 'Main Slate']
|
309 |
elif slate_split == 'Secondary':
|
310 |
raw_baselines = site_baselines[site_baselines['slate'] == 'Secondary Slate']
|
311 |
|
312 |
-
with
|
313 |
split_var2 = st.radio("Slate Range", ('Full Slate Run', 'Specific Games'), key='split_var2')
|
314 |
if split_var2 == 'Specific Games':
|
315 |
team_var2 = st.multiselect('Select teams for ROO', options=raw_baselines['Team'].unique(), key='team_var2')
|
@@ -334,7 +342,6 @@ with tab1:
|
|
334 |
display_proj = display_proj[['Player', 'Position', 'Salary', 'Median', 'GPP%', 'Own']]
|
335 |
export_data = display_proj.copy()
|
336 |
|
337 |
-
|
338 |
# display_proj = display_proj.set_index('Player')
|
339 |
st.session_state.display_proj = display_proj.set_index('Player', drop=True)
|
340 |
|
|
|
290 |
t_stamp = f"Last Update: " + str(timestamp) + f" CST"
|
291 |
for key in st.session_state.keys():
|
292 |
del st.session_state[key]
|
293 |
+
col1, col2, col3, col4, col5 = st.columns(5)
|
294 |
with col1:
|
295 |
view_var2 = st.radio("View Type", ('Simple', 'Advanced'), key='view_var2')
|
296 |
with col2:
|
297 |
+
slate_type_var2 = st.radio("What slate type are you working with?", ('Regular', 'Showdown'), key='slate_type_var2')
|
298 |
+
with col3:
|
299 |
site_var2 = st.radio("Site", ('Draftkings', 'Fanduel'), key='site_var2')
|
300 |
|
301 |
# Process site selection
|
302 |
if site_var2 == 'Draftkings':
|
303 |
+
if slate_type_var2 == 'Regular':
|
304 |
+
site_baselines = roo_raw[roo_raw['site'] == 'Draftkings']
|
305 |
+
elif slate_type_var2 == 'Showdown':
|
306 |
+
site_baselines = sd_raw[sd_raw['site'] == 'Draftkings']
|
307 |
elif site_var2 == 'Fanduel':
|
308 |
+
if slate_type_var2 == 'Regular':
|
309 |
+
site_baselines = roo_raw[roo_raw['site'] == 'Fanduel']
|
310 |
+
elif slate_type_var2 == 'Showdown':
|
311 |
+
site_baselines = sd_raw[sd_raw['site'] == 'Fanduel']
|
312 |
+
with col4:
|
313 |
+
slate_split = st.radio("Slate Type", ('Main Slate', 'Secondary'), key='slate_split')
|
314 |
|
315 |
if slate_split == 'Main Slate':
|
316 |
raw_baselines = site_baselines[site_baselines['slate'] == 'Main Slate']
|
317 |
elif slate_split == 'Secondary':
|
318 |
raw_baselines = site_baselines[site_baselines['slate'] == 'Secondary Slate']
|
319 |
|
320 |
+
with col5:
|
321 |
split_var2 = st.radio("Slate Range", ('Full Slate Run', 'Specific Games'), key='split_var2')
|
322 |
if split_var2 == 'Specific Games':
|
323 |
team_var2 = st.multiselect('Select teams for ROO', options=raw_baselines['Team'].unique(), key='team_var2')
|
|
|
342 |
display_proj = display_proj[['Player', 'Position', 'Salary', 'Median', 'GPP%', 'Own']]
|
343 |
export_data = display_proj.copy()
|
344 |
|
|
|
345 |
# display_proj = display_proj.set_index('Player')
|
346 |
st.session_state.display_proj = display_proj.set_index('Player', drop=True)
|
347 |
|