Spaces:
Sleeping
Sleeping
fixing code bugs
Browse files- src/streamlit_app.py +35 -15
src/streamlit_app.py
CHANGED
|
@@ -5,7 +5,7 @@ import plotly.express as px
|
|
| 5 |
|
| 6 |
from agents import run_agents
|
| 7 |
from probability_engine import elo_probability
|
| 8 |
-
|
| 9 |
|
| 10 |
# =========================
|
| 11 |
# LOAD DATA
|
|
@@ -74,8 +74,8 @@ with left:
|
|
| 74 |
probA = probs["probA"]
|
| 75 |
probB = probs["probB"]
|
| 76 |
|
| 77 |
-
st.write("### Panel Verdict")
|
| 78 |
-
st.write(compere_output)
|
| 79 |
|
| 80 |
|
| 81 |
# =========================
|
|
@@ -97,23 +97,37 @@ with right:
|
|
| 97 |
|
| 98 |
col1, col2 = st.columns(2)
|
| 99 |
col3, col4 = st.columns(2)
|
| 100 |
-
|
| 101 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 102 |
st.markdown("### π Statistician")
|
| 103 |
st.write(stats_output)
|
| 104 |
-
|
| 105 |
-
|
|
|
|
|
|
|
|
|
|
| 106 |
st.markdown("### π§ Strategist")
|
| 107 |
st.write(strategist_output)
|
| 108 |
-
|
| 109 |
-
|
|
|
|
|
|
|
|
|
|
| 110 |
st.markdown("### π² Chaos Agent")
|
| 111 |
st.write(chaos_output)
|
| 112 |
-
|
| 113 |
-
|
|
|
|
|
|
|
|
|
|
| 114 |
st.markdown("### π€ Compere")
|
| 115 |
-
|
| 116 |
-
|
| 117 |
|
| 118 |
# =========================
|
| 119 |
# TAB 2 : INSIGHTS
|
|
@@ -151,8 +165,11 @@ with right:
|
|
| 151 |
|
| 152 |
st.subheader("Batting Comparison")
|
| 153 |
|
|
|
|
|
|
|
|
|
|
| 154 |
team_batters = batters[
|
| 155 |
-
batters["team"].isin([
|
| 156 |
]
|
| 157 |
|
| 158 |
fig2 = px.bar(
|
|
@@ -172,8 +189,11 @@ with right:
|
|
| 172 |
|
| 173 |
st.subheader("Bowling Comparison")
|
| 174 |
|
|
|
|
|
|
|
|
|
|
| 175 |
team_bowlers = bowlers[
|
| 176 |
-
bowlers["team"].isin([
|
| 177 |
]
|
| 178 |
|
| 179 |
fig3 = px.bar(
|
|
|
|
| 5 |
|
| 6 |
from agents import run_agents
|
| 7 |
from probability_engine import elo_probability
|
| 8 |
+
from data_loader import teams, team_map
|
| 9 |
|
| 10 |
# =========================
|
| 11 |
# LOAD DATA
|
|
|
|
| 74 |
probA = probs["probA"]
|
| 75 |
probB = probs["probB"]
|
| 76 |
|
| 77 |
+
# st.write("### Panel Verdict")
|
| 78 |
+
# st.write(compere_output)
|
| 79 |
|
| 80 |
|
| 81 |
# =========================
|
|
|
|
| 97 |
|
| 98 |
col1, col2 = st.columns(2)
|
| 99 |
col3, col4 = st.columns(2)
|
| 100 |
+
|
| 101 |
+
stat_placeholder = col1.empty()
|
| 102 |
+
strat_placeholder = col2.empty()
|
| 103 |
+
chaos_placeholder = col3.empty()
|
| 104 |
+
compere_placeholder = col4.empty()
|
| 105 |
+
|
| 106 |
+
# Statistician appears first
|
| 107 |
+
with stat_placeholder.container():
|
| 108 |
st.markdown("### π Statistician")
|
| 109 |
st.write(stats_output)
|
| 110 |
+
|
| 111 |
+
time.sleep(3)
|
| 112 |
+
|
| 113 |
+
# Strategist next
|
| 114 |
+
with strat_placeholder.container():
|
| 115 |
st.markdown("### π§ Strategist")
|
| 116 |
st.write(strategist_output)
|
| 117 |
+
|
| 118 |
+
time.sleep(3)
|
| 119 |
+
|
| 120 |
+
# Chaos agent
|
| 121 |
+
with chaos_placeholder.container():
|
| 122 |
st.markdown("### π² Chaos Agent")
|
| 123 |
st.write(chaos_output)
|
| 124 |
+
|
| 125 |
+
time.sleep(3)
|
| 126 |
+
|
| 127 |
+
# Compere final summary
|
| 128 |
+
with compere_placeholder.container():
|
| 129 |
st.markdown("### π€ Compere")
|
| 130 |
+
st.write(compere_output)
|
|
|
|
| 131 |
|
| 132 |
# =========================
|
| 133 |
# TAB 2 : INSIGHTS
|
|
|
|
| 165 |
|
| 166 |
st.subheader("Batting Comparison")
|
| 167 |
|
| 168 |
+
teamA_bat = team_map.get(teamA.upper(), teamA.upper())
|
| 169 |
+
teamB_bat = team_map.get(teamB.upper(), teamB.upper())
|
| 170 |
+
|
| 171 |
team_batters = batters[
|
| 172 |
+
batters["team"].isin([teamA_bat, teamB_bat])
|
| 173 |
]
|
| 174 |
|
| 175 |
fig2 = px.bar(
|
|
|
|
| 189 |
|
| 190 |
st.subheader("Bowling Comparison")
|
| 191 |
|
| 192 |
+
teamA_bowl = team_map.get(teamA.upper(), teamA.upper())
|
| 193 |
+
teamB_bowl = team_map.get(teamB.upper(), teamB.upper())
|
| 194 |
+
|
| 195 |
team_bowlers = bowlers[
|
| 196 |
+
bowlers["team"].isin([teamA_bowl, teamB_bowl])
|
| 197 |
]
|
| 198 |
|
| 199 |
fig3 = px.bar(
|