Spaces:
Running
Running
James McCool
commited on
Commit
·
94f8ddd
1
Parent(s):
575b2cb
Refactor UI layout in app.py to enhance user experience. Updated the selection interface for teams, opponents, win/loss options, and prediction settings by organizing them into two-column layouts. This change improves the visual structure and accessibility of input fields, facilitating a more intuitive interaction for users when making predictions.
Browse files
app.py
CHANGED
|
@@ -59,49 +59,53 @@ with st.sidebar:
|
|
| 59 |
max_value=max_date.date()
|
| 60 |
)
|
| 61 |
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
|
|
|
|
|
|
| 73 |
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
|
| 88 |
if game_settings == "Average":
|
| 89 |
kill_prediction = 0
|
| 90 |
death_prediction = 0
|
| 91 |
else:
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
|
|
|
|
|
|
| 105 |
|
| 106 |
@st.cache_data(ttl = 60)
|
| 107 |
def simulate_stats(row, num_sims=1000):
|
|
|
|
| 59 |
max_value=max_date.date()
|
| 60 |
)
|
| 61 |
|
| 62 |
+
col1, col2 = st.columns(2)
|
| 63 |
+
with col1:
|
| 64 |
+
selected_team = st.selectbox(
|
| 65 |
+
"Select Team",
|
| 66 |
+
options=team_names,
|
| 67 |
+
index=team_names.index("T1") if "T1" in team_names else 0
|
| 68 |
+
)
|
| 69 |
+
with col2:
|
| 70 |
+
selected_opponent = st.selectbox(
|
| 71 |
+
"Select Opponent",
|
| 72 |
+
options=team_names,
|
| 73 |
+
index=team_names.index("T1") if "T1" in team_names else 0
|
| 74 |
+
)
|
| 75 |
|
| 76 |
+
col1, col2 = st.columns(2)
|
| 77 |
+
with col1:
|
| 78 |
+
win_loss = st.selectbox(
|
| 79 |
+
"Select Win/Loss",
|
| 80 |
+
options=["Win", "Loss"],
|
| 81 |
+
index=0
|
| 82 |
+
)
|
| 83 |
+
with col2:
|
| 84 |
+
game_settings = st.selectbox(
|
| 85 |
+
"Predict kills/deaths or use average?",
|
| 86 |
+
options=["Average", "Predict"],
|
| 87 |
+
index=0
|
| 88 |
+
)
|
| 89 |
|
| 90 |
if game_settings == "Average":
|
| 91 |
kill_prediction = 0
|
| 92 |
death_prediction = 0
|
| 93 |
else:
|
| 94 |
+
col1, col2 = st.columns(2)
|
| 95 |
+
with col1:
|
| 96 |
+
kill_prediction = st.number_input(
|
| 97 |
+
"Predicted Team Kills",
|
| 98 |
+
min_value=1,
|
| 99 |
+
max_value=100,
|
| 100 |
+
value=20
|
| 101 |
+
)
|
| 102 |
+
with col2:
|
| 103 |
+
death_prediction = st.number_input(
|
| 104 |
+
"Predicted Team Deaths",
|
| 105 |
+
min_value=1,
|
| 106 |
+
max_value=100,
|
| 107 |
+
value=5
|
| 108 |
+
)
|
| 109 |
|
| 110 |
@st.cache_data(ttl = 60)
|
| 111 |
def simulate_stats(row, num_sims=1000):
|