ajaykumar0712 commited on
Commit
99cc8a0
Β·
verified Β·
1 Parent(s): 26ed94f

fixing code bugs

Browse files
Files changed (1) hide show
  1. 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
- with col1:
 
 
 
 
 
 
102
  st.markdown("### πŸ“Š Statistician")
103
  st.write(stats_output)
104
-
105
- with col2:
 
 
 
106
  st.markdown("### 🧠 Strategist")
107
  st.write(strategist_output)
108
-
109
- with col3:
 
 
 
110
  st.markdown("### 🎲 Chaos Agent")
111
  st.write(chaos_output)
112
-
113
- with col4:
 
 
 
114
  st.markdown("### 🎀 Compere")
115
- # st.write(compere_output)
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([teamA, teamB])
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([teamA, teamB])
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(