James McCool
commited on
Commit
·
b88e69e
1
Parent(s):
851f97e
More fine grained min/max filters in macro
Browse files
app.py
CHANGED
|
@@ -1196,11 +1196,22 @@ if selected_tab == 'Manage Portfolio':
|
|
| 1196 |
with st.expander('Macro Filter Options'):
|
| 1197 |
# recent changes for showdown included
|
| 1198 |
with st.form(key='macro_filter_form'):
|
| 1199 |
-
|
| 1200 |
-
|
| 1201 |
-
|
| 1202 |
-
|
| 1203 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1204 |
if sport_var in stacking_sports:
|
| 1205 |
stack_include_toggle = st.selectbox("Include specific stacks?", options=['All Stacks', 'Specific Stacks'], index=0)
|
| 1206 |
stack_selections = st.multiselect("If Specific Stacks, Which to include?", options=sorted(list(set(st.session_state['stack_dict'].values()))), default=[])
|
|
@@ -1218,11 +1229,21 @@ if selected_tab == 'Manage Portfolio':
|
|
| 1218 |
if reg_submitted:
|
| 1219 |
st.session_state['settings_base'] = False
|
| 1220 |
parsed_frame = st.session_state['working_frame'].copy()
|
| 1221 |
-
|
| 1222 |
parsed_frame = parsed_frame[parsed_frame['salary'] >= min_salary]
|
| 1223 |
parsed_frame = parsed_frame[parsed_frame['salary'] <= max_salary]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1224 |
parsed_frame = parsed_frame[parsed_frame['Finish_percentile'] <= max_finish_percentile]
|
| 1225 |
parsed_frame = parsed_frame[parsed_frame['Lineup Edge'] >= min_lineup_edge]
|
|
|
|
|
|
|
|
|
|
| 1226 |
if 'Stack' in parsed_frame.columns:
|
| 1227 |
if stack_include_toggle == 'All Stacks':
|
| 1228 |
parsed_frame = parsed_frame
|
|
@@ -1237,11 +1258,20 @@ if selected_tab == 'Manage Portfolio':
|
|
| 1237 |
if exp_submitted:
|
| 1238 |
st.session_state['settings_base'] = False
|
| 1239 |
parsed_frame = st.session_state['export_base'].copy()
|
| 1240 |
-
|
| 1241 |
parsed_frame = parsed_frame[parsed_frame['salary'] >= min_salary]
|
| 1242 |
parsed_frame = parsed_frame[parsed_frame['salary'] <= max_salary]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1243 |
parsed_frame = parsed_frame[parsed_frame['Finish_percentile'] <= max_finish_percentile]
|
| 1244 |
parsed_frame = parsed_frame[parsed_frame['Lineup Edge'] >= min_lineup_edge]
|
|
|
|
|
|
|
| 1245 |
if 'Stack' in parsed_frame.columns:
|
| 1246 |
if stack_include_toggle == 'All Stacks':
|
| 1247 |
parsed_frame = parsed_frame
|
|
|
|
| 1196 |
with st.expander('Macro Filter Options'):
|
| 1197 |
# recent changes for showdown included
|
| 1198 |
with st.form(key='macro_filter_form'):
|
| 1199 |
+
macro_min_col, macro_max_col = st.columns(2)
|
| 1200 |
+
with macro_min_col:
|
| 1201 |
+
min_salary = st.number_input("Min acceptable salary?", value=0, min_value=0, step=100)
|
| 1202 |
+
min_proj = st.number_input("Min acceptable projection?", value=0.0, min_value=0.0, step=1.0)
|
| 1203 |
+
min_own = st.number_input("Min acceptable ownership?", value=0.0, min_value=0.0, step=1.0)
|
| 1204 |
+
min_dupes = st.number_input("Min acceptable dupes?", value=0, min_value=0, step=1)
|
| 1205 |
+
min_finish_percentile = st.number_input("Min acceptable finish percentile?", value=-1.00, min_value=0.00, step=.001)
|
| 1206 |
+
min_lineup_edge = st.number_input("Min acceptable Lineup Edge?", value=-1.00, min_value=-1.00, step=.001)
|
| 1207 |
+
with macro_max_col:
|
| 1208 |
+
max_salary = st.number_input("Max acceptable salary?", value=salary_max, min_value=0, step=100)
|
| 1209 |
+
max_proj = st.number_input("Max acceptable projection?", value=500.0, min_value=0.0, step=1.0)
|
| 1210 |
+
max_own = st.number_input("Max acceptable ownership?", value=500.0, min_value=0.0, step=1.0)
|
| 1211 |
+
max_dupes = st.number_input("Max acceptable dupes?", value=1000, min_value=1, step=1)
|
| 1212 |
+
max_finish_percentile = st.number_input("Max acceptable finish percentile?", value=1.00, min_value=0.00, step=.001)
|
| 1213 |
+
max_lineup_edge = st.number_input("Max acceptable Lineup Edge?", value=1.00, min_value=0.00, step=.001)
|
| 1214 |
+
|
| 1215 |
if sport_var in stacking_sports:
|
| 1216 |
stack_include_toggle = st.selectbox("Include specific stacks?", options=['All Stacks', 'Specific Stacks'], index=0)
|
| 1217 |
stack_selections = st.multiselect("If Specific Stacks, Which to include?", options=sorted(list(set(st.session_state['stack_dict'].values()))), default=[])
|
|
|
|
| 1229 |
if reg_submitted:
|
| 1230 |
st.session_state['settings_base'] = False
|
| 1231 |
parsed_frame = st.session_state['working_frame'].copy()
|
| 1232 |
+
|
| 1233 |
parsed_frame = parsed_frame[parsed_frame['salary'] >= min_salary]
|
| 1234 |
parsed_frame = parsed_frame[parsed_frame['salary'] <= max_salary]
|
| 1235 |
+
parsed_frame = parsed_frame[parsed_frame['median'] >= min_proj]
|
| 1236 |
+
parsed_frame = parsed_frame[parsed_frame['median'] <= max_proj]
|
| 1237 |
+
parsed_frame = parsed_frame[parsed_frame['Own'] >= min_own]
|
| 1238 |
+
parsed_frame = parsed_frame[parsed_frame['Own'] <= max_own]
|
| 1239 |
+
parsed_frame = parsed_frame[parsed_frame['Dupes'] >= min_dupes]
|
| 1240 |
+
parsed_frame = parsed_frame[parsed_frame['Dupes'] <= max_dupes]
|
| 1241 |
+
parsed_frame = parsed_frame[parsed_frame['Finish_percentile'] >= min_finish_percentile]
|
| 1242 |
parsed_frame = parsed_frame[parsed_frame['Finish_percentile'] <= max_finish_percentile]
|
| 1243 |
parsed_frame = parsed_frame[parsed_frame['Lineup Edge'] >= min_lineup_edge]
|
| 1244 |
+
parsed_frame = parsed_frame[parsed_frame['Lineup Edge'] <= max_lineup_edge]
|
| 1245 |
+
|
| 1246 |
+
|
| 1247 |
if 'Stack' in parsed_frame.columns:
|
| 1248 |
if stack_include_toggle == 'All Stacks':
|
| 1249 |
parsed_frame = parsed_frame
|
|
|
|
| 1258 |
if exp_submitted:
|
| 1259 |
st.session_state['settings_base'] = False
|
| 1260 |
parsed_frame = st.session_state['export_base'].copy()
|
| 1261 |
+
|
| 1262 |
parsed_frame = parsed_frame[parsed_frame['salary'] >= min_salary]
|
| 1263 |
parsed_frame = parsed_frame[parsed_frame['salary'] <= max_salary]
|
| 1264 |
+
parsed_frame = parsed_frame[parsed_frame['median'] >= min_proj]
|
| 1265 |
+
parsed_frame = parsed_frame[parsed_frame['median'] <= max_proj]
|
| 1266 |
+
parsed_frame = parsed_frame[parsed_frame['Own'] >= min_own]
|
| 1267 |
+
parsed_frame = parsed_frame[parsed_frame['Own'] <= max_own]
|
| 1268 |
+
parsed_frame = parsed_frame[parsed_frame['Dupes'] >= min_dupes]
|
| 1269 |
+
parsed_frame = parsed_frame[parsed_frame['Dupes'] <= max_dupes]
|
| 1270 |
+
parsed_frame = parsed_frame[parsed_frame['Finish_percentile'] >= min_finish_percentile]
|
| 1271 |
parsed_frame = parsed_frame[parsed_frame['Finish_percentile'] <= max_finish_percentile]
|
| 1272 |
parsed_frame = parsed_frame[parsed_frame['Lineup Edge'] >= min_lineup_edge]
|
| 1273 |
+
parsed_frame = parsed_frame[parsed_frame['Lineup Edge'] <= max_lineup_edge]
|
| 1274 |
+
|
| 1275 |
if 'Stack' in parsed_frame.columns:
|
| 1276 |
if stack_include_toggle == 'All Stacks':
|
| 1277 |
parsed_frame = parsed_frame
|