James McCool
commited on
Commit
·
d318223
1
Parent(s):
58073a4
Refactor filter options in app.py: rename 'Filter Options' to 'Macro Filter Options' and streamline the filter form by consolidating stack selection logic, enhancing user experience and clarity in filtering functionalities.
Browse files
app.py
CHANGED
@@ -839,23 +839,27 @@ with tab2:
|
|
839 |
|
840 |
col1, col2 = st.columns([2, 8])
|
841 |
with col1:
|
842 |
-
with st.expander('Filter Options'):
|
843 |
with st.form(key='filter_form'):
|
844 |
max_dupes = st.number_input("Max acceptable dupes?", value=1000, min_value=1, step=1)
|
845 |
min_salary = st.number_input("Min acceptable salary?", value=1000, min_value=1000, step=100)
|
846 |
max_salary = st.number_input("Max acceptable salary?", value=60000, min_value=1000, step=100)
|
847 |
max_finish_percentile = st.number_input("Max acceptable finish percentile?", value=.50, min_value=0.005, step=.001)
|
848 |
min_lineup_edge = st.number_input("Min acceptable Lineup Edge?", value=-.5, min_value=-1.00, step=.001)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
849 |
player_names = set()
|
850 |
for col in st.session_state['portfolio'].columns:
|
851 |
if col not in excluded_cols:
|
852 |
player_names.update(st.session_state['portfolio'][col].unique())
|
853 |
player_lock = st.multiselect("Lock players?", options=sorted(list(player_names)), default=[])
|
854 |
player_remove = st.multiselect("Remove players?", options=sorted(list(player_names)), default=[])
|
855 |
-
if stack_dict is not None:
|
856 |
-
stack_toggle = st.selectbox("Include specific stacks?", options=['All Stacks', 'Specific Stacks'], index=0)
|
857 |
-
stack_selections = st.multiselect("If Specific Stacks, Which to include?", options=sorted(list(set(stack_dict.values()))), default=[])
|
858 |
-
stack_remove = st.multiselect("If Specific Stacks, Which to remove?", options=sorted(list(set(stack_dict.values()))), default=[])
|
859 |
|
860 |
submitted = st.form_submit_button("Submit")
|
861 |
with st.expander('Trimming Options'):
|
|
|
839 |
|
840 |
col1, col2 = st.columns([2, 8])
|
841 |
with col1:
|
842 |
+
with st.expander('Macro Filter Options'):
|
843 |
with st.form(key='filter_form'):
|
844 |
max_dupes = st.number_input("Max acceptable dupes?", value=1000, min_value=1, step=1)
|
845 |
min_salary = st.number_input("Min acceptable salary?", value=1000, min_value=1000, step=100)
|
846 |
max_salary = st.number_input("Max acceptable salary?", value=60000, min_value=1000, step=100)
|
847 |
max_finish_percentile = st.number_input("Max acceptable finish percentile?", value=.50, min_value=0.005, step=.001)
|
848 |
min_lineup_edge = st.number_input("Min acceptable Lineup Edge?", value=-.5, min_value=-1.00, step=.001)
|
849 |
+
if stack_dict is not None:
|
850 |
+
stack_toggle = st.selectbox("Include specific stacks?", options=['All Stacks', 'Specific Stacks'], index=0)
|
851 |
+
stack_selections = st.multiselect("If Specific Stacks, Which to include?", options=sorted(list(set(stack_dict.values()))), default=[])
|
852 |
+
stack_remove = st.multiselect("If Specific Stacks, Which to remove?", options=sorted(list(set(stack_dict.values()))), default=[])
|
853 |
+
|
854 |
+
submitted = st.form_submit_button("Submit")
|
855 |
+
with st.expander('Micro Filter Options'):
|
856 |
+
with st.form(key='filter_form'):
|
857 |
player_names = set()
|
858 |
for col in st.session_state['portfolio'].columns:
|
859 |
if col not in excluded_cols:
|
860 |
player_names.update(st.session_state['portfolio'][col].unique())
|
861 |
player_lock = st.multiselect("Lock players?", options=sorted(list(player_names)), default=[])
|
862 |
player_remove = st.multiselect("Remove players?", options=sorted(list(player_names)), default=[])
|
|
|
|
|
|
|
|
|
863 |
|
864 |
submitted = st.form_submit_button("Submit")
|
865 |
with st.expander('Trimming Options'):
|