Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds Python 3.11 support, by fixing pandas.groupby.mean() removing kwarg 'level' #76

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -47,4 +47,3 @@ jobs:
uses: codecov/codecov-action@v2
with:
fail_ci_if_error: true

2 changes: 1 addition & 1 deletion .github/workflows/pythonpublish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion ffbot/constants.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
VERSION = "1.2.2"
VERSION = "1.2.3"
7 changes: 5 additions & 2 deletions ffbot/scraper.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from datetime import datetime
from io import StringIO

import numpy as np
import pandas as pd
Expand Down Expand Up @@ -123,7 +124,7 @@
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]

Check warning on line 127 in ffbot/scraper.py

View check run for this annotation

Codecov / codecov/patch

ffbot/scraper.py#L127

Added line #L127 was not covered by tests
for _, row2 in df2.iterrows():
week = "Week {}".format(row2["Week"])
points = row2["Fan Pts"]
Expand Down Expand Up @@ -157,7 +158,9 @@
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 = (

Check warning on line 161 in ffbot/scraper.py

View check run for this annotation

Codecov / codecov/patch

ffbot/scraper.py#L161

Added line #L161 was not covered by tests
available.groupby(["Position"])["Remaining"].nlargest(3).groupby(level=0).mean()
)
for positions in means.index:
if "," in positions:
for position in positions.split(","):
Expand Down
Loading