Skip to content

Commit

Permalink
Merge pull request #74 from amarvin/72-current_week-failing
Browse files Browse the repository at this point in the history
Fix 2023 public league IDs
  • Loading branch information
amarvin authored Sep 6, 2023
2 parents d46d725 + 1957480 commit fbfd8d6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion ffbot/constants.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
VERSION = "1.2.0"
VERSION = "1.2.1"
10 changes: 8 additions & 2 deletions ffbot/scraper.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
from user_agent import generate_user_agent

# A public league for current week and player IDs
PUBLIC_LEAGUE = 76554
PUBLIC_LEAGUE_IDP = 22621
PUBLIC_LEAGUE = 16
PUBLIC_LEAGUE_IDP = 762
SEARCH_PLAYER_GROUPS = ["QB", "WR", "RB", "TE", "K", "DEF"]
SEARCH_PLAYER_GROUPS_IDP = ["QB", "WR", "RB", "TE", "K", "D", "DB", "DL", "LB"]

Expand Down Expand Up @@ -158,6 +158,12 @@ def get_projections(row):
df["Remaining"] = df[columns].sum(axis=1)
available = df.loc[df["Owner ID"].isnull()]
means = available.groupby(["Position"])["Remaining"].nlargest(3).mean(level=0)
for positions in means.index:
if "," in positions:
for position in positions.split(","):
position = position.strip()
if position not in means:
means[position] = means[positions]
df["VOR"] = df.apply(
lambda row: row["Remaining"]
- max(means[n.strip()] for n in row["Position"].split(",")),
Expand Down

0 comments on commit fbfd8d6

Please sign in to comment.