BenBrostoff / draftfast

A tool to automate and optimize DraftKings and FanDuel lineup construction.
282 stars 112 forks source link

duo/dtype not implemented? #86

Closed sharkiteuthis closed 5 years ago

sharkiteuthis commented 5 years ago

I'm working off my branch and it doesn't seem like the 'duo' and 'dtype' constraints are actually implemented. Are these stashed on another branch somewhere?

# nosetests --exe
....F......................
======================================================================
FAIL: test.test_command_line.test_duo_constraint
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/nose/case.py", line 198, in runTest
    self.test(*self.arg)
  File "/dk/test/test_command_line.py", line 78, in test_duo_constraint
    ntools.assert_equal(team_instances[team], 2)
AssertionError: 0 != 2
-------------------- >> begin captured stdout << ---------------------
Optimized over 622 players
Optimal roster for: NFL
+------------+-----------------+------+--------------------+--------+------------+----------+--------+
| Position   | Player          | Team | Matchup            | Salary | Projection | vs. Avg. | Locked |
+------------+-----------------+------+--------------------+--------+------------+----------+--------+
| QB         | Russell Wilson  | Sea  | Mia@Sea 04:05PM ET |   7900 |       20.6 |    -1.17 |        |
| RB         | Lamar Miller    | Hou  | Chi@Hou 01:00PM ET |   7000 |       14.6 |    -0.52 |        |
| RB         | Latavius Murray | Oak  | Oak@NO 01:00PM ET  |   5600 |       12.0 |    -1.24 |        |
| RB         | Spencer Ware    | KC   | SD@KC 01:00PM ET   |   4400 |       11.8 |     4.22 |        |
| WR         | Amari Cooper    | Oak  | Oak@NO 01:00PM ET  |   7200 |       11.6 |    -2.69 |        |
| WR         | Vincent Jackson | TB   | TB@Atl 01:00PM ET  |   4400 |        7.1 |    -3.93 |        |
| WR         | Tajae Sharpe    | Ten  | Min@Ten 01:00PM ET |   3000 |        5.5 |     5.50 |        |
| QB/TE (TE) | Eli Manning     | NYG  | NYG@Dal 04:25PM ET |   7500 |       17.8 |    -2.41 |        |
| DST        | Bengals         | Cin  | Cin@NYJ 01:00PM ET |   3000 |        8.2 |    -0.57 |        |
+------------+-----------------+------+--------------------+--------+------------+----------+--------+

Projected Score: 109.20          Cost: $50000

--------------------- >> end captured stdout << ----------------------

----------------------------------------------------------------------
Ran 27 tests in 5.909s

FAILED (failures=1)
sharkiteuthis commented 5 years ago

I was about to implement it, and then realized that the combo flag exists, and is more useful for multiple lineups. I suggest simply removing duo/dtype. I'll make a branch and rewrite the tests.

sharkiteuthis commented 5 years ago

PR #87

BenBrostoff commented 5 years ago

Closed, thank you @sharkiteuthis