diff --git a/airsenal/framework/mappings.py b/airsenal/framework/mappings.py index 63a78e54..5c521b34 100644 --- a/airsenal/framework/mappings.py +++ b/airsenal/framework/mappings.py @@ -2,7 +2,7 @@ map between different conventions used in different data sources. """ -positions = {1: "GK", 2: "DEF", 3: "MID", 4: "FWD"} +positions = {1: "GK", 2: "DEF", 3: "MID", 4: "FWD", 5: "MNG"} alternative_team_names = { "ARS": ["1", "Arsenal", "Arsenal FC"], diff --git a/airsenal/framework/utils.py b/airsenal/framework/utils.py index 2c2ed10a..1718c59c 100644 --- a/airsenal/framework/utils.py +++ b/airsenal/framework/utils.py @@ -217,8 +217,10 @@ def get_next_season(season: str) -> str: """ start_year = int(season[:2]) end_year = int(season[2:]) - next_start_year = f"0{start_year+1}" if start_year + 1 < 10 else str(start_year + 1) - next_end_year = f"0{end_year+1}" if end_year + 1 < 10 else str(end_year + 1) + next_start_year = ( + f"0{start_year + 1}" if start_year + 1 < 10 else str(start_year + 1) + ) + next_end_year = f"0{end_year + 1}" if end_year + 1 < 10 else str(end_year + 1) return f"{next_start_year}{next_end_year}" @@ -683,6 +685,9 @@ def list_players( q = q.filter_by(team=team) if position != "all": q = q.filter_by(position=position) + else: + # exclude managers + q = q.filter(PlayerAttributes.position != "MNG") if len(gameweeks) > 1: #  Sort query results by order of gameweeks - i.e. make sure the input # query gameweek comes first. @@ -1115,8 +1120,7 @@ def get_top_predicted_points( discord_embed = { "title": "AIrsenal webhook", - "description": f"PREDICTED TOP {n_players} " - f"PLAYERS FOR GAMEWEEK(S) {gameweek}:", + "description": f"PREDICTED TOP {n_players} PLAYERS FOR GAMEWEEK(S) {gameweek}:", "color": 0x35A800, "fields": [], } diff --git a/airsenal/scripts/fill_player_attributes_table.py b/airsenal/scripts/fill_player_attributes_table.py index 89b18fb0..056c3039 100644 --- a/airsenal/scripts/fill_player_attributes_table.py +++ b/airsenal/scripts/fill_player_attributes_table.py @@ -3,6 +3,7 @@ """ Fill the "Player" table with info from this and past seasonss FPL """ + import json import os from typing import List, Optional diff --git a/pyproject.toml b/pyproject.toml index 8f380b5a..14978b84 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "airsenal" -version = "1.9.0" +version = "1.9.1" description = "AI manager for Fantasy Premier League" authors = [ "Angus Williams ",