James McCool
commited on
Commit
·
ac34a80
1
Parent(s):
3ab0af0
making some explicit scenarios for position filtering
Browse files
app.py
CHANGED
|
@@ -2140,16 +2140,32 @@ if selected_tab == 'Manage Portfolio':
|
|
| 2140 |
with st.form(key='position_filtering_form'):
|
| 2141 |
position_choice = st.selectbox("Position to filter", options=[col for col in st.session_state['working_frame'].columns if col not in excluded_cols], index=0)
|
| 2142 |
position_filter = st.selectbox("Filter on:", options=pos_parse_options)
|
| 2143 |
-
if position_filter
|
| 2144 |
position_low_threshold = st.number_input("Low Threshold", value=0.0, min_value=0.0, step=1.0)
|
| 2145 |
-
position_high_threshold = st.number_input("High Threshold", value=
|
| 2146 |
filter_keys = None
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2147 |
else:
|
| 2148 |
filter_keys_choice = st.selectbox("Filter choice:", options=['Position', 'Team'])
|
| 2149 |
if filter_keys_choice == 'Position':
|
| 2150 |
filter_keys = st.multiselect("Position(s) to keep", options=[col for col in st.session_state['working_frame'].columns if col not in excluded_cols], default=[])
|
| 2151 |
else:
|
| 2152 |
-
filter_keys = st.multiselect("
|
| 2153 |
position_low_threshold = None
|
| 2154 |
position_high_threshold = None
|
| 2155 |
submitted_col, export_col = st.columns(2)
|
|
|
|
| 2140 |
with st.form(key='position_filtering_form'):
|
| 2141 |
position_choice = st.selectbox("Position to filter", options=[col for col in st.session_state['working_frame'].columns if col not in excluded_cols], index=0)
|
| 2142 |
position_filter = st.selectbox("Filter on:", options=pos_parse_options)
|
| 2143 |
+
if position_filter == 'Projection':
|
| 2144 |
position_low_threshold = st.number_input("Low Threshold", value=0.0, min_value=0.0, step=1.0)
|
| 2145 |
+
position_high_threshold = st.number_input("High Threshold", value=250.0, min_value=0.0, step=1.0)
|
| 2146 |
filter_keys = None
|
| 2147 |
+
elif position_filter == 'Ownership':
|
| 2148 |
+
position_low_threshold = st.number_input("Low Threshold", value=0.0, min_value=0.0, step=1.0)
|
| 2149 |
+
position_high_threshold = st.number_input("High Threshold", value=100.0, min_value=0.0, step=1.0)
|
| 2150 |
+
filter_keys = None
|
| 2151 |
+
elif position_filter == 'Salary':
|
| 2152 |
+
position_low_threshold = st.number_input("Low Threshold", value=0.0, min_value=0.0, step=1000.0)
|
| 2153 |
+
position_high_threshold = st.number_input("High Threshold", value=20000.0, min_value=0.0, step=1000.0)
|
| 2154 |
+
filter_keys = None
|
| 2155 |
+
elif position_filter == 'Position':
|
| 2156 |
+
filter_keys_choice = st.selectbox("Filter choice:", options=['Position', 'Team'])
|
| 2157 |
+
if filter_keys_choice == 'Position':
|
| 2158 |
+
filter_keys = st.multiselect("Position(s) to keep", options=[col for col in st.session_state['working_frame'].columns if col not in excluded_cols], default=[])
|
| 2159 |
+
else:
|
| 2160 |
+
filter_keys = st.multiselect("Team(s) to keep", options=st.session_state['map_dict']['team_map'].keys(), default=[])
|
| 2161 |
+
position_low_threshold = None
|
| 2162 |
+
position_high_threshold = None
|
| 2163 |
else:
|
| 2164 |
filter_keys_choice = st.selectbox("Filter choice:", options=['Position', 'Team'])
|
| 2165 |
if filter_keys_choice == 'Position':
|
| 2166 |
filter_keys = st.multiselect("Position(s) to keep", options=[col for col in st.session_state['working_frame'].columns if col not in excluded_cols], default=[])
|
| 2167 |
else:
|
| 2168 |
+
filter_keys = st.multiselect("Team(s) to keep", options=st.session_state['map_dict']['team_map'].keys(), default=[])
|
| 2169 |
position_low_threshold = None
|
| 2170 |
position_high_threshold = None
|
| 2171 |
submitted_col, export_col = st.columns(2)
|