James McCool
commited on
Commit
·
547e62e
1
Parent(s):
fe3dc6e
adding a base setting button
Browse files
app.py
CHANGED
|
@@ -1071,6 +1071,8 @@ def create_position_export_dict(column_name, csv_file, site_var, type_var, sport
|
|
| 1071 |
def parse_portfolio_on_mapped(portfolio, map_dict, map_key, filter_keys_pos, filter_keys_team, low_threshold, high_threshold, column_choices):
|
| 1072 |
mapping_port = portfolio[column_choices]
|
| 1073 |
mapping_port = mapping_port.map(map_dict[map_key])
|
|
|
|
|
|
|
| 1074 |
|
| 1075 |
if map_key not in ['team_map', 'pos_map']:
|
| 1076 |
# Numerical mapping - filter by thresholds
|
|
@@ -1741,7 +1743,7 @@ if selected_tab == 'Data Load':
|
|
| 1741 |
if selected_tab == 'Manage Portfolio':
|
| 1742 |
if 'origin_portfolio' in st.session_state and 'projections_df' in st.session_state:
|
| 1743 |
with st.container():
|
| 1744 |
-
reset_port_col, recalc_div_col, blank_reset_col, contest_size_col = st.columns([1, 1, 6, 4])
|
| 1745 |
with reset_port_col:
|
| 1746 |
if st.button('Reset Portfolio', key='reset_port'):
|
| 1747 |
st.session_state['settings_base'] = True
|
|
@@ -1749,6 +1751,9 @@ if selected_tab == 'Manage Portfolio':
|
|
| 1749 |
with recalc_div_col:
|
| 1750 |
if st.button("Recalculate Diversity"):
|
| 1751 |
st.session_state['display_frame']['Diversity'] = recalc_diversity(st.session_state['display_frame'], st.session_state['player_columns'])
|
|
|
|
|
|
|
|
|
|
| 1752 |
|
| 1753 |
with contest_size_col:
|
| 1754 |
with st.form(key='contest_size_form'):
|
|
|
|
| 1071 |
def parse_portfolio_on_mapped(portfolio, map_dict, map_key, filter_keys_pos, filter_keys_team, low_threshold, high_threshold, column_choices):
|
| 1072 |
mapping_port = portfolio[column_choices]
|
| 1073 |
mapping_port = mapping_port.map(map_dict[map_key])
|
| 1074 |
+
if column_choices == 'CPT':
|
| 1075 |
+
mapping_port = mapping_port * 1.5
|
| 1076 |
|
| 1077 |
if map_key not in ['team_map', 'pos_map']:
|
| 1078 |
# Numerical mapping - filter by thresholds
|
|
|
|
| 1743 |
if selected_tab == 'Manage Portfolio':
|
| 1744 |
if 'origin_portfolio' in st.session_state and 'projections_df' in st.session_state:
|
| 1745 |
with st.container():
|
| 1746 |
+
reset_port_col, recalc_div_col, set_base_col, blank_reset_col, contest_size_col = st.columns([1, 1, 1, 6, 4])
|
| 1747 |
with reset_port_col:
|
| 1748 |
if st.button('Reset Portfolio', key='reset_port'):
|
| 1749 |
st.session_state['settings_base'] = True
|
|
|
|
| 1751 |
with recalc_div_col:
|
| 1752 |
if st.button("Recalculate Diversity"):
|
| 1753 |
st.session_state['display_frame']['Diversity'] = recalc_diversity(st.session_state['display_frame'], st.session_state['player_columns'])
|
| 1754 |
+
with set_base_col:
|
| 1755 |
+
if st.button("Set New Base"):
|
| 1756 |
+
st.session_state['base_frame'] = st.session_state['working_frame']
|
| 1757 |
|
| 1758 |
with contest_size_col:
|
| 1759 |
with st.form(key='contest_size_form'):
|