Spaces:
Sleeping
Sleeping
James McCool
commited on
Commit
·
318ee39
1
Parent(s):
858e758
Refactor expander keys in Streamlit app for consistency and clarity
Browse files- src/streamlit_app.py +6 -6
src/streamlit_app.py
CHANGED
|
@@ -337,7 +337,7 @@ t_stamp = f"Last Update: " + str(dk_roo_raw['timestamp'][0]) + f" CST"
|
|
| 337 |
tab1, tab2, tab3, tab4 = st.tabs(["Stacks ROO", "Player ROO", "Optimals", "Handbuilder"])
|
| 338 |
|
| 339 |
with tab1:
|
| 340 |
-
with st.expander("Info and Filters"
|
| 341 |
st.info(t_stamp)
|
| 342 |
with st.container():
|
| 343 |
slate_var1 = st.radio("Which data are you loading?", ('Main Slate', 'Secondary Slate', 'Late Slate', 'Thurs-Mon Slate'), key='slate_var1_radio')
|
|
@@ -371,7 +371,7 @@ with tab1:
|
|
| 371 |
)
|
| 372 |
|
| 373 |
with tab2:
|
| 374 |
-
with st.expander("Info and Filters"
|
| 375 |
st.info(t_stamp)
|
| 376 |
slate_var2 = st.radio("Which data are you loading?", ('Main Slate', 'Secondary Slate', 'Late Slate', 'Thurs-Mon Slate'), key='slate_var2_radio')
|
| 377 |
if site_var == 'Draftkings':
|
|
@@ -434,7 +434,7 @@ with tab2:
|
|
| 434 |
|
| 435 |
with tab3:
|
| 436 |
st.header("Optimals")
|
| 437 |
-
with st.expander("Info and Filters"
|
| 438 |
st.info("These filters will display various optimals in the table below to pick from. If you want to export the entire set of 10,000 optimals, hit the 'Prepare full data export' button. If you would like to apply the filters here to the 10,000 optimals before you export, use the 'Prepare full data export (Filter)' button.")
|
| 439 |
col1, col2, col3, col4 = st.columns(4)
|
| 440 |
with col1:
|
|
@@ -992,7 +992,7 @@ with tab4:
|
|
| 992 |
slot_counts = lineup['Slot'].value_counts() if not lineup.empty else {}
|
| 993 |
|
| 994 |
# --- PLAYER FILTERS ---
|
| 995 |
-
with st.expander("Player Filters"
|
| 996 |
col1, col2 = st.columns(2)
|
| 997 |
with col1:
|
| 998 |
pos_select3 = st.multiselect("Select your position(s)", options=['QB', 'RB', 'WR', 'TE', 'UTIL', 'DST'], key='pos_select3_multiselect')
|
|
@@ -1000,7 +1000,7 @@ with tab4:
|
|
| 1000 |
salary_var = st.number_input("Salary Max", min_value = 0, max_value = 20000, value = 20000, step = 100, key='handbuilder_salary_max_input')
|
| 1001 |
|
| 1002 |
# --- TEAM FILTER UI ---
|
| 1003 |
-
with st.expander("Team Filters"
|
| 1004 |
all_teams = sorted(handbuild_roo['Team'].unique())
|
| 1005 |
st.markdown("**Toggle teams to include:**")
|
| 1006 |
team_cols = st.columns(len(all_teams) // 2 + 1)
|
|
@@ -1032,7 +1032,7 @@ with tab4:
|
|
| 1032 |
player_select_df = player_select_df[player_select_df['Salary'] <= salary_var]
|
| 1033 |
|
| 1034 |
|
| 1035 |
-
with st.expander("Quick Fill Options"
|
| 1036 |
auto_team_var = st.selectbox("Auto Fill Team", options=all_teams, key='auto_team_selectbox')
|
| 1037 |
auto_size_var = st.selectbox("Auto Fill Size", options=[3, 4, 5], key='auto_size_selectbox')
|
| 1038 |
auto_range_var = st.selectbox("Auto Fill Options", options=['QB/WR', 'RB/WR/TE', 'QB/WR/TE/RB'], key='auto_range_selectbox')
|
|
|
|
| 337 |
tab1, tab2, tab3, tab4 = st.tabs(["Stacks ROO", "Player ROO", "Optimals", "Handbuilder"])
|
| 338 |
|
| 339 |
with tab1:
|
| 340 |
+
with st.expander("Info and Filters"):
|
| 341 |
st.info(t_stamp)
|
| 342 |
with st.container():
|
| 343 |
slate_var1 = st.radio("Which data are you loading?", ('Main Slate', 'Secondary Slate', 'Late Slate', 'Thurs-Mon Slate'), key='slate_var1_radio')
|
|
|
|
| 371 |
)
|
| 372 |
|
| 373 |
with tab2:
|
| 374 |
+
with st.expander("Info and Filters"):
|
| 375 |
st.info(t_stamp)
|
| 376 |
slate_var2 = st.radio("Which data are you loading?", ('Main Slate', 'Secondary Slate', 'Late Slate', 'Thurs-Mon Slate'), key='slate_var2_radio')
|
| 377 |
if site_var == 'Draftkings':
|
|
|
|
| 434 |
|
| 435 |
with tab3:
|
| 436 |
st.header("Optimals")
|
| 437 |
+
with st.expander("Info and Filters"):
|
| 438 |
st.info("These filters will display various optimals in the table below to pick from. If you want to export the entire set of 10,000 optimals, hit the 'Prepare full data export' button. If you would like to apply the filters here to the 10,000 optimals before you export, use the 'Prepare full data export (Filter)' button.")
|
| 439 |
col1, col2, col3, col4 = st.columns(4)
|
| 440 |
with col1:
|
|
|
|
| 992 |
slot_counts = lineup['Slot'].value_counts() if not lineup.empty else {}
|
| 993 |
|
| 994 |
# --- PLAYER FILTERS ---
|
| 995 |
+
with st.expander("Player Filters"):
|
| 996 |
col1, col2 = st.columns(2)
|
| 997 |
with col1:
|
| 998 |
pos_select3 = st.multiselect("Select your position(s)", options=['QB', 'RB', 'WR', 'TE', 'UTIL', 'DST'], key='pos_select3_multiselect')
|
|
|
|
| 1000 |
salary_var = st.number_input("Salary Max", min_value = 0, max_value = 20000, value = 20000, step = 100, key='handbuilder_salary_max_input')
|
| 1001 |
|
| 1002 |
# --- TEAM FILTER UI ---
|
| 1003 |
+
with st.expander("Team Filters"):
|
| 1004 |
all_teams = sorted(handbuild_roo['Team'].unique())
|
| 1005 |
st.markdown("**Toggle teams to include:**")
|
| 1006 |
team_cols = st.columns(len(all_teams) // 2 + 1)
|
|
|
|
| 1032 |
player_select_df = player_select_df[player_select_df['Salary'] <= salary_var]
|
| 1033 |
|
| 1034 |
|
| 1035 |
+
with st.expander("Quick Fill Options"):
|
| 1036 |
auto_team_var = st.selectbox("Auto Fill Team", options=all_teams, key='auto_team_selectbox')
|
| 1037 |
auto_size_var = st.selectbox("Auto Fill Size", options=[3, 4, 5], key='auto_size_selectbox')
|
| 1038 |
auto_range_var = st.selectbox("Auto Fill Options", options=['QB/WR', 'RB/WR/TE', 'QB/WR/TE/RB'], key='auto_range_selectbox')
|