diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index eb28523..d46c22d 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -13,7 +13,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ["3.8", "3.9", "3.10"] + python-version: ["3.8", "3.9", "3.10", "3.11"] steps: - uses: actions/checkout@v2 @@ -47,4 +47,3 @@ jobs: uses: codecov/codecov-action@v2 with: fail_ci_if_error: true - diff --git a/.github/workflows/pythonpublish.yml b/.github/workflows/pythonpublish.yml index 0f11676..871113e 100644 --- a/.github/workflows/pythonpublish.yml +++ b/.github/workflows/pythonpublish.yml @@ -12,7 +12,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v1 with: - python-version: '3.7' + python-version: '3.11' - name: Install dependencies run: | python -m pip install --upgrade pip diff --git a/README.md b/README.md index 81f20fb..317eb44 100644 --- a/README.md +++ b/README.md @@ -76,7 +76,7 @@ Only one Waiver claim (for Jordon Howard) increases discounted points. ## Contribution -Please add Issues or submit Pull requests! +Please add Issues or submit Pull Requests! For local development, install optional testing dependencies and pre-commit hooks using diff --git a/ffbot/constants.py b/ffbot/constants.py index fbe7cc2..bd32bc2 100644 --- a/ffbot/constants.py +++ b/ffbot/constants.py @@ -1 +1 @@ -VERSION = "1.2.2" +VERSION = "1.2.3" diff --git a/ffbot/scraper.py b/ffbot/scraper.py index 9426176..7b3c38d 100644 --- a/ffbot/scraper.py +++ b/ffbot/scraper.py @@ -1,4 +1,5 @@ from datetime import datetime +from io import StringIO import numpy as np import pandas as pd @@ -123,7 +124,7 @@ def get_projections(row): row["% Owned"] = playerinfo.select_one("dd.owned").text.split()[0] # Weekly projections - df2 = pd.read_html(html)[0] + df2 = pd.read_html(StringIO(html))[0] for _, row2 in df2.iterrows(): week = "Week {}".format(row2["Week"]) points = row2["Fan Pts"] @@ -157,7 +158,9 @@ def get_projections(row): columns = ["Week {}".format(i) for i in range(current_week(), 18)] df["Remaining"] = df[columns].sum(axis=1) available = df.loc[df["Owner ID"].isnull()] - means = available.groupby(["Position"])["Remaining"].nlargest(3).mean(level=0) + means = ( + available.groupby(["Position"])["Remaining"].nlargest(3).groupby(level=0).mean() + ) for positions in means.index: if "," in positions: for position in positions.split(","):