James McCool
commited on
Commit
·
857d91c
1
Parent(s):
74f9c17
Enhance trimming functionality in app.py: introduce a trimming dictionary to streamline the retrieval of maximum values for performance and ownership types, improving the accuracy of threshold inputs in the portfolio management process.
Browse files
app.py
CHANGED
|
@@ -881,6 +881,13 @@ with tab2:
|
|
| 881 |
sum(map_dict['own_map'].get(player, 0) for player in row.iloc[1:]),
|
| 882 |
axis=1
|
| 883 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 884 |
col1, col2 = st.columns([2, 8])
|
| 885 |
with col1:
|
| 886 |
with st.expander('Macro Filter Options'):
|
|
@@ -923,14 +930,14 @@ with tab2:
|
|
| 923 |
with min_sort:
|
| 924 |
performance_threshold_low = st.number_input("Min", value=0.0, min_value=0.0, step=1.0, key='min_sort')
|
| 925 |
with max_sort:
|
| 926 |
-
performance_threshold_high = st.number_input("Max", value=
|
| 927 |
|
| 928 |
st.write("Trimming threshold range:")
|
| 929 |
min_trim, max_trim = st.columns(2)
|
| 930 |
with min_trim:
|
| 931 |
own_threshold_low = st.number_input("Min", value=0.0, min_value=0.0, step=1.0, key='min_trim')
|
| 932 |
with max_trim:
|
| 933 |
-
own_threshold_high = st.number_input("Max", value=
|
| 934 |
|
| 935 |
submitted = st.form_submit_button("Trim")
|
| 936 |
if submitted:
|
|
|
|
| 881 |
sum(map_dict['own_map'].get(player, 0) for player in row.iloc[1:]),
|
| 882 |
axis=1
|
| 883 |
)
|
| 884 |
+
trimming_dict_maxes = {
|
| 885 |
+
'Own': st.session_state['portfolio']['Own'].max(),
|
| 886 |
+
'Geomean': st.session_state['portfolio']['Geomean'].max(),
|
| 887 |
+
'Weighted Own': st.session_state['portfolio']['Weighted Own'].max(),
|
| 888 |
+
'median': st.session_state['portfolio']['median'].max(),
|
| 889 |
+
'Finish_percentile': st.session_state['portfolio']['Finish_percentile'].max()
|
| 890 |
+
}
|
| 891 |
col1, col2 = st.columns([2, 8])
|
| 892 |
with col1:
|
| 893 |
with st.expander('Macro Filter Options'):
|
|
|
|
| 930 |
with min_sort:
|
| 931 |
performance_threshold_low = st.number_input("Min", value=0.0, min_value=0.0, step=1.0, key='min_sort')
|
| 932 |
with max_sort:
|
| 933 |
+
performance_threshold_high = st.number_input("Max", value=trimming_dict_maxes[performance_type], min_value=0.0, step=1.0, key='max_sort')
|
| 934 |
|
| 935 |
st.write("Trimming threshold range:")
|
| 936 |
min_trim, max_trim = st.columns(2)
|
| 937 |
with min_trim:
|
| 938 |
own_threshold_low = st.number_input("Min", value=0.0, min_value=0.0, step=1.0, key='min_trim')
|
| 939 |
with max_trim:
|
| 940 |
+
own_threshold_high = st.number_input("Max", value=trimming_dict_maxes[own_type], min_value=0.0, step=1.0, key='max_trim')
|
| 941 |
|
| 942 |
submitted = st.form_submit_button("Trim")
|
| 943 |
if submitted:
|