diff --git "a/database_queries.py" "b/database_queries.py" --- "a/database_queries.py" +++ "b/database_queries.py" @@ -31,7 +31,7 @@ def _showdown_seed_filter(salary_min, salary_max, team_count_min=None, team_coun return { '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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, } @@ -165,36 +165,36 @@ def init_DK_NFL_lineups(type_var, slate_var, prio_var, prio_mix, nfl_db_translat filter_query = {'$or': query_conditions} cursor1 = collection.find({'$and': [filter_query, {'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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }]}).limit(_mix_seed_limit_primary(lineup_num, prio_mix)) cursor2 = collection.find({'$and': [filter_query, {'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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }]}).sort('Own', -1).limit(_mix_seed_limit_secondary(lineup_num, prio_mix)) else: 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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }).limit(_mix_seed_limit_primary(lineup_num, prio_mix)) 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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }).sort('Own', -1).limit(_mix_seed_limit_secondary(lineup_num, prio_mix)) raw_display = pd.concat([pd.DataFrame(list(cursor1)), pd.DataFrame(list(cursor2))]) else: 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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }).limit(_mix_seed_limit_primary(lineup_num, prio_mix)) 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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }).sort('Own', -1).limit(_mix_seed_limit_secondary(lineup_num, prio_mix)) raw_display = pd.concat([pd.DataFrame(list(cursor1)), pd.DataFrame(list(cursor2))]) else: 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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }).sort(prio_var, -1).limit(lineup_num) raw_display = pd.DataFrame(list(cursor)) @@ -228,36 +228,36 @@ def init_DK_NFL_lineups(type_var, slate_var, prio_var, prio_mix, nfl_db_translat filter_query = {'$or': query_conditions} cursor1 = collection.find({'$and': [filter_query, {'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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }]}).limit(_mix_seed_limit_primary(lineup_num, prio_mix)) cursor2 = collection.find({'$and': [filter_query, {'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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }]}).sort('Own', -1).limit(_mix_seed_limit_secondary(lineup_num, prio_mix)) else: 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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }).limit(_mix_seed_limit_primary(lineup_num, prio_mix)) 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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }).sort('Own', -1).limit(_mix_seed_limit_secondary(lineup_num, prio_mix)) raw_display = pd.concat([pd.DataFrame(list(cursor1)), pd.DataFrame(list(cursor2))]) else: 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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }).limit(_mix_seed_limit_primary(lineup_num, prio_mix)) 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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }).sort('Own', -1).limit(_mix_seed_limit_secondary(lineup_num, prio_mix)) raw_display = pd.concat([pd.DataFrame(list(cursor1)), pd.DataFrame(list(cursor2))]) else: 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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }).sort(prio_var, -1).limit(lineup_num) raw_display = pd.DataFrame(list(cursor)) @@ -397,36 +397,36 @@ def init_FD_NFL_lineups(type_var, slate_var, prio_var, prio_mix, nfl_db_translat filter_query = {'$or': query_conditions} cursor1 = collection.find({'$and': [filter_query, {'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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }]}).limit(_mix_seed_limit_primary(lineup_num, prio_mix)) cursor2 = collection.find({'$and': [filter_query, {'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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }]}).sort('Own', -1).limit(_mix_seed_limit_secondary(lineup_num, prio_mix)) else: 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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }).limit(_mix_seed_limit_primary(lineup_num, prio_mix)) 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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }).sort('Own', -1).limit(_mix_seed_limit_secondary(lineup_num, prio_mix)) raw_display = pd.concat([pd.DataFrame(list(cursor1)), pd.DataFrame(list(cursor2))]) else: 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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }).limit(_mix_seed_limit_primary(lineup_num, prio_mix)) 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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }).sort('Own', -1).limit(_mix_seed_limit_secondary(lineup_num, prio_mix)) raw_display = pd.concat([pd.DataFrame(list(cursor1)), pd.DataFrame(list(cursor2))]) else: 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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }).sort(prio_var, -1).limit(lineup_num) raw_display = pd.DataFrame(list(cursor)) @@ -460,36 +460,36 @@ def init_FD_NFL_lineups(type_var, slate_var, prio_var, prio_mix, nfl_db_translat filter_query = {'$or': query_conditions} cursor1 = collection.find({'$and': [filter_query, {'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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }]}).limit(_mix_seed_limit_primary(lineup_num, prio_mix)) cursor2 = collection.find({'$and': [filter_query, {'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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }]}).sort('Own', -1).limit(_mix_seed_limit_secondary(lineup_num, prio_mix)) else: 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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }).limit(_mix_seed_limit_primary(lineup_num, prio_mix)) 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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }).sort('Own', -1).limit(_mix_seed_limit_secondary(lineup_num, prio_mix)) raw_display = pd.concat([pd.DataFrame(list(cursor1)), pd.DataFrame(list(cursor2))]) else: 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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }).limit(_mix_seed_limit_primary(lineup_num, prio_mix)) 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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }).sort('Own', -1).limit(_mix_seed_limit_secondary(lineup_num, prio_mix)) raw_display = pd.concat([pd.DataFrame(list(cursor1)), pd.DataFrame(list(cursor2))]) else: 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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }).sort(prio_var, -1).limit(lineup_num) raw_display = pd.DataFrame(list(cursor)) @@ -523,36 +523,36 @@ def init_FD_NFL_lineups(type_var, slate_var, prio_var, prio_mix, nfl_db_translat filter_query = {'$or': query_conditions} cursor1 = collection.find({'$and': [filter_query, {'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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }]}).limit(_mix_seed_limit_primary(lineup_num, prio_mix)) cursor2 = collection.find({'$and': [filter_query, {'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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }]}).sort('Own', -1).limit(math.ceil(lineup_num = ((100 - prio_mix) / 100))) else: 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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }).limit(_mix_seed_limit_primary(lineup_num, prio_mix)) 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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }).sort('Own', -1).limit(_mix_seed_limit_secondary(lineup_num, prio_mix)) raw_display = pd.concat([pd.DataFrame(list(cursor1)), pd.DataFrame(list(cursor2))]) else: 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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }).limit(_mix_seed_limit_primary(lineup_num, prio_mix)) 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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }).sort('Own', -1).limit(_mix_seed_limit_secondary(lineup_num, prio_mix)) raw_display = pd.concat([pd.DataFrame(list(cursor1)), pd.DataFrame(list(cursor2))]) else: 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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }).sort(prio_var, -1).limit(lineup_num) raw_display = pd.DataFrame(list(cursor)) @@ -720,31 +720,31 @@ def init_DK_NBA_lineups(type_var, slate_var, prio_var, prio_mix, nba_db_translat filter_query = {'$or': query_conditions} cursor1 = collection.find({'$and': [filter_query, {'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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }]}).limit(_mix_seed_limit_primary(lineup_num, prio_mix)) cursor2 = collection.find({'$and': [filter_query, {'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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }]}).sort('Own', -1).limit(_mix_seed_limit_secondary(lineup_num, prio_mix)) else: 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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }).limit(_mix_seed_limit_primary(lineup_num, prio_mix)) 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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }).sort('Own', -1).limit(_mix_seed_limit_secondary(lineup_num, prio_mix)) raw_display = pd.concat([pd.DataFrame(list(cursor1)), pd.DataFrame(list(cursor2))]) else: 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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }).limit(_mix_seed_limit_primary(lineup_num, prio_mix)) 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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }).sort('Own', -1).limit(_mix_seed_limit_secondary(lineup_num, prio_mix)) raw_display = pd.concat([pd.DataFrame(list(cursor1)), pd.DataFrame(list(cursor2))]) else: 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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }).sort(prio_var, -1).limit(lineup_num) raw_display = pd.DataFrame(list(cursor)) @@ -777,31 +777,31 @@ def init_DK_NBA_lineups(type_var, slate_var, prio_var, prio_mix, nba_db_translat filter_query = {'$or': query_conditions} cursor1 = collection.find({'$and': [filter_query, {'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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }]}).limit(_mix_seed_limit_primary(lineup_num, prio_mix)) cursor2 = collection.find({'$and': [filter_query, {'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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }]}).sort('Own', -1).limit(_mix_seed_limit_secondary(lineup_num, prio_mix)) else: 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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }).limit(_mix_seed_limit_primary(lineup_num, prio_mix)) 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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }).sort('Own', -1).limit(_mix_seed_limit_secondary(lineup_num, prio_mix)) raw_display = pd.concat([pd.DataFrame(list(cursor1)), pd.DataFrame(list(cursor2))]) else: 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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }).limit(_mix_seed_limit_primary(lineup_num, prio_mix)) 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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }).sort('Own', -1).limit(_mix_seed_limit_secondary(lineup_num, prio_mix)) raw_display = pd.concat([pd.DataFrame(list(cursor1)), pd.DataFrame(list(cursor2))]) else: 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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }).sort(prio_var, -1).limit(lineup_num) raw_display = pd.DataFrame(list(cursor)) @@ -834,31 +834,31 @@ def init_DK_NBA_lineups(type_var, slate_var, prio_var, prio_mix, nba_db_translat filter_query = {'$or': query_conditions} cursor1 = collection.find({'$and': [filter_query, {'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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }]}).limit(_mix_seed_limit_primary(lineup_num, prio_mix)) cursor2 = collection.find({'$and': [filter_query, {'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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }]}).sort('Own', -1).limit(_mix_seed_limit_secondary(lineup_num, prio_mix)) else: 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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }).limit(_mix_seed_limit_primary(lineup_num, prio_mix)) 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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }).sort('Own', -1).limit(_mix_seed_limit_secondary(lineup_num, prio_mix)) raw_display = pd.concat([pd.DataFrame(list(cursor1)), pd.DataFrame(list(cursor2))]) else: 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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }).limit(_mix_seed_limit_primary(lineup_num, prio_mix)) 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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }).sort('Own', -1).limit(_mix_seed_limit_secondary(lineup_num, prio_mix)) raw_display = pd.concat([pd.DataFrame(list(cursor1)), pd.DataFrame(list(cursor2))]) else: 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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }).sort(prio_var, -1).limit(lineup_num) raw_display = pd.DataFrame(list(cursor)) @@ -936,31 +936,31 @@ def init_FD_NBA_lineups(type_var, slate_var, prio_var, prio_mix, nba_db_translat filter_query = {'$or': query_conditions} cursor1 = collection.find({'$and': [filter_query, {'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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }]}).limit(_mix_seed_limit_primary(lineup_num, prio_mix)) cursor2 = collection.find({'$and': [filter_query, {'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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }]}).sort('Own', -1).limit(_mix_seed_limit_secondary(lineup_num, prio_mix)) else: 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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }).limit(_mix_seed_limit_primary(lineup_num, prio_mix)) 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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }).sort('Own', -1).limit(_mix_seed_limit_secondary(lineup_num, prio_mix)) raw_display = pd.concat([pd.DataFrame(list(cursor1)), pd.DataFrame(list(cursor2))]) else: 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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }).limit(_mix_seed_limit_primary(lineup_num, prio_mix)) 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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }).sort('Own', -1).limit(_mix_seed_limit_secondary(lineup_num, prio_mix)) raw_display = pd.concat([pd.DataFrame(list(cursor1)), pd.DataFrame(list(cursor2))]) else: 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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }).sort(prio_var, -1).limit(lineup_num) raw_display = pd.DataFrame(list(cursor)) @@ -993,31 +993,31 @@ def init_FD_NBA_lineups(type_var, slate_var, prio_var, prio_mix, nba_db_translat filter_query = {'$or': query_conditions} cursor1 = collection.find({'$and': [filter_query, {'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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }]}).limit(_mix_seed_limit_primary(lineup_num, prio_mix)) cursor2 = collection.find({'$and': [filter_query, {'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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }]}).sort('Own', -1).limit(_mix_seed_limit_secondary(lineup_num, prio_mix)) else: 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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }).limit(_mix_seed_limit_primary(lineup_num, prio_mix)) 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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }).sort('Own', -1).limit(_mix_seed_limit_secondary(lineup_num, prio_mix)) raw_display = pd.concat([pd.DataFrame(list(cursor1)), pd.DataFrame(list(cursor2))]) else: 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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }).limit(_mix_seed_limit_primary(lineup_num, prio_mix)) 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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }).sort('Own', -1).limit(_mix_seed_limit_secondary(lineup_num, prio_mix)) raw_display = pd.concat([pd.DataFrame(list(cursor1)), pd.DataFrame(list(cursor2))]) else: 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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }).sort(prio_var, -1).limit(lineup_num) raw_display = pd.DataFrame(list(cursor)) @@ -1050,31 +1050,31 @@ def init_FD_NBA_lineups(type_var, slate_var, prio_var, prio_mix, nba_db_translat filter_query = {'$or': query_conditions} cursor1 = collection.find({'$and': [filter_query, {'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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }]}).limit(_mix_seed_limit_primary(lineup_num, prio_mix)) cursor2 = collection.find({'$and': [filter_query, {'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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }]}).sort('Own', -1).limit(math.ceil(lineup_num = ((100 - prio_mix) / 100))) else: 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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }).limit(_mix_seed_limit_primary(lineup_num, prio_mix)) 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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }).sort('Own', -1).limit(_mix_seed_limit_secondary(lineup_num, prio_mix)) raw_display = pd.concat([pd.DataFrame(list(cursor1)), pd.DataFrame(list(cursor2))]) else: 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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }).limit(_mix_seed_limit_primary(lineup_num, prio_mix)) 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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }).sort('Own', -1).limit(_mix_seed_limit_secondary(lineup_num, prio_mix)) raw_display = pd.concat([pd.DataFrame(list(cursor1)), pd.DataFrame(list(cursor2))]) else: 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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }).sort(prio_var, -1).limit(lineup_num) raw_display = pd.DataFrame(list(cursor)) @@ -1219,30 +1219,30 @@ def init_DK_NHL_lineups(type_var, slate_var, prio_var, prio_mix, nhl_db_translat if query_conditions: filter_query = {'$or': query_conditions} cursor1 = collection.find({'$and': [filter_query, {'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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }]}).limit(_mix_seed_limit_primary(lineup_num, prio_mix)) cursor2 = collection.find({'$and': [filter_query, {'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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }]}).sort('Own', -1).limit(_mix_seed_limit_secondary(lineup_num, prio_mix)) else: 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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }).limit(_mix_seed_limit_primary(lineup_num, prio_mix)) 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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }).sort('Own', -1).limit(_mix_seed_limit_secondary(lineup_num, prio_mix)) raw_display = pd.concat([pd.DataFrame(list(cursor1)), pd.DataFrame(list(cursor2))]) else: 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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }).limit(_mix_seed_limit_primary(lineup_num, prio_mix)) 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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }).sort('Own', -1).limit(_mix_seed_limit_secondary(lineup_num, prio_mix)) raw_display = pd.concat([pd.DataFrame(list(cursor1)), pd.DataFrame(list(cursor2))]) else: 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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }).sort(prio_var, -1).limit(lineup_num) raw_display = pd.DataFrame(list(cursor)) @@ -1274,30 +1274,30 @@ def init_DK_NHL_lineups(type_var, slate_var, prio_var, prio_mix, nhl_db_translat if query_conditions: filter_query = {'$or': query_conditions} cursor1 = collection.find({'$and': [filter_query, {'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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }]}).limit(_mix_seed_limit_primary(lineup_num, prio_mix)) cursor2 = collection.find({'$and': [filter_query, {'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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }]}).sort('Own', -1).limit(_mix_seed_limit_secondary(lineup_num, prio_mix)) else: 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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }).limit(_mix_seed_limit_primary(lineup_num, prio_mix)) 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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }).sort('Own', -1).limit(_mix_seed_limit_secondary(lineup_num, prio_mix)) raw_display = pd.concat([pd.DataFrame(list(cursor1)), pd.DataFrame(list(cursor2))]) else: 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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }).limit(_mix_seed_limit_primary(lineup_num, prio_mix)) 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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }).sort('Own', -1).limit(_mix_seed_limit_secondary(lineup_num, prio_mix)) raw_display = pd.concat([pd.DataFrame(list(cursor1)), pd.DataFrame(list(cursor2))]) else: 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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }).sort(prio_var, -1).limit(lineup_num) raw_display = pd.DataFrame(list(cursor)) @@ -1329,30 +1329,30 @@ def init_DK_NHL_lineups(type_var, slate_var, prio_var, prio_mix, nhl_db_translat if query_conditions: filter_query = {'$or': query_conditions} cursor1 = collection.find({'$and': [filter_query, {'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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }]}).limit(_mix_seed_limit_primary(lineup_num, prio_mix)) cursor2 = collection.find({'$and': [filter_query, {'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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }]}).sort('Own', -1).limit(_mix_seed_limit_secondary(lineup_num, prio_mix)) else: 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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }).limit(_mix_seed_limit_primary(lineup_num, prio_mix)) 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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }).sort('Own', -1).limit(_mix_seed_limit_secondary(lineup_num, prio_mix)) raw_display = pd.concat([pd.DataFrame(list(cursor1)), pd.DataFrame(list(cursor2))]) else: 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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }).limit(_mix_seed_limit_primary(lineup_num, prio_mix)) 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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }).sort('Own', -1).limit(_mix_seed_limit_secondary(lineup_num, prio_mix)) raw_display = pd.concat([pd.DataFrame(list(cursor1)), pd.DataFrame(list(cursor2))]) else: 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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }).sort(prio_var, -1).limit(lineup_num) raw_display = pd.DataFrame(list(cursor)) @@ -1429,30 +1429,30 @@ def init_FD_NHL_lineups(type_var, slate_var, prio_var, prio_mix, nhl_db_translat if query_conditions: filter_query = {'$or': query_conditions} cursor1 = collection.find({'$and': [filter_query, {'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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }]}).limit(_mix_seed_limit_primary(lineup_num, prio_mix)) cursor2 = collection.find({'$and': [filter_query, {'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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }]}).sort('Own', -1).limit(_mix_seed_limit_secondary(lineup_num, prio_mix)) else: 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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }).limit(_mix_seed_limit_primary(lineup_num, prio_mix)) 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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }).sort('Own', -1).limit(_mix_seed_limit_secondary(lineup_num, prio_mix)) raw_display = pd.concat([pd.DataFrame(list(cursor1)), pd.DataFrame(list(cursor2))]) else: 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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }).limit(_mix_seed_limit_primary(lineup_num, prio_mix)) 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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }).sort('Own', -1).limit(_mix_seed_limit_secondary(lineup_num, prio_mix)) raw_display = pd.concat([pd.DataFrame(list(cursor1)), pd.DataFrame(list(cursor2))]) else: 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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }).sort(prio_var, -1).limit(lineup_num) raw_display = pd.DataFrame(list(cursor)) @@ -1484,30 +1484,30 @@ def init_FD_NHL_lineups(type_var, slate_var, prio_var, prio_mix, nhl_db_translat if query_conditions: filter_query = {'$or': query_conditions} cursor1 = collection.find({'$and': [filter_query, {'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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }]}).limit(_mix_seed_limit_primary(lineup_num, prio_mix)) cursor2 = collection.find({'$and': [filter_query, {'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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }]}).sort('Own', -1).limit(_mix_seed_limit_secondary(lineup_num, prio_mix)) else: 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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }).limit(_mix_seed_limit_primary(lineup_num, prio_mix)) 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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }).sort('Own', -1).limit(_mix_seed_limit_secondary(lineup_num, prio_mix)) raw_display = pd.concat([pd.DataFrame(list(cursor1)), pd.DataFrame(list(cursor2))]) else: 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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }).limit(_mix_seed_limit_primary(lineup_num, prio_mix)) 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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }).sort('Own', -1).limit(_mix_seed_limit_secondary(lineup_num, prio_mix)) raw_display = pd.concat([pd.DataFrame(list(cursor1)), pd.DataFrame(list(cursor2))]) else: 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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }).sort(prio_var, -1).limit(lineup_num) raw_display = pd.DataFrame(list(cursor)) @@ -1539,30 +1539,30 @@ def init_FD_NHL_lineups(type_var, slate_var, prio_var, prio_mix, nhl_db_translat if query_conditions: filter_query = {'$or': query_conditions} cursor1 = collection.find({'$and': [filter_query, {'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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }]}).limit(_mix_seed_limit_primary(lineup_num, prio_mix)) cursor2 = collection.find({'$and': [filter_query, {'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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }]}).sort('Own', -1).limit(math.ceil(lineup_num = ((100 - prio_mix) / 100))) else: 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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }).limit(_mix_seed_limit_primary(lineup_num, prio_mix)) 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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }).sort('Own', -1).limit(_mix_seed_limit_secondary(lineup_num, prio_mix)) raw_display = pd.concat([pd.DataFrame(list(cursor1)), pd.DataFrame(list(cursor2))]) else: 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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }).limit(_mix_seed_limit_primary(lineup_num, prio_mix)) 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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }).sort('Own', -1).limit(_mix_seed_limit_secondary(lineup_num, prio_mix)) raw_display = pd.concat([pd.DataFrame(list(cursor1)), pd.DataFrame(list(cursor2))]) else: 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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }).sort(prio_var, -1).limit(lineup_num) raw_display = pd.DataFrame(list(cursor)) @@ -1707,30 +1707,30 @@ def init_DK_MLB_lineups(type_var, slate_var, prio_var, prio_mix, mlb_db_translat if query_conditions: filter_query = {'$or': query_conditions} cursor1 = collection.find({'$and': [filter_query, {'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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }]}).limit(_mix_seed_limit_primary(lineup_num, prio_mix)) cursor2 = collection.find({'$and': [filter_query, {'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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }]}).sort('Own', -1).limit(_mix_seed_limit_secondary(lineup_num, prio_mix)) else: 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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }).limit(_mix_seed_limit_primary(lineup_num, prio_mix)) 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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }).sort('Own', -1).limit(_mix_seed_limit_secondary(lineup_num, prio_mix)) raw_display = pd.concat([pd.DataFrame(list(cursor1)), pd.DataFrame(list(cursor2))]) else: 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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }).limit(_mix_seed_limit_primary(lineup_num, prio_mix)) 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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }).sort('Own', -1).limit(_mix_seed_limit_secondary(lineup_num, prio_mix)) raw_display = pd.concat([pd.DataFrame(list(cursor1)), pd.DataFrame(list(cursor2))]) else: 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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }).sort(prio_var, -1).limit(lineup_num) raw_display = pd.DataFrame(list(cursor)) @@ -1762,30 +1762,30 @@ def init_DK_MLB_lineups(type_var, slate_var, prio_var, prio_mix, mlb_db_translat if query_conditions: filter_query = {'$or': query_conditions} cursor1 = collection.find({'$and': [filter_query, {'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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }]}).limit(_mix_seed_limit_primary(lineup_num, prio_mix)) cursor2 = collection.find({'$and': [filter_query, {'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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }]}).sort('Own', -1).limit(_mix_seed_limit_secondary(lineup_num, prio_mix)) else: 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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }).limit(_mix_seed_limit_primary(lineup_num, prio_mix)) 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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }).sort('Own', -1).limit(_mix_seed_limit_secondary(lineup_num, prio_mix)) raw_display = pd.concat([pd.DataFrame(list(cursor1)), pd.DataFrame(list(cursor2))]) else: 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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }).limit(_mix_seed_limit_primary(lineup_num, prio_mix)) 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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }).sort('Own', -1).limit(_mix_seed_limit_secondary(lineup_num, prio_mix)) raw_display = pd.concat([pd.DataFrame(list(cursor1)), pd.DataFrame(list(cursor2))]) else: 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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }).sort(prio_var, -1).limit(lineup_num) raw_display = pd.DataFrame(list(cursor)) @@ -1817,30 +1817,30 @@ def init_DK_MLB_lineups(type_var, slate_var, prio_var, prio_mix, mlb_db_translat if query_conditions: filter_query = {'$or': query_conditions} cursor1 = collection.find({'$and': [filter_query, {'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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }]}).limit(_mix_seed_limit_primary(lineup_num, prio_mix)) cursor2 = collection.find({'$and': [filter_query, {'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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }]}).sort('Own', -1).limit(_mix_seed_limit_secondary(lineup_num, prio_mix)) else: 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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }).limit(_mix_seed_limit_primary(lineup_num, prio_mix)) 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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }).sort('Own', -1).limit(_mix_seed_limit_secondary(lineup_num, prio_mix)) raw_display = pd.concat([pd.DataFrame(list(cursor1)), pd.DataFrame(list(cursor2))]) else: 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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }).limit(_mix_seed_limit_primary(lineup_num, prio_mix)) 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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }).sort('Own', -1).limit(_mix_seed_limit_secondary(lineup_num, prio_mix)) raw_display = pd.concat([pd.DataFrame(list(cursor1)), pd.DataFrame(list(cursor2))]) else: 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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }).sort(prio_var, -1).limit(lineup_num) raw_display = pd.DataFrame(list(cursor)) @@ -1917,30 +1917,30 @@ def init_FD_MLB_lineups(type_var, slate_var, prio_var, prio_mix, mlb_db_translat if query_conditions: filter_query = {'$or': query_conditions} cursor1 = collection.find({'$and': [filter_query, {'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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }]}).limit(_mix_seed_limit_primary(lineup_num, prio_mix)) cursor2 = collection.find({'$and': [filter_query, {'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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }]}).sort('Own', -1).limit(_mix_seed_limit_secondary(lineup_num, prio_mix)) else: 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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }).limit(_mix_seed_limit_primary(lineup_num, prio_mix)) 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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }).sort('Own', -1).limit(_mix_seed_limit_secondary(lineup_num, prio_mix)) raw_display = pd.concat([pd.DataFrame(list(cursor1)), pd.DataFrame(list(cursor2))]) else: 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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }).limit(_mix_seed_limit_primary(lineup_num, prio_mix)) 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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }).sort('Own', -1).limit(_mix_seed_limit_secondary(lineup_num, prio_mix)) raw_display = pd.concat([pd.DataFrame(list(cursor1)), pd.DataFrame(list(cursor2))]) else: 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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }).sort(prio_var, -1).limit(lineup_num) raw_display = pd.DataFrame(list(cursor)) @@ -1972,30 +1972,30 @@ def init_FD_MLB_lineups(type_var, slate_var, prio_var, prio_mix, mlb_db_translat if query_conditions: filter_query = {'$or': query_conditions} cursor1 = collection.find({'$and': [filter_query, {'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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }]}).limit(_mix_seed_limit_primary(lineup_num, prio_mix)) cursor2 = collection.find({'$and': [filter_query, {'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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }]}).sort('Own', -1).limit(_mix_seed_limit_secondary(lineup_num, prio_mix)) else: 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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }).limit(_mix_seed_limit_primary(lineup_num, prio_mix)) 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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }).sort('Own', -1).limit(_mix_seed_limit_secondary(lineup_num, prio_mix)) raw_display = pd.concat([pd.DataFrame(list(cursor1)), pd.DataFrame(list(cursor2))]) else: 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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }).limit(_mix_seed_limit_primary(lineup_num, prio_mix)) 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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }).sort('Own', -1).limit(_mix_seed_limit_secondary(lineup_num, prio_mix)) raw_display = pd.concat([pd.DataFrame(list(cursor1)), pd.DataFrame(list(cursor2))]) else: 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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }).sort(prio_var, -1).limit(lineup_num) raw_display = pd.DataFrame(list(cursor)) @@ -2027,30 +2027,30 @@ def init_FD_MLB_lineups(type_var, slate_var, prio_var, prio_mix, mlb_db_translat if query_conditions: filter_query = {'$or': query_conditions} cursor1 = collection.find({'$and': [filter_query, {'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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }]}).limit(_mix_seed_limit_primary(lineup_num, prio_mix)) cursor2 = collection.find({'$and': [filter_query, {'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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }]}).sort('Own', -1).limit(math.ceil(lineup_num = ((100 - prio_mix) / 100))) else: 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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }).limit(_mix_seed_limit_primary(lineup_num, prio_mix)) 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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }).sort('Own', -1).limit(_mix_seed_limit_secondary(lineup_num, prio_mix)) raw_display = pd.concat([pd.DataFrame(list(cursor1)), pd.DataFrame(list(cursor2))]) else: 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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }).limit(_mix_seed_limit_primary(lineup_num, prio_mix)) 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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }).sort('Own', -1).limit(_mix_seed_limit_secondary(lineup_num, prio_mix)) raw_display = pd.concat([pd.DataFrame(list(cursor1)), pd.DataFrame(list(cursor2))]) else: 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}, - 'Secondary_Team_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, + 'Secondary_count': {'$gte': secondary_team_count_min if secondary_team_count_min is not None else 1, '$lte': secondary_team_count_max if secondary_team_count_max is not None else 999}, }).sort(prio_var, -1).limit(lineup_num) raw_display = pd.DataFrame(list(cursor))