Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -93,10 +93,10 @@ def calculate_FD_value_frequencies(np_array):
|
|
93 |
return combined_array
|
94 |
|
95 |
@st.cache_data
|
96 |
-
def sim_contest(Sim_size, seed_frame, maps_dict):
|
97 |
SimVar = 1
|
98 |
Sim_Winners = []
|
99 |
-
fp_array = seed_frame
|
100 |
|
101 |
# Pre-vectorize functions
|
102 |
vec_projection_map = np.vectorize(maps_dict['Projection_map'].__getitem__)
|
@@ -105,7 +105,7 @@ def sim_contest(Sim_size, seed_frame, maps_dict):
|
|
105 |
st.write('Simulating contest on frames')
|
106 |
|
107 |
while SimVar <= Sim_size:
|
108 |
-
fp_random = fp_array[np.random.choice(fp_array.shape[0],
|
109 |
|
110 |
sample_arrays1 = np.c_[
|
111 |
fp_random,
|
@@ -234,13 +234,13 @@ with tab2:
|
|
234 |
Contest_Size = 10000
|
235 |
elif contest_var1 == 'Massive':
|
236 |
Contest_Size = 100000
|
237 |
-
strength_var1 = st.selectbox("How sharp is the field in the contest?", ('
|
238 |
if strength_var1 == 'Not Very':
|
239 |
-
sharp_split =
|
240 |
elif strength_var1 == 'Average':
|
241 |
-
sharp_split =
|
242 |
elif strength_var1 == 'Very':
|
243 |
-
sharp_split =
|
244 |
|
245 |
|
246 |
with col2:
|
@@ -302,7 +302,7 @@ with tab2:
|
|
302 |
'STDev_map':dict(zip(raw_baselines.Player,raw_baselines.STDev)),
|
303 |
'team_check_map':dict(zip(raw_baselines.Player,raw_baselines.Team))
|
304 |
}
|
305 |
-
Sim_Winners = sim_contest(
|
306 |
Sim_Winner_Frame = pd.DataFrame(np.concatenate(Sim_Winners))
|
307 |
|
308 |
#st.table(Sim_Winner_Frame)
|
|
|
93 |
return combined_array
|
94 |
|
95 |
@st.cache_data
|
96 |
+
def sim_contest(Sim_size, seed_frame, maps_dict, sharp_split, Contest_Size):
|
97 |
SimVar = 1
|
98 |
Sim_Winners = []
|
99 |
+
fp_array = seed_frame[:sharp_split, :]
|
100 |
|
101 |
# Pre-vectorize functions
|
102 |
vec_projection_map = np.vectorize(maps_dict['Projection_map'].__getitem__)
|
|
|
105 |
st.write('Simulating contest on frames')
|
106 |
|
107 |
while SimVar <= Sim_size:
|
108 |
+
fp_random = fp_array[np.random.choice(fp_array.shape[0], Contest_Size)]
|
109 |
|
110 |
sample_arrays1 = np.c_[
|
111 |
fp_random,
|
|
|
234 |
Contest_Size = 10000
|
235 |
elif contest_var1 == 'Massive':
|
236 |
Contest_Size = 100000
|
237 |
+
strength_var1 = st.selectbox("How sharp is the field in the contest?", ('Very', 'Average', 'Not Very'))
|
238 |
if strength_var1 == 'Not Very':
|
239 |
+
sharp_split = 500000
|
240 |
elif strength_var1 == 'Average':
|
241 |
+
sharp_split = 250000
|
242 |
elif strength_var1 == 'Very':
|
243 |
+
sharp_split = 100000
|
244 |
|
245 |
|
246 |
with col2:
|
|
|
302 |
'STDev_map':dict(zip(raw_baselines.Player,raw_baselines.STDev)),
|
303 |
'team_check_map':dict(zip(raw_baselines.Player,raw_baselines.Team))
|
304 |
}
|
305 |
+
Sim_Winners = sim_contest(1000, st.session_state.working_seed, maps_dict, sharp_split, Contest_Size)
|
306 |
Sim_Winner_Frame = pd.DataFrame(np.concatenate(Sim_Winners))
|
307 |
|
308 |
#st.table(Sim_Winner_Frame)
|