James McCool
commited on
Commit
·
b6016b0
1
Parent(s):
e24202d
Refactor database collection names in Streamlit app for consistency across slate types, updating references for 'Late', 'Secondary', and 'Auxiliary' slates in both DK and FD lineups.
Browse files- src/streamlit_app.py +10 -10
src/streamlit_app.py
CHANGED
|
@@ -202,12 +202,12 @@ def init_DK_lineups(type_var, slate_var):
|
|
| 202 |
# Map names
|
| 203 |
raw_display[dict_columns] = raw_display[dict_columns].apply(lambda x: x.map(names_dict))
|
| 204 |
elif slate_var == 'Auxiliary':
|
| 205 |
-
collection = db['
|
| 206 |
cursor = collection.find()
|
| 207 |
raw_data = pd.DataFrame(list(cursor))
|
| 208 |
names_dict = dict(zip(raw_data['key'], raw_data['value']))
|
| 209 |
|
| 210 |
-
collection = db['
|
| 211 |
cursor = collection.find().limit(10000)
|
| 212 |
|
| 213 |
raw_display = pd.DataFrame(list(cursor))
|
|
@@ -217,19 +217,19 @@ def init_DK_lineups(type_var, slate_var):
|
|
| 217 |
raw_display[dict_columns] = raw_display[dict_columns].apply(lambda x: x.map(names_dict))
|
| 218 |
elif type_var == 'Showdown':
|
| 219 |
if slate_var == 'Main':
|
| 220 |
-
collection = db['
|
| 221 |
cursor = collection.find().limit(10000)
|
| 222 |
|
| 223 |
raw_display = pd.DataFrame(list(cursor))
|
| 224 |
raw_display = raw_display[['CPT', 'FLEX1', 'FLEX2', 'FLEX3', 'FLEX4', 'FLEX5', 'salary', 'proj', 'Team', 'Team_count', 'Secondary', 'Secondary_count', 'Own']]
|
| 225 |
elif slate_var == 'Secondary':
|
| 226 |
-
collection = db['
|
| 227 |
cursor = collection.find().limit(10000)
|
| 228 |
|
| 229 |
raw_display = pd.DataFrame(list(cursor))
|
| 230 |
raw_display = raw_display[['CPT', 'FLEX1', 'FLEX2', 'FLEX3', 'FLEX4', 'FLEX5', 'salary', 'proj', 'Team', 'Team_count', 'Secondary', 'Secondary_count', 'Own']]
|
| 231 |
elif slate_var == 'Auxiliary':
|
| 232 |
-
collection = db['
|
| 233 |
cursor = collection.find().limit(10000)
|
| 234 |
|
| 235 |
raw_display = pd.DataFrame(list(cursor))
|
|
@@ -272,12 +272,12 @@ def init_FD_lineups(type_var, slate_var):
|
|
| 272 |
# Map names
|
| 273 |
raw_display[dict_columns] = raw_display[dict_columns].apply(lambda x: x.map(names_dict))
|
| 274 |
elif slate_var == 'Auxiliary':
|
| 275 |
-
collection = db['
|
| 276 |
cursor = collection.find()
|
| 277 |
raw_data = pd.DataFrame(list(cursor))
|
| 278 |
names_dict = dict(zip(raw_data['key'], raw_data['value']))
|
| 279 |
|
| 280 |
-
collection = db['
|
| 281 |
cursor = collection.find().limit(10000)
|
| 282 |
|
| 283 |
raw_display = pd.DataFrame(list(cursor))
|
|
@@ -288,19 +288,19 @@ def init_FD_lineups(type_var, slate_var):
|
|
| 288 |
|
| 289 |
elif type_var == 'Showdown':
|
| 290 |
if slate_var == 'Main':
|
| 291 |
-
collection = db['
|
| 292 |
cursor = collection.find().limit(10000)
|
| 293 |
|
| 294 |
raw_display = pd.DataFrame(list(cursor))
|
| 295 |
raw_display = raw_display[['CPT', 'FLEX1', 'FLEX2', 'FLEX3', 'FLEX4', 'FLEX5', 'salary', 'proj', 'Team', 'Team_count', 'Secondary', 'Secondary_count', 'Own']]
|
| 296 |
elif slate_var == 'Secondary':
|
| 297 |
-
collection = db['
|
| 298 |
cursor = collection.find().limit(10000)
|
| 299 |
|
| 300 |
raw_display = pd.DataFrame(list(cursor))
|
| 301 |
raw_display = raw_display[['CPT', 'FLEX1', 'FLEX2', 'FLEX3', 'FLEX4', 'FLEX5', 'salary', 'proj', 'Team', 'Team_count', 'Secondary', 'Secondary_count', 'Own']]
|
| 302 |
elif slate_var == 'Auxiliary':
|
| 303 |
-
collection = db['
|
| 304 |
cursor = collection.find().limit(10000)
|
| 305 |
|
| 306 |
raw_display = pd.DataFrame(list(cursor))
|
|
|
|
| 202 |
# Map names
|
| 203 |
raw_display[dict_columns] = raw_display[dict_columns].apply(lambda x: x.map(names_dict))
|
| 204 |
elif slate_var == 'Auxiliary':
|
| 205 |
+
collection = db['DK_NFL_Late_name_map']
|
| 206 |
cursor = collection.find()
|
| 207 |
raw_data = pd.DataFrame(list(cursor))
|
| 208 |
names_dict = dict(zip(raw_data['key'], raw_data['value']))
|
| 209 |
|
| 210 |
+
collection = db['DK_NFL_Late_seed_frame']
|
| 211 |
cursor = collection.find().limit(10000)
|
| 212 |
|
| 213 |
raw_display = pd.DataFrame(list(cursor))
|
|
|
|
| 217 |
raw_display[dict_columns] = raw_display[dict_columns].apply(lambda x: x.map(names_dict))
|
| 218 |
elif type_var == 'Showdown':
|
| 219 |
if slate_var == 'Main':
|
| 220 |
+
collection = db['DK_NFL_SD_seed_frame']
|
| 221 |
cursor = collection.find().limit(10000)
|
| 222 |
|
| 223 |
raw_display = pd.DataFrame(list(cursor))
|
| 224 |
raw_display = raw_display[['CPT', 'FLEX1', 'FLEX2', 'FLEX3', 'FLEX4', 'FLEX5', 'salary', 'proj', 'Team', 'Team_count', 'Secondary', 'Secondary_count', 'Own']]
|
| 225 |
elif slate_var == 'Secondary':
|
| 226 |
+
collection = db['DK_NFL_Secondary_SD_seed_frame']
|
| 227 |
cursor = collection.find().limit(10000)
|
| 228 |
|
| 229 |
raw_display = pd.DataFrame(list(cursor))
|
| 230 |
raw_display = raw_display[['CPT', 'FLEX1', 'FLEX2', 'FLEX3', 'FLEX4', 'FLEX5', 'salary', 'proj', 'Team', 'Team_count', 'Secondary', 'Secondary_count', 'Own']]
|
| 231 |
elif slate_var == 'Auxiliary':
|
| 232 |
+
collection = db['DK_NFL_Auxiliary_SD_seed_frame']
|
| 233 |
cursor = collection.find().limit(10000)
|
| 234 |
|
| 235 |
raw_display = pd.DataFrame(list(cursor))
|
|
|
|
| 272 |
# Map names
|
| 273 |
raw_display[dict_columns] = raw_display[dict_columns].apply(lambda x: x.map(names_dict))
|
| 274 |
elif slate_var == 'Auxiliary':
|
| 275 |
+
collection = db['FD_NFL_Late_name_map']
|
| 276 |
cursor = collection.find()
|
| 277 |
raw_data = pd.DataFrame(list(cursor))
|
| 278 |
names_dict = dict(zip(raw_data['key'], raw_data['value']))
|
| 279 |
|
| 280 |
+
collection = db['FD_NFL_Late_seed_frame']
|
| 281 |
cursor = collection.find().limit(10000)
|
| 282 |
|
| 283 |
raw_display = pd.DataFrame(list(cursor))
|
|
|
|
| 288 |
|
| 289 |
elif type_var == 'Showdown':
|
| 290 |
if slate_var == 'Main':
|
| 291 |
+
collection = db['FD_NFL_SD_seed_frame']
|
| 292 |
cursor = collection.find().limit(10000)
|
| 293 |
|
| 294 |
raw_display = pd.DataFrame(list(cursor))
|
| 295 |
raw_display = raw_display[['CPT', 'FLEX1', 'FLEX2', 'FLEX3', 'FLEX4', 'FLEX5', 'salary', 'proj', 'Team', 'Team_count', 'Secondary', 'Secondary_count', 'Own']]
|
| 296 |
elif slate_var == 'Secondary':
|
| 297 |
+
collection = db['FD_NFL_Secondary_SD_seed_frame']
|
| 298 |
cursor = collection.find().limit(10000)
|
| 299 |
|
| 300 |
raw_display = pd.DataFrame(list(cursor))
|
| 301 |
raw_display = raw_display[['CPT', 'FLEX1', 'FLEX2', 'FLEX3', 'FLEX4', 'FLEX5', 'salary', 'proj', 'Team', 'Team_count', 'Secondary', 'Secondary_count', 'Own']]
|
| 302 |
elif slate_var == 'Auxiliary':
|
| 303 |
+
collection = db['FD_NFL_Auxiliary_SD_seed_frame']
|
| 304 |
cursor = collection.find().limit(10000)
|
| 305 |
|
| 306 |
raw_display = pd.DataFrame(list(cursor))
|