Spaces:
Running
Running
James McCool
commited on
Commit
·
db04e43
1
Parent(s):
617129f
Update quick fill options in app.py to include detailed descriptions for player selection ranges. This change enhances clarity for users by specifying the player order ranges associated with each option.
Browse files
app.py
CHANGED
@@ -853,7 +853,7 @@ with tab4:
|
|
853 |
with st.expander("Quick Fill Options"):
|
854 |
auto_team_var = st.selectbox("Auto Fill Team", options=all_teams)
|
855 |
auto_size_var = st.selectbox("Auto Fill Size", options=[3, 4, 5])
|
856 |
-
auto_range_var = st.selectbox("Auto Fill Order", options=['Top', 'Mid', 'Wrap'])
|
857 |
# --- QUICK FILL LOGIC ---
|
858 |
if st.button("Quick Fill", key="quick_fill"):
|
859 |
# 1. Get all eligible players from the selected team, not already in the lineup
|
@@ -867,12 +867,12 @@ with tab4:
|
|
867 |
team_players = team_players.sort_values(by='Order')
|
868 |
|
869 |
# 3. Select the order range
|
870 |
-
if auto_range_var == 'Top':
|
871 |
selected_players = team_players[team_players['Order'] > 0].head(auto_size_var)
|
872 |
-
elif auto_range_var == 'Mid':
|
873 |
mid_start = max(0, (len(team_players[team_players['Order'] > 0]) - auto_size_var) // 2)
|
874 |
selected_players = team_players[team_players['Order'] > 0].iloc[mid_start:mid_start + auto_size_var]
|
875 |
-
elif auto_range_var == 'Wrap':
|
876 |
first_three = team_players[team_players['Order'] > 0].head(3)
|
877 |
last_two = team_players[team_players['Order'] > 0].tail(2)
|
878 |
selected_players = pd.concat([first_three, last_two])
|
|
|
853 |
with st.expander("Quick Fill Options"):
|
854 |
auto_team_var = st.selectbox("Auto Fill Team", options=all_teams)
|
855 |
auto_size_var = st.selectbox("Auto Fill Size", options=[3, 4, 5])
|
856 |
+
auto_range_var = st.selectbox("Auto Fill Order", options=['Top (1-5)', 'Mid (3-7)', 'Wrap (8-3)'])
|
857 |
# --- QUICK FILL LOGIC ---
|
858 |
if st.button("Quick Fill", key="quick_fill"):
|
859 |
# 1. Get all eligible players from the selected team, not already in the lineup
|
|
|
867 |
team_players = team_players.sort_values(by='Order')
|
868 |
|
869 |
# 3. Select the order range
|
870 |
+
if auto_range_var == 'Top (1-5)':
|
871 |
selected_players = team_players[team_players['Order'] > 0].head(auto_size_var)
|
872 |
+
elif auto_range_var == 'Mid (3-7)':
|
873 |
mid_start = max(0, (len(team_players[team_players['Order'] > 0]) - auto_size_var) // 2)
|
874 |
selected_players = team_players[team_players['Order'] > 0].iloc[mid_start:mid_start + auto_size_var]
|
875 |
+
elif auto_range_var == 'Wrap (8-3)':
|
876 |
first_three = team_players[team_players['Order'] > 0].head(3)
|
877 |
last_two = team_players[team_players['Order'] > 0].tail(2)
|
878 |
selected_players = pd.concat([first_three, last_two])
|