Spaces:
Build error
Build error
James McCool commited on
Commit ·
6192ee4
1
Parent(s): 85555bf
Fix lineup query filtering and syntax; ignore Python cache files
Browse files- .gitignore +2 -0
- database_queries.py +11 -11
.gitignore
CHANGED
|
@@ -1,3 +1,5 @@
|
|
| 1 |
|
| 2 |
.streamlit/secrets.toml
|
| 3 |
secrets.toml
|
|
|
|
|
|
|
|
|
| 1 |
|
| 2 |
.streamlit/secrets.toml
|
| 3 |
secrets.toml
|
| 4 |
+
__pycache__/
|
| 5 |
+
*.pyc
|
database_queries.py
CHANGED
|
@@ -157,7 +157,7 @@ def init_DK_NFL_lineups(type_var, slate_var, prio_var, prio_mix, nfl_db_translat
|
|
| 157 |
raw_display = pd.concat([pd.DataFrame(list(cursor1)), pd.DataFrame(list(cursor2))])
|
| 158 |
else:
|
| 159 |
cursor1 = collection.find({'salary': {'$gte': salary_min, '$lte': salary_max}, 'Team_count': {'$gte': team_count_min if team_count_min is not None else 1, '$lte': team_count_max if team_count_max is not None else 999}}).limit(math.ceil(lineup_num * (prio_mix / 100)))
|
| 160 |
-
cursor2 = collection.find({'salary': {'$gte': salary_min, '$lte': salary_max}, 'Team_count': {'$gte': team_count_min if team_count_min is not None else 1, '$lte': team_count_max if team_count_max is not None else 999}}).sort('Own', -1).limit(math.ceil(lineup_num * ((100 - prio_mix) /
|
| 161 |
raw_display = pd.concat([pd.DataFrame(list(cursor1)), pd.DataFrame(list(cursor2))])
|
| 162 |
else:
|
| 163 |
cursor = collection.find({'salary': {'$gte': salary_min, '$lte': salary_max}, 'Team_count': {'$gte': team_count_min if team_count_min is not None else 1, '$lte': team_count_max if team_count_max is not None else 999}}).sort(prio_var, -1).limit(lineup_num)
|
|
@@ -198,7 +198,7 @@ def init_DK_NFL_lineups(type_var, slate_var, prio_var, prio_mix, nfl_db_translat
|
|
| 198 |
raw_display = pd.concat([pd.DataFrame(list(cursor1)), pd.DataFrame(list(cursor2))])
|
| 199 |
else:
|
| 200 |
cursor1 = collection.find({'salary': {'$gte': salary_min, '$lte': salary_max}, 'Team_count': {'$gte': team_count_min if team_count_min is not None else 1, '$lte': team_count_max if team_count_max is not None else 999}}).limit(math.ceil(lineup_num * (prio_mix / 100)))
|
| 201 |
-
cursor2 = collection.find({'salary': {'$gte': salary_min, '$lte': salary_max}, 'Team_count': {'$gte': team_count_min if team_count_min is not None else 1, '$lte': team_count_max if team_count_max is not None else 999}}).sort('Own', -1).limit(math.ceil(lineup_num * ((100 - prio_mix) /
|
| 202 |
raw_display = pd.concat([pd.DataFrame(list(cursor1)), pd.DataFrame(list(cursor2))])
|
| 203 |
else:
|
| 204 |
cursor = collection.find({'salary': {'$gte': salary_min, '$lte': salary_max}, 'Team_count': {'$gte': team_count_min if team_count_min is not None else 1, '$lte': team_count_max if team_count_max is not None else 999}}).sort(prio_var, -1).limit(lineup_num)
|
|
@@ -239,7 +239,7 @@ def init_DK_NFL_lineups(type_var, slate_var, prio_var, prio_mix, nfl_db_translat
|
|
| 239 |
raw_display = pd.concat([pd.DataFrame(list(cursor1)), pd.DataFrame(list(cursor2))])
|
| 240 |
else:
|
| 241 |
cursor1 = collection.find({'salary': {'$gte': salary_min, '$lte': salary_max}, 'Team_count': {'$gte': team_count_min if team_count_min is not None else 1, '$lte': team_count_max if team_count_max is not None else 999}}).limit(math.ceil(lineup_num * (prio_mix / 100)))
|
| 242 |
-
cursor2 = collection.find({'salary': {'$gte': salary_min, '$lte': salary_max}, 'Team_count': {'$gte': team_count_min if team_count_min is not None else 1, '$lte': team_count_max if team_count_max is not None else 999}}).sort('Own', -1).limit(math.ceil(lineup_num * ((100 - prio_mix) /
|
| 243 |
raw_display = pd.concat([pd.DataFrame(list(cursor1)), pd.DataFrame(list(cursor2))])
|
| 244 |
else:
|
| 245 |
cursor = collection.find({'salary': {'$gte': salary_min, '$lte': salary_max}, 'Team_count': {'$gte': team_count_min if team_count_min is not None else 1, '$lte': team_count_max if team_count_max is not None else 999}}).sort(prio_var, -1).limit(lineup_num)
|
|
@@ -326,7 +326,7 @@ def init_FD_NFL_lineups(type_var, slate_var, prio_var, prio_mix, nfl_db_translat
|
|
| 326 |
raw_display = pd.concat([pd.DataFrame(list(cursor1)), pd.DataFrame(list(cursor2))])
|
| 327 |
else:
|
| 328 |
cursor1 = collection.find({'salary': {'$gte': salary_min, '$lte': salary_max}, 'Team_count': {'$gte': team_count_min if team_count_min is not None else 1, '$lte': team_count_max if team_count_max is not None else 999}}).limit(math.ceil(lineup_num * (prio_mix / 100)))
|
| 329 |
-
cursor2 = collection.find({'salary': {'$gte': salary_min, '$lte': salary_max}, 'Team_count': {'$gte': team_count_min if team_count_min is not None else 1, '$lte': team_count_max if team_count_max is not None else 999}}).sort('Own', -1).limit(math.ceil(lineup_num * ((100 - prio_mix) /
|
| 330 |
raw_display = pd.concat([pd.DataFrame(list(cursor1)), pd.DataFrame(list(cursor2))])
|
| 331 |
else:
|
| 332 |
cursor = collection.find({'salary': {'$gte': salary_min, '$lte': salary_max}, 'Team_count': {'$gte': team_count_min if team_count_min is not None else 1, '$lte': team_count_max if team_count_max is not None else 999}}).sort(prio_var, -1).limit(lineup_num)
|
|
@@ -367,7 +367,7 @@ def init_FD_NFL_lineups(type_var, slate_var, prio_var, prio_mix, nfl_db_translat
|
|
| 367 |
raw_display = pd.concat([pd.DataFrame(list(cursor1)), pd.DataFrame(list(cursor2))])
|
| 368 |
else:
|
| 369 |
cursor1 = collection.find({'salary': {'$gte': salary_min, '$lte': salary_max}, 'Team_count': {'$gte': team_count_min if team_count_min is not None else 1, '$lte': team_count_max if team_count_max is not None else 999}}).limit(math.ceil(lineup_num * (prio_mix / 100)))
|
| 370 |
-
cursor2 = collection.find({'salary': {'$gte': salary_min, '$lte': salary_max}, 'Team_count': {'$gte': team_count_min if team_count_min is not None else 1, '$lte': team_count_max if team_count_max is not None else 999}}).sort('Own', -1).limit(math.ceil(lineup_num * ((100 - prio_mix) /
|
| 371 |
raw_display = pd.concat([pd.DataFrame(list(cursor1)), pd.DataFrame(list(cursor2))])
|
| 372 |
else:
|
| 373 |
cursor = collection.find({'salary': {'$gte': salary_min, '$lte': salary_max}, 'Team_count': {'$gte': team_count_min if team_count_min is not None else 1, '$lte': team_count_max if team_count_max is not None else 999}}).sort(prio_var, -1).limit(lineup_num)
|
|
@@ -408,7 +408,7 @@ def init_FD_NFL_lineups(type_var, slate_var, prio_var, prio_mix, nfl_db_translat
|
|
| 408 |
raw_display = pd.concat([pd.DataFrame(list(cursor1)), pd.DataFrame(list(cursor2))])
|
| 409 |
else:
|
| 410 |
cursor1 = collection.find({'salary': {'$gte': salary_min, '$lte': salary_max}, 'Team_count': {'$gte': team_count_min if team_count_min is not None else 1, '$lte': team_count_max if team_count_max is not None else 999}}).limit(math.ceil(lineup_num * (prio_mix / 100)))
|
| 411 |
-
cursor2 = collection.find({'salary': {'$gte': salary_min, '$lte': salary_max}, 'Team_count': {'$gte': team_count_min if team_count_min is not None else 1, '$lte': team_count_max if team_count_max is not None else 999}}).sort('Own', -1).limit(math.ceil(lineup_num * ((100 - prio_mix) /
|
| 412 |
raw_display = pd.concat([pd.DataFrame(list(cursor1)), pd.DataFrame(list(cursor2))])
|
| 413 |
else:
|
| 414 |
cursor = collection.find({'salary': {'$gte': salary_min, '$lte': salary_max}, 'Team_count': {'$gte': team_count_min if team_count_min is not None else 1, '$lte': team_count_max if team_count_max is not None else 999}}).sort(prio_var, -1).limit(lineup_num)
|
|
@@ -622,7 +622,7 @@ def init_DK_NBA_lineups(type_var, slate_var, prio_var, prio_mix, nba_db_translat
|
|
| 622 |
raw_display = pd.concat([pd.DataFrame(list(cursor1)), pd.DataFrame(list(cursor2))])
|
| 623 |
else:
|
| 624 |
cursor1 = collection.find({'salary': {'$gte': salary_min, '$lte': salary_max}, 'Team_count': {'$gte': team_count_min if team_count_min is not None else 1, '$lte': team_count_max if team_count_max is not None else 999}}).limit(math.ceil(lineup_num * (prio_mix / 100)))
|
| 625 |
-
cursor2 = collection.find({'salary': {'$gte': salary_min, '$lte': salary_max}, 'Team_count': {'$gte': team_count_min if team_count_min is not None else 1, '$lte': team_count_max if team_count_max is not None else 999}}).sort('Own', -1).limit(math.ceil(lineup_num * ((100 - prio_mix) /
|
| 626 |
raw_display = pd.concat([pd.DataFrame(list(cursor1)), pd.DataFrame(list(cursor2))])
|
| 627 |
else:
|
| 628 |
cursor = collection.find({'salary': {'$gte': salary_min, '$lte': salary_max}, 'Team_count': {'$gte': team_count_min if team_count_min is not None else 1, '$lte': team_count_max if team_count_max is not None else 999}}).sort(prio_var, -1).limit(lineup_num)
|
|
@@ -665,7 +665,7 @@ def init_DK_NBA_lineups(type_var, slate_var, prio_var, prio_mix, nba_db_translat
|
|
| 665 |
cursor2 = collection.find({'salary': {'$gte': salary_min, '$lte': salary_max}, 'Team_count': {'$gte': team_count_min if team_count_min is not None else 1, '$lte': team_count_max if team_count_max is not None else 999}}).sort('Own', -1).limit(math.ceil(lineup_num * ((100 - prio_mix) / 100)))
|
| 666 |
raw_display = pd.concat([pd.DataFrame(list(cursor1)), pd.DataFrame(list(cursor2))])
|
| 667 |
else:
|
| 668 |
-
cursor = collection.find({'salary': {'$gte': salary_min, '$lte': salary_max}, 'Team_count': {'$gte': team_count_min if team_count_min is not None else 1, '$lte': team_count_max if team_count_max is not None else 999}}
|
| 669 |
raw_display = pd.DataFrame(list(cursor))
|
| 670 |
|
| 671 |
raw_display = raw_display.drop_duplicates(subset=['PG', 'SG', 'SF', 'PF', 'C', 'G', 'F', 'FLEX'])
|
|
@@ -826,7 +826,7 @@ def init_FD_NBA_lineups(type_var, slate_var, prio_var, prio_mix, nba_db_translat
|
|
| 826 |
raw_display = pd.concat([pd.DataFrame(list(cursor1)), pd.DataFrame(list(cursor2))])
|
| 827 |
else:
|
| 828 |
cursor1 = collection.find({'salary': {'$gte': salary_min, '$lte': salary_max}, 'Team_count': {'$gte': team_count_min if team_count_min is not None else 1, '$lte': team_count_max if team_count_max is not None else 999}}).limit(math.ceil(lineup_num * (prio_mix / 100)))
|
| 829 |
-
cursor2 = collection.find({'salary': {'$gte': salary_min, '$lte': salary_max}, 'Team_count': {'$gte': team_count_min if team_count_min is not None else 1, '$lte': team_count_max if team_count_max is not None else 999}}).sort('Own', -1).limit(math.ceil(lineup_num * ((100 - prio_mix) /
|
| 830 |
raw_display = pd.concat([pd.DataFrame(list(cursor1)), pd.DataFrame(list(cursor2))])
|
| 831 |
else:
|
| 832 |
cursor = collection.find({'salary': {'$gte': salary_min, '$lte': salary_max}, 'Team_count': {'$gte': team_count_min if team_count_min is not None else 1, '$lte': team_count_max if team_count_max is not None else 999}}).sort(prio_var, -1).limit(lineup_num)
|
|
@@ -1578,7 +1578,7 @@ def init_FD_MLB_lineups(type_var, slate_var, prio_var, prio_mix, mlb_db_translat
|
|
| 1578 |
raw_display = pd.concat([pd.DataFrame(list(cursor1)), pd.DataFrame(list(cursor2))])
|
| 1579 |
else:
|
| 1580 |
cursor1 = collection.find({'salary': {'$gte': salary_min, '$lte': salary_max}, 'Team_count': {'$gte': team_count_min if team_count_min is not None else 1, '$lte': team_count_max if team_count_max is not None else 999}}).limit(math.ceil(lineup_num * (prio_mix / 100)))
|
| 1581 |
-
cursor2 = collection.find({'salary': {'$gte': salary_min, '$lte': salary_max}, 'Team_count': {'$gte': team_count_min if team_count_min is not None else 1, '$lte': team_count_max if team_count_max is not None else 999}}).sort('Own', -1).limit(math.ceil(lineup_num * ((100 -
|
| 1582 |
raw_display = pd.concat([pd.DataFrame(list(cursor1)), pd.DataFrame(list(cursor2))])
|
| 1583 |
else:
|
| 1584 |
cursor = collection.find({'salary': {'$gte': salary_min, '$lte': salary_max}, 'Team_count': {'$gte': team_count_min if team_count_min is not None else 1, '$lte': team_count_max if team_count_max is not None else 999}}).sort(prio_var, -1).limit(lineup_num)
|
|
@@ -2248,7 +2248,7 @@ def init_DK_PGA_lineups(type_var, slate_var, prio_var, prio_mix, lineup_num, sal
|
|
| 2248 |
raw_display = pd.concat([pd.DataFrame(list(cursor1)), pd.DataFrame(list(cursor2))])
|
| 2249 |
else:
|
| 2250 |
cursor1 = collection.find({'salary': {'$gte': salary_min, '$lte': salary_max}, 'Team_count': {'$gte': team_count_min if team_count_min is not None else 1, '$lte': team_count_max if team_count_max is not None else 999}}).limit(math.ceil(lineup_num * (prio_mix / 100)))
|
| 2251 |
-
cursor2 = collection.find({'salary': {'$gte': salary_min, '$lte': salary_max}, 'Team_count': {'$gte': team_count_min if team_count_min is not None else 1, '$lte': team_count_max if team_count_max is not None else 999}}).sort('Own', -1).limit(math.ceil(lineup_num * ((100 -
|
| 2252 |
raw_display = pd.concat([pd.DataFrame(list(cursor1)), pd.DataFrame(list(cursor2))])
|
| 2253 |
else:
|
| 2254 |
cursor = collection.find({'salary': {'$gte': salary_min, '$lte': salary_max}, 'Team_count': {'$gte': team_count_min if team_count_min is not None else 1, '$lte': team_count_max if team_count_max is not None else 999}}).sort(prio_var, -1).limit(lineup_num)
|
|
|
|
| 157 |
raw_display = pd.concat([pd.DataFrame(list(cursor1)), pd.DataFrame(list(cursor2))])
|
| 158 |
else:
|
| 159 |
cursor1 = collection.find({'salary': {'$gte': salary_min, '$lte': salary_max}, 'Team_count': {'$gte': team_count_min if team_count_min is not None else 1, '$lte': team_count_max if team_count_max is not None else 999}}).limit(math.ceil(lineup_num * (prio_mix / 100)))
|
| 160 |
+
cursor2 = collection.find({'salary': {'$gte': salary_min, '$lte': salary_max}, 'Team_count': {'$gte': team_count_min if team_count_min is not None else 1, '$lte': team_count_max if team_count_max is not None else 999}}).sort('Own', -1).limit(math.ceil(lineup_num * ((100 - prio_mix) / 100)))
|
| 161 |
raw_display = pd.concat([pd.DataFrame(list(cursor1)), pd.DataFrame(list(cursor2))])
|
| 162 |
else:
|
| 163 |
cursor = collection.find({'salary': {'$gte': salary_min, '$lte': salary_max}, 'Team_count': {'$gte': team_count_min if team_count_min is not None else 1, '$lte': team_count_max if team_count_max is not None else 999}}).sort(prio_var, -1).limit(lineup_num)
|
|
|
|
| 198 |
raw_display = pd.concat([pd.DataFrame(list(cursor1)), pd.DataFrame(list(cursor2))])
|
| 199 |
else:
|
| 200 |
cursor1 = collection.find({'salary': {'$gte': salary_min, '$lte': salary_max}, 'Team_count': {'$gte': team_count_min if team_count_min is not None else 1, '$lte': team_count_max if team_count_max is not None else 999}}).limit(math.ceil(lineup_num * (prio_mix / 100)))
|
| 201 |
+
cursor2 = collection.find({'salary': {'$gte': salary_min, '$lte': salary_max}, 'Team_count': {'$gte': team_count_min if team_count_min is not None else 1, '$lte': team_count_max if team_count_max is not None else 999}}).sort('Own', -1).limit(math.ceil(lineup_num * ((100 - prio_mix) / 100)))
|
| 202 |
raw_display = pd.concat([pd.DataFrame(list(cursor1)), pd.DataFrame(list(cursor2))])
|
| 203 |
else:
|
| 204 |
cursor = collection.find({'salary': {'$gte': salary_min, '$lte': salary_max}, 'Team_count': {'$gte': team_count_min if team_count_min is not None else 1, '$lte': team_count_max if team_count_max is not None else 999}}).sort(prio_var, -1).limit(lineup_num)
|
|
|
|
| 239 |
raw_display = pd.concat([pd.DataFrame(list(cursor1)), pd.DataFrame(list(cursor2))])
|
| 240 |
else:
|
| 241 |
cursor1 = collection.find({'salary': {'$gte': salary_min, '$lte': salary_max}, 'Team_count': {'$gte': team_count_min if team_count_min is not None else 1, '$lte': team_count_max if team_count_max is not None else 999}}).limit(math.ceil(lineup_num * (prio_mix / 100)))
|
| 242 |
+
cursor2 = collection.find({'salary': {'$gte': salary_min, '$lte': salary_max}, 'Team_count': {'$gte': team_count_min if team_count_min is not None else 1, '$lte': team_count_max if team_count_max is not None else 999}}).sort('Own', -1).limit(math.ceil(lineup_num * ((100 - prio_mix) / 100)))
|
| 243 |
raw_display = pd.concat([pd.DataFrame(list(cursor1)), pd.DataFrame(list(cursor2))])
|
| 244 |
else:
|
| 245 |
cursor = collection.find({'salary': {'$gte': salary_min, '$lte': salary_max}, 'Team_count': {'$gte': team_count_min if team_count_min is not None else 1, '$lte': team_count_max if team_count_max is not None else 999}}).sort(prio_var, -1).limit(lineup_num)
|
|
|
|
| 326 |
raw_display = pd.concat([pd.DataFrame(list(cursor1)), pd.DataFrame(list(cursor2))])
|
| 327 |
else:
|
| 328 |
cursor1 = collection.find({'salary': {'$gte': salary_min, '$lte': salary_max}, 'Team_count': {'$gte': team_count_min if team_count_min is not None else 1, '$lte': team_count_max if team_count_max is not None else 999}}).limit(math.ceil(lineup_num * (prio_mix / 100)))
|
| 329 |
+
cursor2 = collection.find({'salary': {'$gte': salary_min, '$lte': salary_max}, 'Team_count': {'$gte': team_count_min if team_count_min is not None else 1, '$lte': team_count_max if team_count_max is not None else 999}}).sort('Own', -1).limit(math.ceil(lineup_num * ((100 - prio_mix) / 100)))
|
| 330 |
raw_display = pd.concat([pd.DataFrame(list(cursor1)), pd.DataFrame(list(cursor2))])
|
| 331 |
else:
|
| 332 |
cursor = collection.find({'salary': {'$gte': salary_min, '$lte': salary_max}, 'Team_count': {'$gte': team_count_min if team_count_min is not None else 1, '$lte': team_count_max if team_count_max is not None else 999}}).sort(prio_var, -1).limit(lineup_num)
|
|
|
|
| 367 |
raw_display = pd.concat([pd.DataFrame(list(cursor1)), pd.DataFrame(list(cursor2))])
|
| 368 |
else:
|
| 369 |
cursor1 = collection.find({'salary': {'$gte': salary_min, '$lte': salary_max}, 'Team_count': {'$gte': team_count_min if team_count_min is not None else 1, '$lte': team_count_max if team_count_max is not None else 999}}).limit(math.ceil(lineup_num * (prio_mix / 100)))
|
| 370 |
+
cursor2 = collection.find({'salary': {'$gte': salary_min, '$lte': salary_max}, 'Team_count': {'$gte': team_count_min if team_count_min is not None else 1, '$lte': team_count_max if team_count_max is not None else 999}}).sort('Own', -1).limit(math.ceil(lineup_num * ((100 - prio_mix) / 100)))
|
| 371 |
raw_display = pd.concat([pd.DataFrame(list(cursor1)), pd.DataFrame(list(cursor2))])
|
| 372 |
else:
|
| 373 |
cursor = collection.find({'salary': {'$gte': salary_min, '$lte': salary_max}, 'Team_count': {'$gte': team_count_min if team_count_min is not None else 1, '$lte': team_count_max if team_count_max is not None else 999}}).sort(prio_var, -1).limit(lineup_num)
|
|
|
|
| 408 |
raw_display = pd.concat([pd.DataFrame(list(cursor1)), pd.DataFrame(list(cursor2))])
|
| 409 |
else:
|
| 410 |
cursor1 = collection.find({'salary': {'$gte': salary_min, '$lte': salary_max}, 'Team_count': {'$gte': team_count_min if team_count_min is not None else 1, '$lte': team_count_max if team_count_max is not None else 999}}).limit(math.ceil(lineup_num * (prio_mix / 100)))
|
| 411 |
+
cursor2 = collection.find({'salary': {'$gte': salary_min, '$lte': salary_max}, 'Team_count': {'$gte': team_count_min if team_count_min is not None else 1, '$lte': team_count_max if team_count_max is not None else 999}}).sort('Own', -1).limit(math.ceil(lineup_num * ((100 - prio_mix) / 100)))
|
| 412 |
raw_display = pd.concat([pd.DataFrame(list(cursor1)), pd.DataFrame(list(cursor2))])
|
| 413 |
else:
|
| 414 |
cursor = collection.find({'salary': {'$gte': salary_min, '$lte': salary_max}, 'Team_count': {'$gte': team_count_min if team_count_min is not None else 1, '$lte': team_count_max if team_count_max is not None else 999}}).sort(prio_var, -1).limit(lineup_num)
|
|
|
|
| 622 |
raw_display = pd.concat([pd.DataFrame(list(cursor1)), pd.DataFrame(list(cursor2))])
|
| 623 |
else:
|
| 624 |
cursor1 = collection.find({'salary': {'$gte': salary_min, '$lte': salary_max}, 'Team_count': {'$gte': team_count_min if team_count_min is not None else 1, '$lte': team_count_max if team_count_max is not None else 999}}).limit(math.ceil(lineup_num * (prio_mix / 100)))
|
| 625 |
+
cursor2 = collection.find({'salary': {'$gte': salary_min, '$lte': salary_max}, 'Team_count': {'$gte': team_count_min if team_count_min is not None else 1, '$lte': team_count_max if team_count_max is not None else 999}}).sort('Own', -1).limit(math.ceil(lineup_num * ((100 - prio_mix) / 100)))
|
| 626 |
raw_display = pd.concat([pd.DataFrame(list(cursor1)), pd.DataFrame(list(cursor2))])
|
| 627 |
else:
|
| 628 |
cursor = collection.find({'salary': {'$gte': salary_min, '$lte': salary_max}, 'Team_count': {'$gte': team_count_min if team_count_min is not None else 1, '$lte': team_count_max if team_count_max is not None else 999}}).sort(prio_var, -1).limit(lineup_num)
|
|
|
|
| 665 |
cursor2 = collection.find({'salary': {'$gte': salary_min, '$lte': salary_max}, 'Team_count': {'$gte': team_count_min if team_count_min is not None else 1, '$lte': team_count_max if team_count_max is not None else 999}}).sort('Own', -1).limit(math.ceil(lineup_num * ((100 - prio_mix) / 100)))
|
| 666 |
raw_display = pd.concat([pd.DataFrame(list(cursor1)), pd.DataFrame(list(cursor2))])
|
| 667 |
else:
|
| 668 |
+
cursor = collection.find({'salary': {'$gte': salary_min, '$lte': salary_max}, 'Team_count': {'$gte': team_count_min if team_count_min is not None else 1, '$lte': team_count_max if team_count_max is not None else 999}}).sort(prio_var, -1).limit(lineup_num)
|
| 669 |
raw_display = pd.DataFrame(list(cursor))
|
| 670 |
|
| 671 |
raw_display = raw_display.drop_duplicates(subset=['PG', 'SG', 'SF', 'PF', 'C', 'G', 'F', 'FLEX'])
|
|
|
|
| 826 |
raw_display = pd.concat([pd.DataFrame(list(cursor1)), pd.DataFrame(list(cursor2))])
|
| 827 |
else:
|
| 828 |
cursor1 = collection.find({'salary': {'$gte': salary_min, '$lte': salary_max}, 'Team_count': {'$gte': team_count_min if team_count_min is not None else 1, '$lte': team_count_max if team_count_max is not None else 999}}).limit(math.ceil(lineup_num * (prio_mix / 100)))
|
| 829 |
+
cursor2 = collection.find({'salary': {'$gte': salary_min, '$lte': salary_max}, 'Team_count': {'$gte': team_count_min if team_count_min is not None else 1, '$lte': team_count_max if team_count_max is not None else 999}}).sort('Own', -1).limit(math.ceil(lineup_num * ((100 - prio_mix) / 100)))
|
| 830 |
raw_display = pd.concat([pd.DataFrame(list(cursor1)), pd.DataFrame(list(cursor2))])
|
| 831 |
else:
|
| 832 |
cursor = collection.find({'salary': {'$gte': salary_min, '$lte': salary_max}, 'Team_count': {'$gte': team_count_min if team_count_min is not None else 1, '$lte': team_count_max if team_count_max is not None else 999}}).sort(prio_var, -1).limit(lineup_num)
|
|
|
|
| 1578 |
raw_display = pd.concat([pd.DataFrame(list(cursor1)), pd.DataFrame(list(cursor2))])
|
| 1579 |
else:
|
| 1580 |
cursor1 = collection.find({'salary': {'$gte': salary_min, '$lte': salary_max}, 'Team_count': {'$gte': team_count_min if team_count_min is not None else 1, '$lte': team_count_max if team_count_max is not None else 999}}).limit(math.ceil(lineup_num * (prio_mix / 100)))
|
| 1581 |
+
cursor2 = collection.find({'salary': {'$gte': salary_min, '$lte': salary_max}, 'Team_count': {'$gte': team_count_min if team_count_min is not None else 1, '$lte': team_count_max if team_count_max is not None else 999}}).sort('Own', -1).limit(math.ceil(lineup_num * ((100 - prio_mix) / 100)))
|
| 1582 |
raw_display = pd.concat([pd.DataFrame(list(cursor1)), pd.DataFrame(list(cursor2))])
|
| 1583 |
else:
|
| 1584 |
cursor = collection.find({'salary': {'$gte': salary_min, '$lte': salary_max}, 'Team_count': {'$gte': team_count_min if team_count_min is not None else 1, '$lte': team_count_max if team_count_max is not None else 999}}).sort(prio_var, -1).limit(lineup_num)
|
|
|
|
| 2248 |
raw_display = pd.concat([pd.DataFrame(list(cursor1)), pd.DataFrame(list(cursor2))])
|
| 2249 |
else:
|
| 2250 |
cursor1 = collection.find({'salary': {'$gte': salary_min, '$lte': salary_max}, 'Team_count': {'$gte': team_count_min if team_count_min is not None else 1, '$lte': team_count_max if team_count_max is not None else 999}}).limit(math.ceil(lineup_num * (prio_mix / 100)))
|
| 2251 |
+
cursor2 = collection.find({'salary': {'$gte': salary_min, '$lte': salary_max}, 'Team_count': {'$gte': team_count_min if team_count_min is not None else 1, '$lte': team_count_max if team_count_max is not None else 999}}).sort('Own', -1).limit(math.ceil(lineup_num * ((100 - prio_mix) / 100)))
|
| 2252 |
raw_display = pd.concat([pd.DataFrame(list(cursor1)), pd.DataFrame(list(cursor2))])
|
| 2253 |
else:
|
| 2254 |
cursor = collection.find({'salary': {'$gte': salary_min, '$lte': salary_max}, 'Team_count': {'$gte': team_count_min if team_count_min is not None else 1, '$lte': team_count_max if team_count_max is not None else 999}}).sort(prio_var, -1).limit(lineup_num)
|