Update app.py
Browse files
app.py
CHANGED
|
@@ -11,11 +11,13 @@ def init_conn():
|
|
| 11 |
|
| 12 |
uri = st.secrets['mongo_uri']
|
| 13 |
client = pymongo.MongoClient(uri, retryWrites=True, serverSelectionTimeoutMS=500000)
|
| 14 |
-
|
| 15 |
|
| 16 |
-
|
|
|
|
|
|
|
| 17 |
|
| 18 |
-
|
| 19 |
|
| 20 |
percentages_format = {'Exposure': '{:.2%}'}
|
| 21 |
freq_format = {'Exposure': '{:.2%}', 'Proj Own': '{:.2%}', 'Edge': '{:.2%}'}
|
|
@@ -27,11 +29,11 @@ fd_columns = ['CPT', 'TOP', 'JNG', 'MID', 'ADC', 'SUP', 'TEAM', 'salary', 'proj'
|
|
| 27 |
def init_DK_seed_frames(league):
|
| 28 |
|
| 29 |
if league == 'LCK':
|
| 30 |
-
collection =
|
| 31 |
elif league =='LEC':
|
| 32 |
-
collection =
|
| 33 |
elif league =='LTA':
|
| 34 |
-
collection =
|
| 35 |
cursor = collection.find()
|
| 36 |
|
| 37 |
raw_display = pd.DataFrame(list(cursor))
|
|
@@ -43,7 +45,7 @@ def init_DK_seed_frames(league):
|
|
| 43 |
@st.cache_data(ttl = 599)
|
| 44 |
def init_baselines():
|
| 45 |
|
| 46 |
-
collection =
|
| 47 |
cursor = collection.find()
|
| 48 |
|
| 49 |
raw_display = pd.DataFrame(list(cursor))
|
|
|
|
| 11 |
|
| 12 |
uri = st.secrets['mongo_uri']
|
| 13 |
client = pymongo.MongoClient(uri, retryWrites=True, serverSelectionTimeoutMS=500000)
|
| 14 |
+
sims_db = client["League_of_Legends"]
|
| 15 |
|
| 16 |
+
projections_db = client["League_of_Legends_Database"]
|
| 17 |
+
|
| 18 |
+
return sims_db, projections_db
|
| 19 |
|
| 20 |
+
sims_db, projections_db = init_conn()
|
| 21 |
|
| 22 |
percentages_format = {'Exposure': '{:.2%}'}
|
| 23 |
freq_format = {'Exposure': '{:.2%}', 'Proj Own': '{:.2%}', 'Edge': '{:.2%}'}
|
|
|
|
| 29 |
def init_DK_seed_frames(league):
|
| 30 |
|
| 31 |
if league == 'LCK':
|
| 32 |
+
collection = sims_db['League_of_Legends_DK_seed_frame']
|
| 33 |
elif league =='LEC':
|
| 34 |
+
collection = sims_db['League_of_Legends_DK_seed_frame']
|
| 35 |
elif league =='LTA':
|
| 36 |
+
collection = sims_db['League_of_Legends_DK_seed_frame']
|
| 37 |
cursor = collection.find()
|
| 38 |
|
| 39 |
raw_display = pd.DataFrame(list(cursor))
|
|
|
|
| 45 |
@st.cache_data(ttl = 599)
|
| 46 |
def init_baselines():
|
| 47 |
|
| 48 |
+
collection = projections_db['Player_Range_of_Outcomes']
|
| 49 |
cursor = collection.find()
|
| 50 |
|
| 51 |
raw_display = pd.DataFrame(list(cursor))
|