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

Fixing DK college football not working (issue #313) #415

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
1 change: 1 addition & 0 deletions pydfs_lineup_optimizer/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,4 @@ class Sport:
NASCAR = 'NASCAR'
TENNIS = 'TENNIS'
CS = 'CS'
COLLEGE_BASKETBALL = 'COLLEGE_BASKETBALL'
12 changes: 9 additions & 3 deletions pydfs_lineup_optimizer/lineup_exporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,16 +74,22 @@ def render_player(player: 'LineupPlayer') -> str:


class FanDuelCSVLineupExporter(CSVLineupExporter):
EXTRA_COLUMNS = ()
EXTRA_COLUMNS = ('Budget', 'FPPG')
COLUMNS_MAPPING = {
'MVP': 'MVP - 2X Points',
'STAR': 'STAR - 1.5X Points',
'PRO': 'PRO - 1.2X Points',
'CAPTAIN': 'Captain - 1.5x Pts',
}

def _get_extra_columns(self, lineup):
return []
# def _get_extra_columns(self, lineup):
# return []

def _get_extra_columns(self, lineup: 'Lineup') -> List[str]:
return [
str(lineup.salary_costs),
str(lineup.fantasy_points_projection),
]

@staticmethod
def render_player(player: 'LineupPlayer') -> str:
Expand Down
18 changes: 17 additions & 1 deletion pydfs_lineup_optimizer/sites/draftkings/classic/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,22 @@ class DraftKingsBasketballSettings(DraftKingsSettings):
]


@SitesRegistry.register_settings
class DraftKingsCollegeBasketballSettings(DraftKingsSettings):
sport = Sport.COLLEGE_BASKETBALL
min_games = 2
positions = [
LineupPosition('G', ('G', )),
LineupPosition('G', ('G', )),
LineupPosition('G', ('G', )),
LineupPosition('F', ('F', )),
LineupPosition('F', ('F', )),
LineupPosition('F', ('F', )),
LineupPosition('UTIL', ('G', 'F')),
LineupPosition('UTIL', ('G', 'F'))
]


@SitesRegistry.register_settings
class DraftKingsWNBASettings(DraftKingsSettings):
sport = Sport.WNBA
Expand Down Expand Up @@ -145,7 +161,7 @@ class DraftKingsCanadianFootballSettings(DraftKingsSettings):

@SitesRegistry.register_settings
class DraftKingsCollegeFootballSettings(DraftKingsSettings):
sport = Sport.CANADIAN_FOOTBALL
sport = Sport.COLLEGE_FOOTBALL
min_games = 2
positions = [
LineupPosition('QB', ('QB', )),
Expand Down
31 changes: 30 additions & 1 deletion pydfs_lineup_optimizer/sites/fanduel/classic/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from pydfs_lineup_optimizer.rules import OptimizerRule, FanduelBaseballRosterRule
from pydfs_lineup_optimizer.sites.fanduel.classic.importer import FanDuelCSVImporter, FanDuelLOLCSVImporter, \
FanDuelMVPCSVImporter
from pydfs_lineup_optimizer.lineup_exporter import FanDuelCSVLineupExporter
from pydfs_lineup_optimizer.lineup_exporter import CSVLineupExporter, FanDuelCSVLineupExporter


class FanDuelSettings(BaseSettings):
Expand Down Expand Up @@ -34,6 +34,21 @@ class FanDuelBasketballSettings(FanDuelSettings):
]


@SitesRegistry.register_settings
class FanDuelCollegeBasketballSettings(FanDuelSettings):
sport = Sport.COLLEGE_BASKETBALL
positions = [
LineupPosition('G', ('G', )),
LineupPosition('G', ('G', )),
LineupPosition('G', ('G', )),
LineupPosition('G', ('G', )),
LineupPosition('F', ('F', )),
LineupPosition('F', ('F', )),
LineupPosition('F', ('F', )),
LineupPosition('UTIL', ('G', 'F'))
]


@SitesRegistry.register_settings
class FanDuelFootballSettings(FanDuelSettings):
sport = Sport.FOOTBALL
Expand Down Expand Up @@ -169,3 +184,17 @@ class FanDuelMMASettings(FanDuelSettings):
LineupPosition('F', ('F', )),
]

@SitesRegistry.register_settings
class FanDuelCollegeFootballSettings(FanDuelSettings):
sport = Sport.COLLEGE_FOOTBALL
positions = [
LineupPosition('QB', ('QB', )),
LineupPosition('RB', ('RB', )),
LineupPosition('RB', ('RB', )),
LineupPosition('WR', ('WR', )),
LineupPosition('WR', ('WR', )),
LineupPosition('WR', ('WR', )),
LineupPosition('SUPER FLEX', ('QB', 'RB', 'WR')),
]