Multichem commited on
Commit
49ee82c
·
verified ·
1 Parent(s): d901c93

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +34 -5
app.py CHANGED
@@ -65,7 +65,19 @@ def init_DK_seed_frames():
65
  DK_seed = raw_display.to_numpy()
66
 
67
  return DK_seed
 
 
 
 
 
 
 
 
 
 
68
 
 
 
69
  @st.cache_data(ttl = 599)
70
  def init_FD_seed_frames():
71
 
@@ -77,6 +89,18 @@ def init_FD_seed_frames():
77
  FD_seed = raw_display.to_numpy()
78
 
79
  return FD_seed
 
 
 
 
 
 
 
 
 
 
 
 
80
 
81
  @st.cache_data(ttl = 599)
82
  def init_baselines():
@@ -154,8 +178,6 @@ def sim_contest(Sim_size, seed_frame, maps_dict, sharp_split, Contest_Size):
154
 
155
  return Sim_Winners
156
 
157
- DK_seed = init_DK_seed_frames()
158
- FD_seed = init_FD_seed_frames()
159
  dk_raw, fd_raw = init_baselines()
160
 
161
  tab1, tab2 = st.tabs(['Contest Sims', 'Data Export'])
@@ -166,13 +188,16 @@ with tab2:
166
  st.cache_data.clear()
167
  for key in st.session_state.keys():
168
  del st.session_state[key]
169
- DK_seed = init_DK_seed_frames()
170
- FD_seed = init_FD_seed_frames()
171
  dk_raw, fd_raw = init_baselines()
172
 
173
- slate_var1 = st.radio("Which data are you loading?", ('Showdown', 'Other Showdown'))
 
174
  site_var1 = st.radio("What site are you working with?", ('Draftkings', 'Fanduel'))
175
  if site_var1 == 'Draftkings':
 
 
 
 
176
  raw_baselines = dk_raw
177
  column_names = dk_columns
178
 
@@ -189,6 +214,10 @@ with tab2:
189
  stack_var2 = [5, 4, 3, 2, 1, 0]
190
 
191
  elif site_var1 == 'Fanduel':
 
 
 
 
192
  raw_baselines = fd_raw
193
  column_names = fd_columns
194
 
 
65
  DK_seed = raw_display.to_numpy()
66
 
67
  return DK_seed
68
+
69
+ @st.cache_data(ttl = 599)
70
+ def init_DK_secondary_seed_frames():
71
+
72
+ collection = db["DK_NFL_Secondary_SD_seed_frame"]
73
+ cursor = collection.find()
74
+
75
+ raw_display = pd.DataFrame(list(cursor))
76
+ raw_display = raw_display[['CPT', 'FLEX1', 'FLEX2', 'FLEX3', 'FLEX4', 'FLEX5', 'salary', 'proj', 'Team', 'Team_count', 'Secondary', 'Secondary_count', 'Own']]
77
+ DK_second_seed = raw_display.to_numpy()
78
 
79
+ return DK_second_seed
80
+
81
  @st.cache_data(ttl = 599)
82
  def init_FD_seed_frames():
83
 
 
89
  FD_seed = raw_display.to_numpy()
90
 
91
  return FD_seed
92
+
93
+ @st.cache_data(ttl = 599)
94
+ def init_FD_secondary_seed_frames():
95
+
96
+ collection = db["FD_NFL_Secondary_SD_seed_frame"]
97
+ cursor = collection.find()
98
+
99
+ raw_display = pd.DataFrame(list(cursor))
100
+ raw_display = raw_display[['CPT', 'FLEX1', 'FLEX2', 'FLEX3', 'FLEX4', 'salary', 'proj', 'Team', 'Team_count', 'Secondary', 'Secondary_count', 'Own']]
101
+ FD_second_seed = raw_display.to_numpy()
102
+
103
+ return FD_second_seed
104
 
105
  @st.cache_data(ttl = 599)
106
  def init_baselines():
 
178
 
179
  return Sim_Winners
180
 
 
 
181
  dk_raw, fd_raw = init_baselines()
182
 
183
  tab1, tab2 = st.tabs(['Contest Sims', 'Data Export'])
 
188
  st.cache_data.clear()
189
  for key in st.session_state.keys():
190
  del st.session_state[key]
 
 
191
  dk_raw, fd_raw = init_baselines()
192
 
193
+ slate_var1 = st.radio("Which data are you loading?", ('Showdown', 'Secondary Showdown'))
194
+
195
  site_var1 = st.radio("What site are you working with?", ('Draftkings', 'Fanduel'))
196
  if site_var1 == 'Draftkings':
197
+ if slate_var1 == 'Showdown':
198
+ DK_seed = init_DK_seed_frames()
199
+ elif slate_var1 == 'Secondary Showdown':
200
+ DK_seed = init_DK_secondary_seed_frames()
201
  raw_baselines = dk_raw
202
  column_names = dk_columns
203
 
 
214
  stack_var2 = [5, 4, 3, 2, 1, 0]
215
 
216
  elif site_var1 == 'Fanduel':
217
+ if slate_var1 == 'Showdown':
218
+ FD_seed = init_FD_seed_frames()
219
+ elif slate_var1 == 'Secondary Showdown':
220
+ FD_seed = init_FD_secondary_seed_frames()
221
  raw_baselines = fd_raw
222
  column_names = fd_columns
223