James McCool commited on
Commit
3587d00
·
1 Parent(s): 0926614

Refactor exposure management options to remove unnecessary uniqueness call in player selection dropdowns for improved performance and clarity.

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -2493,7 +2493,7 @@ if selected_tab == 'Manage Portfolio':
2493
 
2494
  with st.expander('Exposure Management'):
2495
  with st.form(key='Exposures'):
2496
- exposure_player = st.selectbox("Player", options=sorted(list(set(get_portfolio_names(st.session_state['working_frame']).unique()))), key='exposure_player')
2497
  exposure_target = st.number_input("Target Exposure", value=.50, min_value=0.0, max_value=1.0, step=0.01)
2498
  comp_salary_below = st.number_input("Comp Salary Below", value=-5000, min_value=-5000, max_value=0, step=100)
2499
  comp_salary_above = st.number_input("Comp Salary Above", value=5000, min_value=0, max_value=5000, step=100)
@@ -2502,7 +2502,7 @@ if selected_tab == 'Manage Portfolio':
2502
  else:
2503
  ignore_stacks = []
2504
  remove_teams_exposure = st.multiselect("Removed/Locked teams?", options=sorted(list(set(st.session_state['projections_df']['team'].unique()))), default=[])
2505
- specific_replacements = st.multiselect("Specific Replacements?", options=sorted(list(set(get_portfolio_names(st.session_state['working_frame']).unique()))), default=[])
2506
  specific_columns = st.multiselect("Specific Positions?", options=sorted(list(st.session_state['player_columns'])), default=[])
2507
  submitted_col, export_col = st.columns(2)
2508
  st.info("Portfolio Button applies to your overall Portfolio, Export button applies to your Custom Export")
 
2493
 
2494
  with st.expander('Exposure Management'):
2495
  with st.form(key='Exposures'):
2496
+ exposure_player = st.selectbox("Player", options=sorted(list(set(get_portfolio_names(st.session_state['working_frame'])))), key='exposure_player')
2497
  exposure_target = st.number_input("Target Exposure", value=.50, min_value=0.0, max_value=1.0, step=0.01)
2498
  comp_salary_below = st.number_input("Comp Salary Below", value=-5000, min_value=-5000, max_value=0, step=100)
2499
  comp_salary_above = st.number_input("Comp Salary Above", value=5000, min_value=0, max_value=5000, step=100)
 
2502
  else:
2503
  ignore_stacks = []
2504
  remove_teams_exposure = st.multiselect("Removed/Locked teams?", options=sorted(list(set(st.session_state['projections_df']['team'].unique()))), default=[])
2505
+ specific_replacements = st.multiselect("Specific Replacements?", options=sorted(list(set(get_portfolio_names(st.session_state['working_frame'])))), default=[])
2506
  specific_columns = st.multiselect("Specific Positions?", options=sorted(list(st.session_state['player_columns'])), default=[])
2507
  submitted_col, export_col = st.columns(2)
2508
  st.info("Portfolio Button applies to your overall Portfolio, Export button applies to your Custom Export")