Skip to content

Commit

Permalink
Fix min teams for all DK
Browse files Browse the repository at this point in the history
  • Loading branch information
BenBrostoff committed Dec 26, 2023
1 parent ba2ebc6 commit 9912072
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions draftfast/rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ def __init__(
salary_max=SALARY_CAP_BY_SITE_BY_LEAGUE[DRAFT_KINGS]["NBA"],
position_limits=POSITIONS_BY_SITE_BY_LEAGUE[DRAFT_KINGS]["NBA"],
general_position_limits=NBA_GENERAL_POSITIONS,
min_teams=3,
)

DK_NBA_SHOWDOWN_RULE_SET = RuleSet(
Expand Down Expand Up @@ -78,6 +79,7 @@ def __init__(
salary_max=SALARY_CAP_BY_SITE_BY_LEAGUE[DRAFT_KINGS]["WNBA"],
position_limits=POSITIONS_BY_SITE_BY_LEAGUE[DRAFT_KINGS]["WNBA"],
general_position_limits=NBA_GENERAL_POSITIONS,
min_teams=3,
)

FD_WNBA_RULE_SET = RuleSet(
Expand All @@ -98,6 +100,7 @@ def __init__(
offensive_positions=["QB", "RB", "WR", "TE"],
defensive_positions=["DST"],
general_position_limits=[],
min_teams=3,
)

FD_NFL_RULE_SET = RuleSet(
Expand Down Expand Up @@ -253,6 +256,7 @@ def __init__(
position_limits=POSITIONS_BY_SITE_BY_LEAGUE[DRAFT_KINGS]["NHL"],
offensive_positions=["C", "W"],
defensive_positions=["G", "D"],
min_teams=3,
general_position_limits=[],
)

Expand Down
3 changes: 2 additions & 1 deletion draftfast/test/test_optimize.py
Original file line number Diff line number Diff line change
Expand Up @@ -739,15 +739,16 @@ def test_no_opposing_def_dk_nfl_mock():
assertions.assertEqual(roster, None)

# relax min teams
rules.DK_NFL_RULE_SET.min_teams = 1
roster = run(
rule_set=rules.DK_NFL_RULE_SET,
player_pool=mock_pool,
optimizer_settings=OptimizerSettings(
min_teams=1,
no_offense_against_defense=True,
),
verbose=True,
)
rules.DK_NFL_RULE_SET.min_teams = 3

assertions.assertEqual(roster.projected(), 877)
assertions.assertEqual(len(set([p.team for p in roster.players])), 1)
Expand Down

0 comments on commit 9912072

Please sign in to comment.